flutter changes

This commit is contained in:
Scott E. Graves 2025-02-28 20:49:14 -06:00
parent a79e696315
commit 513bc09944
3 changed files with 9 additions and 6 deletions

View File

@ -1 +1 @@
const String APP_TITLE = "Repertory Management Portal"; const String app_title = "Repertory Management Portal";

View File

@ -15,11 +15,11 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
title: constants.APP_TITLE, title: constants.app_title,
theme: ThemeData( theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepOrange), colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepOrange),
), ),
home: const MyHomePage(title: constants.APP_TITLE), home: const MyHomePage(title: constants.app_title),
); );
} }
} }

View File

@ -9,14 +9,17 @@ class MountList with ChangeNotifier {
UnmodifiableListView get items => UnmodifiableListView(_items); UnmodifiableListView get items => UnmodifiableListView(_items);
void add(MountConfig config) { void add(MountConfig config) {
MountConfig? item = _items.firstWhereOrNull( var item = _items.firstWhereOrNull((cfg) => cfg.name == config.name);
(cfg) => cfg.name == config.name,
);
if (item != null) { if (item != null) {
throw DuplicateMountException(name: config.name); throw DuplicateMountException(name: config.name);
} }
_items.add(config); _items.add(config);
_items.sort((a, b) => a.name.compareTo(b.name));
notifyListeners(); notifyListeners();
} }
void remove(String name) {
_items.removeWhere((item) => item.name == name);
}
} }