From a4e9beacda7827869149b1ed99f0408c82cb71d6 Mon Sep 17 00:00:00 2001 From: suvaissov Date: Thu, 5 Aug 2021 12:03:25 +0600 Subject: [PATCH] app_drawer.dart release --- lib/widgets/drawer/app_drawer.dart | 123 ++++++++++++++--------------- 1 file changed, 59 insertions(+), 64 deletions(-) diff --git a/lib/widgets/drawer/app_drawer.dart b/lib/widgets/drawer/app_drawer.dart index e394d0c..d09d128 100644 --- a/lib/widgets/drawer/app_drawer.dart +++ b/lib/widgets/drawer/app_drawer.dart @@ -14,62 +14,38 @@ class AppDrawer extends StatelessWidget { @override Widget build(BuildContext context) { return Drawer( - child: ListView( - padding: EdgeInsets.zero, - children: [ - _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: [ - ListTile( - title: const Text('Категории'), + child: Container( + decoration: const BoxDecoration(color: backgroundColor), + child: ListView( + padding: EdgeInsets.zero, + children: [ + _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: [ - 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: [ + 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), + )); + } }