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
|
@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),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user