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



import 'package:farm_tpf/presentation/custom_widgets/hoz_list_view.dart'; 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/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_color.dart';
import 'package:farm_tpf/utils/const_string.dart'; import 'package:farm_tpf/utils/const_string.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';

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

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

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

import 'package:farm_tpf/authentication/authentication.dart'; 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:farm_tpf/utils/const_color.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
icon: Icon(Icons.home), icon: Icon(Icons.home),
), ),
DrawerList( 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),
) )
]; ];
} }
height: 1, height: 1,
color: COLOR_CONST.GRAY1, 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,
// )
// ],
// ),
], ],
), ),
); );
} }
} }


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


class DrawerList { class DrawerList {
DrawerList({ DrawerList({

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

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/home/home.dart';
import 'package:farm_tpf/presentation/screens/profile/sc_update_profile.dart'; import 'package:farm_tpf/presentation/screens/profile/sc_update_profile.dart';
import 'package:farm_tpf/presentation/screens/scan_barcode/sc_scan_barcode.dart'; import 'package:farm_tpf/presentation/screens/scan_barcode/sc_scan_barcode.dart';
setState(() { setState(() {
screenView = HomePage(); screenView = HomePage();
}); });
} else if (drawerIndex == DrawerIndex.Setting) {
} else if (drawerIndex == DrawerIndex.ControlDevice) {
setState(() { setState(() {
screenView = UpdateProfileScreen();
screenView = ControlDeviceScreen();
}); });
} else if (drawerIndex == DrawerIndex.ScanBarcode) { } else if (drawerIndex == DrawerIndex.ScanBarcode) {
setState(() { setState(() {

Loading…
Cancel
Save