Browse Source

fix scan barcode in slide menu

master
daivph 5 years ago
parent
commit
c35fd349c4
2 changed files with 9 additions and 6 deletions
  1. +9
    -2
      lib/presentation/screens/slide_menu/home_drawer.dart
  2. +0
    -4
      lib/presentation/screens/slide_menu/navigation_home_screen.dart

+ 9
- 2
lib/presentation/screens/slide_menu/home_drawer.dart View File

import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get/state_manager.dart'; import 'package:get/state_manager.dart';


import '../../../main.dart';

class HomeDrawer extends StatefulWidget { class HomeDrawer extends StatefulWidget {
const HomeDrawer( const HomeDrawer(
{Key key, {Key key,
splashColor: Colors.grey.withOpacity(0.1), splashColor: Colors.grey.withOpacity(0.1),
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
onTap: () { onTap: () {
currentDrawerIndex = listData.index;
navigationtoScreen(listData.index);
if (listData.index == DrawerIndex.ScanBarcode) {
scan(context);
navigationtoScreen(currentDrawerIndex);
} else {
currentDrawerIndex = listData.index;
navigationtoScreen(currentDrawerIndex);
}
}, },
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[

+ 0
- 4
lib/presentation/screens/slide_menu/navigation_home_screen.dart View File

screenView = ControlDeviceScreen(); screenView = ControlDeviceScreen();
}); });
} else if (drawerIndex == DrawerIndex.ScanBarcode) { } else if (drawerIndex == DrawerIndex.ScanBarcode) {
setState(() {
changeIndex(DrawerIndex.Home);
scan(context);
});
} else { } else {
//do in your way...... //do in your way......
} }

Loading…
Cancel
Save