Browse Source

Update slide menu

master
daivph 5 years ago
parent
commit
f619a62731
5 changed files with 108 additions and 34 deletions
  1. +0
    -1
      lib/presentation/custom_widgets/widget_media_helper.dart
  2. +17
    -0
      lib/presentation/screens/control_device/sc_control_device.dart
  3. +17
    -0
      lib/presentation/screens/notification/sc_notification.dart
  4. +71
    -31
      lib/presentation/screens/slide_menu/home_drawer.dart
  5. +3
    -2
      lib/presentation/screens/slide_menu/navigation_home_screen.dart

+ 0
- 1
lib/presentation/custom_widgets/widget_media_helper.dart View File

@@ -3,7 +3,6 @@ import 'dart:async';

import 'package:farm_tpf/presentation/custom_widgets/hoz_list_view.dart';
import 'package:farm_tpf/presentation/custom_widgets/shimmer_image.dart';
import 'package:farm_tpf/presentation/custom_widgets/widget_item_media.dart';
import 'package:farm_tpf/utils/const_color.dart';
import 'package:farm_tpf/utils/const_string.dart';
import 'package:flutter/cupertino.dart';

+ 17
- 0
lib/presentation/screens/control_device/sc_control_device.dart View File

@@ -0,0 +1,17 @@
import 'package:flutter/material.dart';

class ControlDeviceScreen extends StatefulWidget {
@override
_ControlDeviceScreenState createState() => _ControlDeviceScreenState();
}

class _ControlDeviceScreenState extends State<ControlDeviceScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Điều khiển thiết bị"),
),
);
}
}

+ 17
- 0
lib/presentation/screens/notification/sc_notification.dart View File

@@ -0,0 +1,17 @@
import 'package:flutter/material.dart';

class NotificationScreen extends StatefulWidget {
@override
_NotificationScreenState createState() => _NotificationScreenState();
}

class _NotificationScreenState extends State<NotificationScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Thông báo"),
),
);
}
}

+ 71
- 31
lib/presentation/screens/slide_menu/home_drawer.dart View File

@@ -1,4 +1,6 @@
import 'package:farm_tpf/authentication/authentication.dart';
import 'package:farm_tpf/presentation/screens/notification/sc_notification.dart';
import 'package:farm_tpf/presentation/screens/profile/sc_update_profile.dart';
import 'package:farm_tpf/utils/const_color.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -39,9 +41,9 @@ class _HomeDrawerState extends State<HomeDrawer> {
icon: Icon(Icons.home),
),
DrawerList(
index: DrawerIndex.Setting,
labelName: 'Cài đặt',
icon: Icon(Icons.settings),
index: DrawerIndex.ControlDevice,
labelName: 'Điều khiển thiết bị',
icon: Icon(Icons.device_hub),
)
];
}
@@ -132,34 +134,72 @@ class _HomeDrawerState extends State<HomeDrawer> {
height: 1,
color: COLOR_CONST.GRAY1,
),
Container(
child: Text("ss"),
width: 40,
Column(
children: <Widget>[
ListTile(
title: Text(
'Thông báo',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16,
),
textAlign: TextAlign.left,
),
leading: Icon(
Icons.notifications,
color: Colors.black,
),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => NotificationScreen()));
},
),
SizedBox(
height: 2.0,
),
ListTile(
title: Text(
'Cài đặt',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16,
),
textAlign: TextAlign.left,
),
leading: Icon(
Icons.settings,
color: Colors.black,
),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => UpdateProfileScreen()));
},
),
SizedBox(
height: 2.0,
),
ListTile(
title: Text(
'Đăng xuất',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16,
),
textAlign: TextAlign.left,
),
leading: Icon(
Icons.power_settings_new,
color: Colors.red,
),
onTap: () {
_clickSignOut();
},
),
SizedBox(
height: MediaQuery.of(context).padding.bottom,
)
],
),
// Column(
// children: <Widget>[
// ListTile(
// title: Text(
// 'Đăng xuất',
// style: TextStyle(
// fontWeight: FontWeight.w600,
// fontSize: 16,
// ),
// textAlign: TextAlign.left,
// ),
// trailing: Icon(
// Icons.power_settings_new,
// color: Colors.red,
// ),
// onTap: () {
// _clickSignOut();
// },
// ),
// SizedBox(
// height: MediaQuery.of(context).padding.bottom,
// )
// ],
// ),
],
),
);
@@ -265,7 +305,7 @@ class _HomeDrawerState extends State<HomeDrawer> {
}
}

enum DrawerIndex { ScanBarcode, Home, Setting }
enum DrawerIndex { ScanBarcode, Home, ControlDevice }

class DrawerList {
DrawerList({

+ 3
- 2
lib/presentation/screens/slide_menu/navigation_home_screen.dart View File

@@ -1,3 +1,4 @@
import 'package:farm_tpf/presentation/screens/control_device/sc_control_device.dart';
import 'package:farm_tpf/presentation/screens/home/home.dart';
import 'package:farm_tpf/presentation/screens/profile/sc_update_profile.dart';
import 'package:farm_tpf/presentation/screens/scan_barcode/sc_scan_barcode.dart';
@@ -58,9 +59,9 @@ class _NavigationHomeScreenState extends State<NavigationHomeScreen> {
setState(() {
screenView = HomePage();
});
} else if (drawerIndex == DrawerIndex.Setting) {
} else if (drawerIndex == DrawerIndex.ControlDevice) {
setState(() {
screenView = UpdateProfileScreen();
screenView = ControlDeviceScreen();
});
} else if (drawerIndex == DrawerIndex.ScanBarcode) {
setState(() {

Loading…
Cancel
Save