diff --git a/web/repertory/lib/constants.dart b/web/repertory/lib/constants.dart index 1fb966ed..0d910933 100644 --- a/web/repertory/lib/constants.dart +++ b/web/repertory/lib/constants.dart @@ -1 +1 @@ -const String APP_TITLE = "Repertory Management Portal"; +const String app_title = "Repertory Management Portal"; diff --git a/web/repertory/lib/main.dart b/web/repertory/lib/main.dart index 464c493c..1090145f 100644 --- a/web/repertory/lib/main.dart +++ b/web/repertory/lib/main.dart @@ -15,11 +15,11 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - title: constants.APP_TITLE, + title: constants.app_title, theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepOrange), ), - home: const MyHomePage(title: constants.APP_TITLE), + home: const MyHomePage(title: constants.app_title), ); } } diff --git a/web/repertory/lib/models/mount_list.dart b/web/repertory/lib/models/mount_list.dart index 309cfb7d..5e1ff0ed 100644 --- a/web/repertory/lib/models/mount_list.dart +++ b/web/repertory/lib/models/mount_list.dart @@ -9,14 +9,17 @@ class MountList with ChangeNotifier { UnmodifiableListView get items => UnmodifiableListView(_items); void add(MountConfig config) { - MountConfig? item = _items.firstWhereOrNull( - (cfg) => cfg.name == config.name, - ); + var item = _items.firstWhereOrNull((cfg) => cfg.name == config.name); if (item != null) { throw DuplicateMountException(name: config.name); } _items.add(config); + _items.sort((a, b) => a.name.compareTo(b.name)); notifyListeners(); } + + void remove(String name) { + _items.removeWhere((item) => item.name == name); + } }