flutter changes
This commit is contained in:
parent
a79e696315
commit
513bc09944
@ -1 +1 @@
|
||||
const String APP_TITLE = "Repertory Management Portal";
|
||||
const String app_title = "Repertory Management Portal";
|
||||
|
@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user