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
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),
);
}
}

View File

@ -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);
}
}