| @@ -11,7 +11,7 @@ | |||||
| <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" | ||||
| android:maxSdkVersion="28" /> | android:maxSdkVersion="28" /> | ||||
| <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | ||||
| <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/> | |||||
| <!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>--> | |||||
| <application | <application | ||||
| android:name="${applicationName}" | android:name="${applicationName}" | ||||
| @@ -25,19 +25,22 @@ class DBHelper { | |||||
| if(stock_id != ''){ | if(stock_id != ''){ | ||||
| await util.permissionCheck(context,pHandler.Permission.storage,()async{ | await util.permissionCheck(context,pHandler.Permission.storage,()async{ | ||||
| try{ | try{ | ||||
| // if(dbPath == null || dbPath == ''){ | |||||
| final database = await db; | final database = await db; | ||||
| var dbPath = database.path; | var dbPath = database.path; | ||||
| await DBHelper.database.closeDb(); | await DBHelper.database.closeDb(); | ||||
| // } | |||||
| await prefs.remove(keyClass.backup_stock_id); | await prefs.remove(keyClass.backup_stock_id); | ||||
| if(stock_id !='' && stock_id != null ) await prefs.setString(keyClass.backup_stock_id,stock_id); | if(stock_id !='' && stock_id != null ) await prefs.setString(keyClass.backup_stock_id,stock_id); | ||||
| //backupDatabase | //backupDatabase | ||||
| String backupPath = join(dbPath.substring(0,dbPath.indexOf("/Android"))+"/Download", "${prefs.getString(keyClass.backup_stock_id)}_UnitStocking.db"); | |||||
| io.Directory documentsDirectory = await getApplicationDocumentsDirectory(); | |||||
| String backupPath = join(documentsDirectory.path, "${prefs.getString(keyClass.backup_stock_id)}_UnitStocking.db"); | |||||
| // dak jadi pakek external storage karena full access dak dibolehke playstore | |||||
| // String backupPath = join(dbPath.substring(0,dbPath.indexOf("/Android"))+"/Download", "${prefs.getString(keyClass.backup_stock_id)}_UnitStocking.db"); | |||||
| io.File backupFile = new io.File(backupPath); | io.File backupFile = new io.File(backupPath); | ||||
| io.File dbFile = io.File(dbPath); | io.File dbFile = io.File(dbPath); | ||||
| if(dbFile.existsSync()){ | if(dbFile.existsSync()){ | ||||
| // dbFile.copySync(backupPath); | |||||
| Uint8List byte = dbFile.readAsBytesSync(); | Uint8List byte = dbFile.readAsBytesSync(); | ||||
| backupFile.writeAsBytesSync(byte); | backupFile.writeAsBytesSync(byte); | ||||
| result = {"STATUS":1,"MSG":"Backup Berhasil!"}; | result = {"STATUS":1,"MSG":"Backup Berhasil!"}; | ||||
| @@ -60,7 +63,7 @@ class DBHelper { | |||||
| return result; | return result; | ||||
| } | } | ||||
| initDb() async { | initDb() async { | ||||
| io.Directory documentsDirectory = await getExternalStorageDirectory(); | |||||
| io.Directory documentsDirectory = await getApplicationDocumentsDirectory(); | |||||
| String path = join(documentsDirectory.path, "UnitStocking.db"); | String path = join(documentsDirectory.path, "UnitStocking.db"); | ||||
| var theDb = await openDatabase(path, version: 1,onCreate: _onCreate); | var theDb = await openDatabase(path, version: 1,onCreate: _onCreate); | ||||
| return theDb; | return theDb; | ||||
| @@ -70,8 +73,13 @@ class DBHelper { | |||||
| var result = {"STATUS":0,"MSG":"File Backup tidak ditemukan!"}; | var result = {"STATUS":0,"MSG":"File Backup tidak ditemukan!"}; | ||||
| if(prefs.getString(keyClass.backup_stock_id)!=null){ | if(prefs.getString(keyClass.backup_stock_id)!=null){ | ||||
| await util.permissionCheck(context,pHandler.Permission.storage,()async{ | await util.permissionCheck(context,pHandler.Permission.storage,()async{ | ||||
| io.Directory documentsDirectory = await getExternalStorageDirectory(); | |||||
| String backupPath = join(documentsDirectory.path.substring(0,documentsDirectory.path.indexOf("/Android"))+"/Download", "${prefs.getString(keyClass.backup_stock_id)}_UnitStocking.db"); | |||||
| io.Directory documentsDirectory = await getApplicationDocumentsDirectory(); | |||||
| String backupPath = join(documentsDirectory.path, "${prefs.getString(keyClass.backup_stock_id)}_UnitStocking.db"); | |||||
| // dak jadi karena ribet ngurusnyo | |||||
| // String backupPath = join(documentsDirectory.path.substring(0,documentsDirectory.path.indexOf("/Android"))+"/Download", "${prefs.getString(keyClass.backup_stock_id)}_UnitStocking.db"); | |||||
| io.File backupdbFile = io.File(backupPath); | io.File backupdbFile = io.File(backupPath); | ||||
| if(backupdbFile.existsSync()){ | if(backupdbFile.existsSync()){ | ||||
| io.File dbFile = new io.File(join(documentsDirectory.path, "UnitStocking.db")); | io.File dbFile = new io.File(join(documentsDirectory.path, "UnitStocking.db")); | ||||
| @@ -98,7 +106,7 @@ class DBHelper { | |||||
| } | } | ||||
| _onCreate(Database db, int version) async { | _onCreate(Database db, int version) async { | ||||
| io.Directory documentsDirectory = await getExternalStorageDirectory(); | |||||
| io.Directory documentsDirectory = await getApplicationDocumentsDirectory(); | |||||
| String path = join(documentsDirectory.path, "UnitStocking.db"); | String path = join(documentsDirectory.path, "UnitStocking.db"); | ||||
| io.File file = io.File(path); | io.File file = io.File(path); | ||||
| print('Database created, ${file.lengthSync()}'); | print('Database created, ${file.lengthSync()}'); | ||||
| @@ -39,7 +39,6 @@ class file_Trans_Handler { | |||||
| else _error = e.message??e; | else _error = e.message??e; | ||||
| // print("mainthrow $_error"); | // print("mainthrow $_error"); | ||||
| } | } | ||||
| Request req = new Request('GET', Uri.parse(link)); | Request req = new Request('GET', Uri.parse(link)); | ||||
| // req.headers = ''; | // req.headers = ''; | ||||
| _response = await httpClient.send(req).timeout( | _response = await httpClient.send(req).timeout( | ||||
| @@ -61,6 +60,7 @@ class file_Trans_Handler { | |||||
| // this.cancel(); | // this.cancel(); | ||||
| // cancel(); //stop stream | // cancel(); //stop stream | ||||
| String resString = utf8.decode(value); | String resString = utf8.decode(value); | ||||
| print(resString); | |||||
| // if(util.htmlErrorTitle(resString)!=""){ | // if(util.htmlErrorTitle(resString)!=""){ | ||||
| // _error = util.htmlErrorTitle(resString); | // _error = util.htmlErrorTitle(resString); | ||||
| // } | // } | ||||
| @@ -73,7 +73,7 @@ class file_Trans_Handler { | |||||
| _progress.add(0.0); | _progress.add(0.0); | ||||
| print('Finish Download'); | print('Finish Download'); | ||||
| final file = File( | final file = File( | ||||
| "${(await getExternalStorageDirectory()).path}/$fileName"); | |||||
| "${(await getApplicationDocumentsDirectory()).path}/$fileName"); | |||||
| await file.writeAsBytes(_bytes); | await file.writeAsBytes(_bytes); | ||||
| _path = file.path; | _path = file.path; | ||||
| } | } | ||||
| @@ -114,7 +114,7 @@ class file_Trans_Handler { | |||||
| httpClient = await util.getOauth2Client(); | httpClient = await util.getOauth2Client(); | ||||
| oauth2.Credentials tokenRestData = oauth2.Credentials.fromJson(prefs.getString(keyClass.rest_data)); | oauth2.Credentials tokenRestData = oauth2.Credentials.fromJson(prefs.getString(keyClass.rest_data)); | ||||
| final file = File( | final file = File( | ||||
| "${(await getExternalStorageDirectory()).path}/$fileName"); | |||||
| "${(await getApplicationDocumentsDirectory()).path}/$fileName"); | |||||
| String mimeType = 'application/vnd.sqlite3'; | String mimeType = 'application/vnd.sqlite3'; | ||||
| if(file.existsSync()){ | if(file.existsSync()){ | ||||
| Uint8List byte = file.readAsBytesSync(); | Uint8List byte = file.readAsBytesSync(); | ||||
| @@ -227,11 +227,11 @@ class file_Trans_Handler { | |||||
| request.files.add( | request.files.add( | ||||
| await MultipartFile.fromPath( | await MultipartFile.fromPath( | ||||
| 'picture', | 'picture', | ||||
| "${(await getExternalStorageDirectory()).path}/$fileName" | |||||
| "${(await getApplicationDocumentsDirectory()).path}/$fileName" | |||||
| ) | ) | ||||
| ); | ); | ||||
| _response = await httpClient.send(request); | _response = await httpClient.send(request); | ||||
| _total = File("${(await getExternalStorageDirectory()).path}/$fileName").lengthSync(); | |||||
| _total = File("${(await getApplicationDocumentsDirectory()).path}/$fileName").lengthSync(); | |||||
| dlulStream = _response.stream.listen((value) { | dlulStream = _response.stream.listen((value) { | ||||
| _bytes.addAll(value); | _bytes.addAll(value); | ||||
| print('upload ${_bytes.length/_total}'); | print('upload ${_bytes.length/_total}'); | ||||
| @@ -241,7 +241,7 @@ class file_Trans_Handler { | |||||
| _progress.add(0.0); | _progress.add(0.0); | ||||
| print('Finish Download'); | print('Finish Download'); | ||||
| final file = File( | final file = File( | ||||
| "${(await getExternalStorageDirectory()).path}/$fileName"); | |||||
| "${(await getApplicationDocumentsDirectory()).path}/$fileName"); | |||||
| await file.writeAsBytes(_bytes); | await file.writeAsBytes(_bytes); | ||||
| _path = file.path; | _path = file.path; | ||||
| }) | }) | ||||
| @@ -59,7 +59,7 @@ class _HomePageState extends State<HomePage> { | |||||
| util.showLoading(context); | util.showLoading(context); | ||||
| await Future.sync(()async{ | await Future.sync(()async{ | ||||
| try{ | try{ | ||||
| Directory documentsDirectory = await getExternalStorageDirectory(); | |||||
| Directory documentsDirectory = await getApplicationDocumentsDirectory(); | |||||
| String path = join(documentsDirectory.path, "UnitStocking.db"); | String path = join(documentsDirectory.path, "UnitStocking.db"); | ||||
| File db = File(path); | File db = File(path); | ||||
| if(db.existsSync()){ | if(db.existsSync()){ | ||||
| @@ -105,7 +105,7 @@ class _HomePageState extends State<HomePage> { | |||||
| if(value != null)await prefs.setString(keyClass.stock_id, value.value); | if(value != null)await prefs.setString(keyClass.stock_id, value.value); | ||||
| } | } | ||||
| String stock_taking_id = prefs.getString(keyClass.stock_id); | String stock_taking_id = prefs.getString(keyClass.stock_id); | ||||
| if(prefs.getString(keyClass.backup_stock_id) == null) prefs.setString(keyClass.backup_stock_id,stock_taking_id); | |||||
| if(prefs.getString(keyClass.backup_stock_id) == null && stock_taking_id!= null) prefs.setString(keyClass.backup_stock_id,stock_taking_id); | |||||
| if(company!=null&&stock_taking_id!=null){ | if(company!=null&&stock_taking_id!=null){ | ||||
| var result = await util.JsonDataPostRaw({"company":company,"stockTakingId":stock_taking_id}, '${prefs.getString(keyClass.hostAddress)}/stock_taking/state/'); | var result = await util.JsonDataPostRaw({"company":company,"stockTakingId":stock_taking_id}, '${prefs.getString(keyClass.hostAddress)}/stock_taking/state/'); | ||||
| if(result['STATUS']==1){ | if(result['STATUS']==1){ | ||||
| @@ -125,12 +125,15 @@ class _HomePageState extends State<HomePage> { | |||||
| lastUpload = prefs.getString(keyClass.lastUpload)??''; | lastUpload = prefs.getString(keyClass.lastUpload)??''; | ||||
| WidgetsBinding.instance.addPostFrameCallback((_) async { | WidgetsBinding.instance.addPostFrameCallback((_) async { | ||||
| await _check_Update(); | await _check_Update(); | ||||
| final androidVersion = await DeviceInfoPlugin().androidInfo; | |||||
| if ((androidVersion.version.sdkInt ?? 0) >= 30) { | |||||
| await util.permissionCheck(this.context,pHandler.Permission.manageExternalStorage,()async{print("storage permit granted!");},customMessage: " untuk menyimpan data backup"); | |||||
| } else { | |||||
| // dak jadi pakek external karena butuh Full acces File yang ribet ngorosnyo di appstore dan playstore | |||||
| // final androidVersion = await DeviceInfoPlugin().androidInfo; | |||||
| // if ((androidVersion.version.sdkInt ?? 0) >= 30) { | |||||
| // print(1); | |||||
| // await util.permissionCheck(this.context,pHandler.Permission.manageExternalStorage,()async{print("storage permit granted!");},customMessage: " untuk menyimpan data backup ke external storage!!"); | |||||
| // } else { | |||||
| // print(3); | |||||
| await util.permissionCheck(this.context,pHandler.Permission.storage,()async{print("storage permit granted!");},customMessage: " untuk menyimpan data backup"); | await util.permissionCheck(this.context,pHandler.Permission.storage,()async{print("storage permit granted!");},customMessage: " untuk menyimpan data backup"); | ||||
| } | |||||
| // } | |||||
| }); | }); | ||||
| } | } | ||||
| @@ -263,7 +266,7 @@ class _HomePageState extends State<HomePage> { | |||||
| items: result['DATA'].map<DropdownMenuItem<dynamic>>((item){ | items: result['DATA'].map<DropdownMenuItem<dynamic>>((item){ | ||||
| return DropdownMenuItem( | return DropdownMenuItem( | ||||
| value: item['RETURN_VALUE'], | value: item['RETURN_VALUE'], | ||||
| child: Text(item["DISPLAY_VALUE"]), | |||||
| child: Container(width: MediaQuery.of(context).size.width*0.55,child: Text(item["DISPLAY_VALUE"])), | |||||
| ); | ); | ||||
| }).toList(), | }).toList(), | ||||
| ), | ), | ||||
| @@ -291,7 +294,7 @@ class _HomePageState extends State<HomePage> { | |||||
| lastDownload = ''; | lastDownload = ''; | ||||
| timeString = ''; | timeString = ''; | ||||
| try{ | try{ | ||||
| Directory documentsDirectory = await getExternalStorageDirectory(); | |||||
| Directory documentsDirectory = await getApplicationDocumentsDirectory(); | |||||
| String path = join(documentsDirectory.path, "UnitStocking.db"); | String path = join(documentsDirectory.path, "UnitStocking.db"); | ||||
| File db = File(path); | File db = File(path); | ||||
| if(db.existsSync()){ | if(db.existsSync()){ | ||||
| @@ -319,73 +322,6 @@ class _HomePageState extends State<HomePage> { | |||||
| ), | ), | ||||
| ), | ), | ||||
| ), | ), | ||||
| // AlertDialog( | |||||
| // title: Text('Set Cabang'), | |||||
| // content: DropdownButtonFormField( | |||||
| // value: selected, | |||||
| // onChanged: (value){ | |||||
| // setState(() { | |||||
| // selected = value; | |||||
| // }); | |||||
| // }, | |||||
| // items: result['DATA'].map<DropdownMenuItem<dynamic>>((item){ | |||||
| // return DropdownMenuItem( | |||||
| // value: item['RETURN_VALUE'], | |||||
| // child: Text(item["DISPLAY_VALUE"]), | |||||
| // ); | |||||
| // }).toList(), | |||||
| // ), | |||||
| // actions: <Widget>[ | |||||
| // TextButton( | |||||
| // child: Text('OK'), | |||||
| // onPressed: ()async{ | |||||
| // if(selected!=prefs.getString(keyClass.cabang_id)){ | |||||
| // prefs.setString(keyClass.cabang_id,selected); | |||||
| // await Future.sync(()async{ | |||||
| // await prefs.remove(keyClass.lastDownload); | |||||
| // await prefs.remove(keyClass.lastUpload); | |||||
| // await prefs.remove(keyClass.targetProccess); | |||||
| // await prefs.remove(keyClass.submitProccess); | |||||
| // lastUpload = ''; | |||||
| // lastDownload = ''; | |||||
| // timeString = ''; | |||||
| //// var result = await DBHelper.database.deleteAll(); | |||||
| //// if(result!=null) { | |||||
| //// await DBHelper.database.closeDb(); | |||||
| //// if(result!=null){ | |||||
| // try{ | |||||
| // Directory documentsDirectory = await getExternalStorageDirectory(); | |||||
| // String path = join(documentsDirectory.path, "UnitStocking.db"); | |||||
| // File db = File(path); | |||||
| // if(db.existsSync()){ | |||||
| // db.deleteSync(); | |||||
| // } | |||||
| // } | |||||
| // catch(e){ | |||||
| // print(e); | |||||
| // util.showFlushbar(context, 'Failed to delete database file',color: Colors.red); | |||||
| // } | |||||
| //// } | |||||
| //// else{ | |||||
| //// errMsg = 'Failed to clear unit data'; | |||||
| //// } | |||||
| //// } | |||||
| //// else{ | |||||
| //// errMsg = 'Failed to clear unit data'; | |||||
| //// } | |||||
| // }); | |||||
| // Navigator.pop(context,true); | |||||
| // } | |||||
| // else{ | |||||
| // Navigator.pop(context,false); | |||||
| // } | |||||
| //// util.showLoading(context); | |||||
| // | |||||
| //// Navigator.pop(context); | |||||
| // }, | |||||
| // ) | |||||
| // ], | |||||
| // ), | |||||
| )); | )); | ||||
| } | } | ||||
| else{ | else{ | ||||
| @@ -741,7 +677,7 @@ class _HomePageState extends State<HomePage> { | |||||
| if(isRestore??false){ | if(isRestore??false){ | ||||
| var response; | var response; | ||||
| bool isclear; | bool isclear; | ||||
| Directory documentsDirectory = await getExternalStorageDirectory(); | |||||
| Directory documentsDirectory = await getApplicationDocumentsDirectory(); | |||||
| String path = join(documentsDirectory.path, "UnitStocking.db"); | String path = join(documentsDirectory.path, "UnitStocking.db"); | ||||
| File db = File(path); | File db = File(path); | ||||
| if(db.existsSync()){ | if(db.existsSync()){ | ||||
| @@ -859,7 +795,7 @@ class _HomePageState extends State<HomePage> { | |||||
| a.start(); | a.start(); | ||||
| await Future.delayed(Duration(milliseconds: 200)); | await Future.delayed(Duration(milliseconds: 200)); | ||||
| bool isclear; | bool isclear; | ||||
| Directory documentsDirectory = await getExternalStorageDirectory(); | |||||
| Directory documentsDirectory = await getApplicationDocumentsDirectory(); | |||||
| String path = join(documentsDirectory.path, "UnitStocking.db"); | String path = join(documentsDirectory.path, "UnitStocking.db"); | ||||
| File db = File(path); | File db = File(path); | ||||
| if(db.existsSync()){ | if(db.existsSync()){ | ||||
| @@ -101,6 +101,7 @@ class _LoginPageState extends State<LoginPage> { | |||||
| return false; | return false; | ||||
| }, | }, | ||||
| child: Container( | child: Container( | ||||
| padding: EdgeInsets.only(bottom: MediaQuery.of(context).size.width*0.1), | |||||
| decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
| color: Colors.white | color: Colors.white | ||||
| ), | ), | ||||
| @@ -200,19 +201,8 @@ class _LoginPageState extends State<LoginPage> { | |||||
| ), | ), | ||||
| ), | ), | ||||
| ), | ), | ||||
| SizedBox(height: 30,), | |||||
| TextButton( | |||||
| onPressed: Login, | |||||
| style: TextButton.styleFrom( | |||||
| backgroundColor: Colors.indigo, | |||||
| padding: EdgeInsets.all(15), | |||||
| shape: RoundedRectangleBorder( | |||||
| borderRadius: BorderRadius.circular(100.0), | |||||
| side: BorderSide(color: Colors.indigo) | |||||
| ), | |||||
| ), | |||||
| child: Container(width: MediaQuery.of(context).size.width*0.7,child: Text('Login',textAlign: TextAlign.center,style: TextStyle(color: Colors.white,fontSize: 21),)), | |||||
| ) | |||||
| // SizedBox(height: 30,), | |||||
| ], | ], | ||||
| ), | ), | ||||
| ), | ), | ||||
| @@ -291,7 +281,7 @@ class _LoginPageState extends State<LoginPage> { | |||||
| }, | }, | ||||
| items: cabangDrop.map<DropdownMenuItem<dynamic>>((item)=>DropdownMenuItem( | items: cabangDrop.map<DropdownMenuItem<dynamic>>((item)=>DropdownMenuItem( | ||||
| value: item['RETURN_VALUE'], | value: item['RETURN_VALUE'], | ||||
| child: Text(item["DISPLAY_VALUE"]), | |||||
| child: Container(width: MediaQuery.of(context).size.width*0.55,child: Text(item["DISPLAY_VALUE"])), | |||||
| )).toList(), | )).toList(), | ||||
| ), | ), | ||||
| ), | ), | ||||
| @@ -338,121 +328,22 @@ class _LoginPageState extends State<LoginPage> { | |||||
| ), | ), | ||||
| ), | ), | ||||
| ), | ), | ||||
| bottomSheet: | |||||
| Padding( | |||||
| padding: EdgeInsets.only(bottom: MediaQuery.of(context).size.width*0.06,left: MediaQuery.of(context).size.width*0.1,right: MediaQuery.of(context).size.width*0.1), | |||||
| child: TextButton( | |||||
| onPressed: Login, | |||||
| style: TextButton.styleFrom( | |||||
| backgroundColor: Colors.indigo, | |||||
| padding: EdgeInsets.all(15), | |||||
| shape: RoundedRectangleBorder( | |||||
| borderRadius: BorderRadius.circular(100.0), | |||||
| side: BorderSide(color: Colors.indigo) | |||||
| ), | |||||
| ), | |||||
| child: Container(width: MediaQuery.of(context).size.width,child: Text('Login',textAlign: TextAlign.center,style: TextStyle(color: Colors.white,fontSize: 21),)), | |||||
| ), | |||||
| ), | |||||
| ); | ); | ||||
| // } | |||||
| // else{ | |||||
| // return WillPopScope( | |||||
| // onWillPop: ()async{ | |||||
| // setState(() { | |||||
| // prefs.setBool(keyClass.logged_in, false); | |||||
| // prefs.remove(keyClass.cabang_id); | |||||
| // prefs.remove(keyClass.company); | |||||
| // prefs.remove(keyClass.loginId); | |||||
| // }); | |||||
| // return false; | |||||
| // }, | |||||
| // child: Material( | |||||
| // child: Container( | |||||
| // color: Colors.grey.withOpacity(0.7), | |||||
| // child: Center( | |||||
| // child: Container( | |||||
| // decoration: BoxDecoration( | |||||
| // color: Colors.white, | |||||
| // borderRadius: BorderRadius.circular(5) | |||||
| // ), | |||||
| // height: MediaQuery.of(context).size.height/3.2, | |||||
| // width: MediaQuery.of(context).size.width*0.75, | |||||
| // child: Column( | |||||
| // children: <Widget>[ | |||||
| // Flexible( | |||||
| // flex:3, | |||||
| // child: Container( | |||||
| // padding: EdgeInsets.only(top:10,left: 10,right: 10), | |||||
| // alignment: Alignment.center, | |||||
| // decoration: BoxDecoration( | |||||
| //// color: Colors.indigo, | |||||
| // borderRadius: BorderRadius.only(topLeft: Radius.circular(5),topRight: Radius.circular(5)) | |||||
| // ), | |||||
| // child: Column( | |||||
| // mainAxisSize: MainAxisSize.min, | |||||
| // crossAxisAlignment: CrossAxisAlignment.center, | |||||
| // children: <Widget>[ | |||||
| // Icon(Icons.business,size: 70,color: Colors.indigo,), | |||||
| // SizedBox(height: 5,), | |||||
| // Text('Pilih Cabang',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16,color: Colors.indigo),) | |||||
| // ], | |||||
| // ), | |||||
| // ), | |||||
| // ), | |||||
| // Flexible( | |||||
| // flex: 1, | |||||
| // child: Container( | |||||
| // padding: EdgeInsets.only(left: 20,right: 20), | |||||
| // alignment: Alignment.centerLeft, | |||||
| // child: Theme( | |||||
| // data: ThemeData( | |||||
| // canvasColor: Colors.white, | |||||
| // primaryColor: Colors.indigo, | |||||
| // accentColor: Colors.indigo, | |||||
| // hintColor: Colors.indigo | |||||
| // ), | |||||
| // child: DropdownButtonFormField( | |||||
| // style: TextStyle(color: Colors.black.withOpacity(0.6),fontWeight: FontWeight.w500,fontSize: 14,), | |||||
| // decoration: InputDecoration( | |||||
| // contentPadding: EdgeInsets.all(8.0), | |||||
| // ), | |||||
| // value: selected, | |||||
| // onChanged: (value){ | |||||
| // setState(() { | |||||
| // selected = value; | |||||
| // }); | |||||
| // }, | |||||
| // items: cabangDrop.map<DropdownMenuItem<dynamic>>((item)=>DropdownMenuItem( | |||||
| // value: item['RETURN_VALUE'], | |||||
| // child: Text(item["DISPLAY_VALUE"]), | |||||
| // )).toList(), | |||||
| // ), | |||||
| // ), | |||||
| // ), | |||||
| // ), | |||||
| // Flexible( | |||||
| // flex: 1, | |||||
| // child: Container( | |||||
| // child: Row( | |||||
| // mainAxisAlignment: MainAxisAlignment.end, | |||||
| // children: <Widget>[ | |||||
| // ButtonTheme( | |||||
| // minWidth: 10, | |||||
| // child: TextButton( | |||||
| // onPressed: (){ | |||||
| // prefs.setString(keyClass.cabang_id, selected); | |||||
| // Navigator.pushNamed(context, '/home'); | |||||
| // }, | |||||
| // child: Text('Set',style: TextStyle(color: Colors.indigo),), | |||||
| // ), | |||||
| // ), | |||||
| // TextButton( | |||||
| // onPressed: (){ | |||||
| // setState(() { | |||||
| // prefs.setBool(keyClass.logged_in, false); | |||||
| // prefs.remove(keyClass.cabang_id); | |||||
| // prefs.remove(keyClass.company); | |||||
| // prefs.remove(keyClass.loginId); | |||||
| // }); | |||||
| // }, | |||||
| // child: Text('Cancel',style: TextStyle(color: Colors.indigo)), | |||||
| // ) | |||||
| // ], | |||||
| // ), | |||||
| // ), | |||||
| // ) | |||||
| // ], | |||||
| // ), | |||||
| // ), | |||||
| // ), | |||||
| // ), | |||||
| // ), | |||||
| // ); | |||||
| // } | |||||
| } | } | ||||
| } | } | ||||
| @@ -21,7 +21,7 @@ packages: | |||||
| name: async | name: async | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "2.8.2" | |||||
| version: "2.9.0" | |||||
| barcode_scan2: | barcode_scan2: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| @@ -42,7 +42,7 @@ packages: | |||||
| name: characters | name: characters | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.2.0" | |||||
| version: "1.2.1" | |||||
| charcode: | charcode: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| @@ -56,7 +56,7 @@ packages: | |||||
| name: clock | name: clock | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.1.0" | |||||
| version: "1.1.1" | |||||
| collection: | collection: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| @@ -133,7 +133,7 @@ packages: | |||||
| name: fake_async | name: fake_async | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.3.0" | |||||
| version: "1.3.1" | |||||
| ffi: | ffi: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| @@ -281,21 +281,21 @@ packages: | |||||
| name: matcher | name: matcher | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.12.11" | |||||
| version: "0.12.12" | |||||
| material_color_utilities: | material_color_utilities: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: material_color_utilities | name: material_color_utilities | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.1.4" | |||||
| version: "0.1.5" | |||||
| meta: | meta: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: meta | name: meta | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.7.0" | |||||
| version: "1.8.0" | |||||
| oauth2: | oauth2: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| @@ -316,7 +316,7 @@ packages: | |||||
| name: path | name: path | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.8.1" | |||||
| version: "1.8.2" | |||||
| path_provider: | path_provider: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| @@ -510,7 +510,7 @@ packages: | |||||
| name: source_span | name: source_span | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.8.2" | |||||
| version: "1.9.0" | |||||
| sqflite: | sqflite: | ||||
| dependency: "direct main" | dependency: "direct main" | ||||
| description: | description: | ||||
| @@ -545,7 +545,7 @@ packages: | |||||
| name: string_scanner | name: string_scanner | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.1.0" | |||||
| version: "1.1.1" | |||||
| synchronized: | synchronized: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| @@ -559,14 +559,14 @@ packages: | |||||
| name: term_glyph | name: term_glyph | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "1.2.0" | |||||
| version: "1.2.1" | |||||
| test_api: | test_api: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||
| name: test_api | name: test_api | ||||
| url: "https://pub.dartlang.org" | url: "https://pub.dartlang.org" | ||||
| source: hosted | source: hosted | ||||
| version: "0.4.9" | |||||
| version: "0.4.12" | |||||
| typed_data: | typed_data: | ||||
| dependency: transitive | dependency: transitive | ||||
| description: | description: | ||||