diff --git a/assets/images/drawer/background.png b/assets/images/drawer/background.png new file mode 100644 index 0000000..35c9c74 Binary files /dev/null and b/assets/images/drawer/background.png differ diff --git a/assets/images/drawer/user.png b/assets/images/drawer/user.png new file mode 100644 index 0000000..ea9298b Binary files /dev/null and b/assets/images/drawer/user.png differ diff --git a/lib/widgets/drawer/app_drawer.dart b/lib/widgets/drawer/app_drawer.dart index 7e0ecbe..e394d0c 100644 --- a/lib/widgets/drawer/app_drawer.dart +++ b/lib/widgets/drawer/app_drawer.dart @@ -1,5 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:satu/core/redux/actions/nav_actions.dart'; import 'package:satu/core/redux/actions/user_actions.dart'; import 'package:satu/core/redux/store.dart'; @@ -17,11 +18,14 @@ class AppDrawer extends StatelessWidget { padding: EdgeInsets.zero, children: [ _createHeader(), - _createDrawerItem(icon: Icons.contacts, text: 'Касса', onTap: () { - Navigator.of(context).pop(); - Redux.store!.dispatch(navigateDrawer(WorkView)); - }), - Divider(), + _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), @@ -44,18 +48,24 @@ class AppDrawer extends StatelessWidget { Navigator.of(context).pop(); }, ), - ], + ], ), - _createDrawerItem(icon: Icons.settings, text: 'Настройки', onTap: () { - Navigator.of(context).pop(); - Redux.store!.dispatch(navigateDrawer(SettingsView)); - }), + _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); - }), + _createDrawerItem( + icon: Icons.exit_to_app, + text: 'Выйти из аккаунта', + onTap: () async { + Redux.store!.dispatch(logout); + }), ListTile( title: Text('0.0.1'), ), @@ -65,32 +75,50 @@ class AppDrawer extends StatelessWidget { } Widget _createHeader() { - return DrawerHeader( - margin: EdgeInsets.zero, - padding: EdgeInsets.zero, - decoration: BoxDecoration( - color: primaryColor - ), - // decoration: BoxDecoration( - // image: DecorationImage( - // fit: BoxFit.fill, - // image: AssetImage('assets/images/halyk-bank.png'))), - child: Stack(children: [ - Positioned( - bottom: 12.0, - left: 16.0, - child: Text('Сату - онлайн касса', - style: TextStyle( - color: Colors.white, - fontSize: 20.0, - fontWeight: FontWeight.w500) - ) - ), - ])); + return SizedBox( + height: 180.h, + child: DrawerHeader( + margin: EdgeInsets.zero, + padding: EdgeInsets.zero, + decoration: const BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage('assets/images/drawer/background.png'))), + child: Stack(children: [ + Positioned( + bottom: 12.0, + left: 16.0, + child: Row( + children: [ + SizedBox( + height: 40, + width: 40, + child: Container( + decoration: const BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage( + 'assets/images/drawer/user.png')))), + ), + horizontalSpaceSmall, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: const [ + Text('Хайруллин Тимур', + style: TextStyle(fontSize: 16.0)), + Text('Продавец', style: TextStyle(fontSize: 12)), + ], + ), + ], + )), + ])), + ); } Widget _createDrawerItem( - {required IconData icon, required String text, GestureTapCallback? onTap}) { + {required IconData icon, + required String text, + GestureTapCallback? onTap}) { return ListTile( title: Row( children: [ @@ -104,5 +132,4 @@ class AppDrawer extends StatelessWidget { onTap: onTap, ); } - -} \ No newline at end of file +} diff --git a/pubspec.lock b/pubspec.lock index 5e840a5..6ee5602 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -330,14 +330,14 @@ packages: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.1.2" + version: "8.1.4+2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.6.0" + version: "3.6.1" platform: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 3ca11b7..0d18a02 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 + cupertino_icons: ^1.0.3 redux: ^5.0.0 flutter_redux: ^0.8.2 redux_thunk: ^0.4.0 @@ -55,7 +55,7 @@ dependencies: uuid: ^3.0.4 charset_converter: ^2.0.0 ai_barcode: ^3.0.1 - permission_handler: ^8.1.2 + permission_handler: ^8.1.4+2 dev_dependencies: flutter_test: sdk: flutter @@ -76,6 +76,7 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - assets/images/ + - assets/images/drawer/ - assets/lang/en.json - assets/lang/ru.json - assets/google_fonts/