app_drawer.dart release
parent
55e276b189
commit
a4e9beacda
|
|
@ -14,62 +14,38 @@ class AppDrawer extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: <Widget>[
|
||||
_createHeader(),
|
||||
_createDrawerItem(
|
||||
icon: Icons.contacts,
|
||||
text: 'Касса',
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
Redux.store!.dispatch(navigateDrawer(WorkView));
|
||||
}),
|
||||
const Divider(),
|
||||
ExpansionTile(
|
||||
title: Text('Справочники'), // ignore: prefer_const_constructors
|
||||
childrenPadding: const EdgeInsets.only(left: 18.0),
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
title: const Text('Категории'),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(color: backgroundColor),
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: <Widget>[
|
||||
_createHeader(),
|
||||
_createDrawerSectionTitle(text: 'СПРАВОЧНИКИ'),
|
||||
_createDrawerItem(
|
||||
icon: Icons.list,
|
||||
text: 'Категории',
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: const Text('Товары'),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: const Text('Контрагенты'),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
_createDrawerItem(
|
||||
icon: Icons.settings,
|
||||
text: 'Настройки',
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
Redux.store!.dispatch(navigateDrawer(SettingsView));
|
||||
}),
|
||||
Divider(),
|
||||
_createDrawerItem(icon: Icons.bug_report, text: 'Сообщить об ошибке'),
|
||||
verticalSpaceMedium,
|
||||
_createDrawerItem(
|
||||
icon: Icons.exit_to_app,
|
||||
text: 'Выйти из аккаунта',
|
||||
onTap: () async {
|
||||
Redux.store!.dispatch(logout);
|
||||
}),
|
||||
ListTile(
|
||||
title: Text('0.0.1'),
|
||||
),
|
||||
],
|
||||
Redux.store!.dispatch(navigateDrawer(WorkView));
|
||||
}),
|
||||
_createDrawerItem(icon: Icons.production_quantity_limits, text: 'Товары'),
|
||||
_createDrawerItem(icon: Icons.people, text: 'Контрагенты'),
|
||||
_createDrawerSectionTitle(text: 'РАЗДЕЛ'),
|
||||
_createDrawerItem(icon: Icons.check, text: 'Инвентаризация'),
|
||||
_createDrawerSectionTitle(text: 'ИНФОРМАЦИЯ'),
|
||||
_createDrawerItem(icon: Icons.question_answer, text: 'Справочник'),
|
||||
_createDrawerSectionTitle(text: 'ПРОЧЕЕ'),
|
||||
_createDrawerItem(icon: Icons.settings, text: 'Настройки'),
|
||||
_createDrawerItem(icon: Icons.next_plan, text: 'Перейти на сайт'),
|
||||
_createDrawerItem(
|
||||
icon: Icons.exit_to_app,
|
||||
text: 'Выйти из аккаунта',
|
||||
onTap: () async {
|
||||
Redux.store!.dispatch(logout);
|
||||
}),
|
||||
_createDrawerSectionTitle(text: ''),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
@ -119,17 +95,36 @@ class AppDrawer extends StatelessWidget {
|
|||
{required IconData icon,
|
||||
required String text,
|
||||
GestureTapCallback? onTap}) {
|
||||
return ListTile(
|
||||
title: Row(
|
||||
children: <Widget>[
|
||||
Icon(icon),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 8.0),
|
||||
child: Text(text),
|
||||
)
|
||||
],
|
||||
return Container(
|
||||
decoration: const BoxDecoration(color: whiteColor),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(icon),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 8.0),
|
||||
child: Text(text),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: onTap,
|
||||
);
|
||||
}
|
||||
|
||||
Widget _createDrawerSectionTitle({required String text}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Text(
|
||||
text,
|
||||
style: const TextStyle(fontSize: 10.0, color: placeholderColor),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue