updated locking icons and functionality
This commit is contained in:
parent
055fb7241d
commit
aac93df46b
|
|
@ -20,6 +20,7 @@ class BoxChecker extends StatelessWidget {
|
|||
cardColor: Colors.grey[800],
|
||||
scaffoldBackgroundColor: Colors.black12,
|
||||
shadowColor: Colors.black38,
|
||||
toggleableActiveColor: Colors.blue,
|
||||
colorScheme: ColorScheme.fromSwatch(
|
||||
primarySwatch: Colors.blue,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -56,13 +56,19 @@ class _CheckList extends State<CheckList> {
|
|||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text((listData != null) ? listData!.name : 'Check List: $id'),
|
||||
actions: [
|
||||
(listData != null && listData!.isTemplate! && !_editable)
|
||||
? IconButton(
|
||||
onPressed: () => _toggleEditable(), icon: Icon(Icons.edit))
|
||||
: IconButton(
|
||||
onPressed: () => _toggleEditable(), icon: Icon(Icons.save)),
|
||||
],
|
||||
actions: (listData != null && listData!.isTemplate! && !_editable)
|
||||
? [
|
||||
IconButton(
|
||||
onPressed: () => _toggleEditable(),
|
||||
icon: const Icon(Icons.lock))
|
||||
]
|
||||
: (listData != null && listData!.isTemplate!)
|
||||
? [
|
||||
IconButton(
|
||||
onPressed: () => _toggleEditable(),
|
||||
icon: const Icon(Icons.lock_open))
|
||||
]
|
||||
: [],
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemCount: list.length,
|
||||
|
|
@ -87,9 +93,15 @@ class _CheckList extends State<CheckList> {
|
|||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {
|
||||
if (listData!.isTemplate! && !_editable) {
|
||||
ScaffoldMessenger.of(context)
|
||||
..clearSnackBars()
|
||||
..showSnackBar(SnackBar(content: Text("Template is locked")));
|
||||
return;
|
||||
}
|
||||
// TODO implment adding items to lists
|
||||
},
|
||||
child: const Icon(Icons.check_box),
|
||||
child: const Icon(Icons.check_box_outlined),
|
||||
tooltip: "Add Item",
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
|
||||
|
|
|
|||
Loading…
Reference in New Issue