drawer ui
parent
fe99db18b4
commit
cc2493ba2e
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.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/nav_actions.dart';
|
||||||
import 'package:satu/core/redux/actions/user_actions.dart';
|
import 'package:satu/core/redux/actions/user_actions.dart';
|
||||||
import 'package:satu/core/redux/store.dart';
|
import 'package:satu/core/redux/store.dart';
|
||||||
|
|
@ -17,11 +18,14 @@ class AppDrawer extends StatelessWidget {
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
_createHeader(),
|
_createHeader(),
|
||||||
_createDrawerItem(icon: Icons.contacts, text: 'Касса', onTap: () {
|
_createDrawerItem(
|
||||||
|
icon: Icons.contacts,
|
||||||
|
text: 'Касса',
|
||||||
|
onTap: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Redux.store!.dispatch(navigateDrawer(WorkView));
|
Redux.store!.dispatch(navigateDrawer(WorkView));
|
||||||
}),
|
}),
|
||||||
Divider(),
|
const Divider(),
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
title: Text('Справочники'), // ignore: prefer_const_constructors
|
title: Text('Справочники'), // ignore: prefer_const_constructors
|
||||||
childrenPadding: const EdgeInsets.only(left: 18.0),
|
childrenPadding: const EdgeInsets.only(left: 18.0),
|
||||||
|
|
@ -46,14 +50,20 @@ class AppDrawer extends StatelessWidget {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
_createDrawerItem(icon: Icons.settings, text: 'Настройки', onTap: () {
|
_createDrawerItem(
|
||||||
|
icon: Icons.settings,
|
||||||
|
text: 'Настройки',
|
||||||
|
onTap: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Redux.store!.dispatch(navigateDrawer(SettingsView));
|
Redux.store!.dispatch(navigateDrawer(SettingsView));
|
||||||
}),
|
}),
|
||||||
Divider(),
|
Divider(),
|
||||||
_createDrawerItem(icon: Icons.bug_report, text: 'Сообщить об ошибке'),
|
_createDrawerItem(icon: Icons.bug_report, text: 'Сообщить об ошибке'),
|
||||||
verticalSpaceMedium,
|
verticalSpaceMedium,
|
||||||
_createDrawerItem(icon: Icons.exit_to_app, text: 'Выйти из аккаунта', onTap: () async {
|
_createDrawerItem(
|
||||||
|
icon: Icons.exit_to_app,
|
||||||
|
text: 'Выйти из аккаунта',
|
||||||
|
onTap: () async {
|
||||||
Redux.store!.dispatch(logout);
|
Redux.store!.dispatch(logout);
|
||||||
}),
|
}),
|
||||||
ListTile(
|
ListTile(
|
||||||
|
|
@ -65,32 +75,50 @@ class AppDrawer extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _createHeader() {
|
Widget _createHeader() {
|
||||||
return DrawerHeader(
|
return SizedBox(
|
||||||
|
height: 180.h,
|
||||||
|
child: DrawerHeader(
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: primaryColor
|
image: DecorationImage(
|
||||||
),
|
fit: BoxFit.cover,
|
||||||
// decoration: BoxDecoration(
|
image: AssetImage('assets/images/drawer/background.png'))),
|
||||||
// image: DecorationImage(
|
|
||||||
// fit: BoxFit.fill,
|
|
||||||
// image: AssetImage('assets/images/halyk-bank.png'))),
|
|
||||||
child: Stack(children: <Widget>[
|
child: Stack(children: <Widget>[
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 12.0,
|
bottom: 12.0,
|
||||||
left: 16.0,
|
left: 16.0,
|
||||||
child: Text('Сату - онлайн касса',
|
child: Row(
|
||||||
style: TextStyle(
|
children: [
|
||||||
color: Colors.white,
|
SizedBox(
|
||||||
fontSize: 20.0,
|
height: 40,
|
||||||
fontWeight: FontWeight.w500)
|
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(
|
Widget _createDrawerItem(
|
||||||
{required IconData icon, required String text, GestureTapCallback? onTap}) {
|
{required IconData icon,
|
||||||
|
required String text,
|
||||||
|
GestureTapCallback? onTap}) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Row(
|
title: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|
@ -104,5 +132,4 @@ class AppDrawer extends StatelessWidget {
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -330,14 +330,14 @@ packages:
|
||||||
name: permission_handler
|
name: permission_handler
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.1.2"
|
version: "8.1.4+2"
|
||||||
permission_handler_platform_interface:
|
permission_handler_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: permission_handler_platform_interface
|
name: permission_handler_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.6.0"
|
version: "3.6.1"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ dependencies:
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.3
|
||||||
redux: ^5.0.0
|
redux: ^5.0.0
|
||||||
flutter_redux: ^0.8.2
|
flutter_redux: ^0.8.2
|
||||||
redux_thunk: ^0.4.0
|
redux_thunk: ^0.4.0
|
||||||
|
|
@ -55,7 +55,7 @@ dependencies:
|
||||||
uuid: ^3.0.4
|
uuid: ^3.0.4
|
||||||
charset_converter: ^2.0.0
|
charset_converter: ^2.0.0
|
||||||
ai_barcode: ^3.0.1
|
ai_barcode: ^3.0.1
|
||||||
permission_handler: ^8.1.2
|
permission_handler: ^8.1.4+2
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
@ -76,6 +76,7 @@ flutter:
|
||||||
# To add assets to your application, add an assets section, like this:
|
# To add assets to your application, add an assets section, like this:
|
||||||
assets:
|
assets:
|
||||||
- assets/images/
|
- assets/images/
|
||||||
|
- assets/images/drawer/
|
||||||
- assets/lang/en.json
|
- assets/lang/en.json
|
||||||
- assets/lang/ru.json
|
- assets/lang/ru.json
|
||||||
- assets/google_fonts/
|
- assets/google_fonts/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue