174 Start
parent
03bb6f5b8f
commit
4d170f524c
@ -0,0 +1,133 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// import 'package:flutter_navigation/screens/tabs.dart';
|
||||
// import 'package:flutter_navigation/widgets/main_drawer.dart';
|
||||
|
||||
class FiltersScreen extends StatefulWidget {
|
||||
const FiltersScreen({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return _FiltersScreenState();
|
||||
}
|
||||
}
|
||||
|
||||
class _FiltersScreenState extends State<FiltersScreen> {
|
||||
var _glutenFilterSet = false;
|
||||
var _lactoseFilterSet = false;
|
||||
var _vegetarianFilterSet = false;
|
||||
var _veganFilterSet = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Your Filters'),
|
||||
),
|
||||
// drawer: MainDrawer(
|
||||
// onSelectScreen: (identifier) {
|
||||
// Navigator.of(context).pop();
|
||||
// if (identifier == 'meals') {
|
||||
// Navigator.of(context).pushReplacement(
|
||||
// MaterialPageRoute(
|
||||
// builder: (ctx) => const TabsScreen(),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
body: Column(children: [
|
||||
SwitchListTile(
|
||||
value: _glutenFilterSet,
|
||||
onChanged: (isChecked) {
|
||||
setState(() {
|
||||
_glutenFilterSet = isChecked;
|
||||
});
|
||||
},
|
||||
title: Text(
|
||||
'Gluten-free',
|
||||
style: Theme.of(context).textTheme.titleLarge!.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
'Only include gluten-free meals.',
|
||||
style: Theme.of(context).textTheme.labelMedium!.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
activeColor: Theme.of(context).colorScheme.tertiary,
|
||||
contentPadding: const EdgeInsets.only(left: 34, right: 22),
|
||||
),
|
||||
SwitchListTile(
|
||||
value: _lactoseFilterSet,
|
||||
onChanged: (isChecked) {
|
||||
setState(() {
|
||||
_lactoseFilterSet = isChecked;
|
||||
});
|
||||
},
|
||||
title: Text(
|
||||
'Lactose-free',
|
||||
style: Theme.of(context).textTheme.titleLarge!.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
'Only include lactose-free meals.',
|
||||
style: Theme.of(context).textTheme.labelMedium!.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
activeColor: Theme.of(context).colorScheme.tertiary,
|
||||
contentPadding: const EdgeInsets.only(left: 34, right: 22),
|
||||
),
|
||||
SwitchListTile(
|
||||
value: _vegetarianFilterSet,
|
||||
onChanged: (isChecked) {
|
||||
setState(() {
|
||||
_vegetarianFilterSet = isChecked;
|
||||
});
|
||||
},
|
||||
title: Text(
|
||||
'Vegetarian',
|
||||
style: Theme.of(context).textTheme.titleLarge!.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
'Only include vegetarian meals.',
|
||||
style: Theme.of(context).textTheme.labelMedium!.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
activeColor: Theme.of(context).colorScheme.tertiary,
|
||||
contentPadding: const EdgeInsets.only(left: 34, right: 22),
|
||||
),
|
||||
SwitchListTile(
|
||||
value: _veganFilterSet,
|
||||
onChanged: (isChecked) {
|
||||
setState(() {
|
||||
_veganFilterSet = isChecked;
|
||||
});
|
||||
},
|
||||
title: Text(
|
||||
'Vegan',
|
||||
style: Theme.of(context).textTheme.titleLarge!.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
'Only include vegan meals.',
|
||||
style: Theme.of(context).textTheme.labelMedium!.copyWith(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
activeColor: Theme.of(context).colorScheme.tertiary,
|
||||
contentPadding: const EdgeInsets.only(left: 34, right: 22),
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue