app_drawer.dart improvement
parent
a4e9beacda
commit
b7be7ba4e4
|
|
@ -28,7 +28,8 @@ class AppDrawer extends StatelessWidget {
|
|||
Navigator.of(context).pop();
|
||||
Redux.store!.dispatch(navigateDrawer(WorkView));
|
||||
}),
|
||||
_createDrawerItem(icon: Icons.production_quantity_limits, text: 'Товары'),
|
||||
_createDrawerItem(
|
||||
icon: Icons.production_quantity_limits, text: 'Товары'),
|
||||
_createDrawerItem(icon: Icons.people, text: 'Контрагенты'),
|
||||
_createDrawerSectionTitle(text: 'РАЗДЕЛ'),
|
||||
_createDrawerItem(icon: Icons.check, text: 'Инвентаризация'),
|
||||
|
|
@ -40,6 +41,7 @@ class AppDrawer extends StatelessWidget {
|
|||
_createDrawerItem(
|
||||
icon: Icons.exit_to_app,
|
||||
text: 'Выйти из аккаунта',
|
||||
isDanger: true,
|
||||
onTap: () async {
|
||||
Redux.store!.dispatch(logout);
|
||||
}),
|
||||
|
|
@ -94,7 +96,8 @@ class AppDrawer extends StatelessWidget {
|
|||
Widget _createDrawerItem(
|
||||
{required IconData icon,
|
||||
required String text,
|
||||
GestureTapCallback? onTap}) {
|
||||
GestureTapCallback? onTap,
|
||||
bool isDanger = false}) {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(color: whiteColor),
|
||||
child: Material(
|
||||
|
|
@ -106,10 +109,19 @@ class AppDrawer extends StatelessWidget {
|
|||
const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(icon),
|
||||
Icon(
|
||||
icon,
|
||||
size: 20.0,
|
||||
color: isDanger ? dangerColor : textColor,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 8.0),
|
||||
child: Text(text),
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: isDanger ? dangerColor : textColor),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue