Flutter app for Asset Management
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

679 linhas
34 KiB

  1. import 'dart:async';
  2. import 'dart:convert';
  3. import 'dart:io';
  4. import 'package:assetstock/util/download_Upload_Handler.dart';
  5. import 'package:path/path.dart';
  6. import 'package:flutter/cupertino.dart';
  7. import 'package:flutter/material.dart';
  8. import 'package:path_provider/path_provider.dart';
  9. import 'main.dart';
  10. import 'util/prefsKey.dart';
  11. import 'util/dbHandler.dart';
  12. import 'package:permission_handler/permission_handler.dart' as pHandler;
  13. class Home extends StatefulWidget {
  14. Home({Key key}) : super(key: key);
  15. @override
  16. _HomeState createState() => _HomeState();
  17. }
  18. class _HomeState extends State<Home> {
  19. List<Widget> Menus = [];
  20. final hostAddress = new TextEditingController();
  21. StreamSubscription _dlulStream;
  22. double progress,progressDL;
  23. loadMenu()async{
  24. Menus.add(Padding(
  25. padding: const EdgeInsets.all(8.0),
  26. child: Container(
  27. decoration: BoxDecoration(
  28. color: Colors.white,
  29. borderRadius: BorderRadius.circular(5)
  30. ),
  31. child: Text('Get Data'),
  32. ),
  33. ));
  34. setState(() {
  35. });
  36. }
  37. @override
  38. void initState() {
  39. // TODO: implement initState
  40. super.initState();
  41. WidgetsBinding.instance.addPostFrameCallback((_) async {
  42. // await loadMenu();
  43. await util.permissionCheck(context,pHandler.Permission.storage,()async{print("storage permit granted!");},customMessage: " untuk menyimpan data backup");
  44. });
  45. }
  46. clearData(context)async{
  47. String errMsg;
  48. Directory documentsDirectory = await getExternalStorageDirectory();
  49. String path = join(documentsDirectory.path, "assets.db");
  50. File db = File(path);
  51. if(db.existsSync()){
  52. bool result = await showDialog(context: context,builder: (context)=>WillPopScope(
  53. onWillPop: ()async{
  54. Navigator.pop(context,false);
  55. return false;
  56. },
  57. child: AlertDialog(
  58. title: Text('Clear Data ?'),
  59. content: Text('Proceed to clear any remaining units data on this device?'),
  60. actions: <Widget>[
  61. FlatButton(
  62. child: Text('Proceed'),
  63. onPressed: ()async{
  64. util.showLoading(context);
  65. await Future.sync(()async{
  66. await prefs.remove(keyClass.dbName);
  67. // await prefs.setString(keyClass.lastDownload, null);
  68. // await prefs.setString(keyClass.lastUpload, null);
  69. // await prefs.setString(keyClass.targetProccess, null);
  70. setState(() {
  71. // lastUpload = '';
  72. // lastDownload = '';
  73. // timeString = '';
  74. });
  75. // var result = await DBHelper.database.deleteAll();
  76. // if(result!=null) {
  77. // if(result!=null){
  78. try{
  79. await DBHelper.database.closeDb();
  80. db.deleteSync();
  81. }
  82. catch(e){
  83. print(e);
  84. util.showToast('ERROR','Failed to delete database file');
  85. }
  86. // }
  87. // else{
  88. // errMsg = 'Failed to clear unit data';
  89. // }
  90. // }
  91. // else{
  92. // errMsg = 'Failed to clear unit data';
  93. // }
  94. });
  95. Navigator.pop(context);
  96. Navigator.pop(context,true);
  97. util.showToast(errMsg==null?"SUCCESS":"ERROR",errMsg??'Data Cleared');
  98. },
  99. ),
  100. FlatButton(
  101. child: Text('Cancel'),
  102. onPressed: (){Navigator.pop(context,false);},
  103. )
  104. ],
  105. ),
  106. ));
  107. return result;
  108. }
  109. else return true;
  110. }
  111. @override
  112. Widget build(BuildContext context) {
  113. return Scaffold(
  114. floatingActionButton: Padding(
  115. padding: const EdgeInsets.only(bottom:45.0),
  116. child: FloatingActionButton(
  117. onPressed: ()async{
  118. Directory documentsDirectory = await getExternalStorageDirectory();
  119. String path = join(documentsDirectory.path, "assets.db");
  120. File db = File(path);
  121. if(db.existsSync()){
  122. Navigator.pushNamed(context, '/logs');
  123. }
  124. else{
  125. util.showToast("ALERT", 'Get data Master first');
  126. }
  127. },
  128. child: Icon(Icons.description,size: 30,),
  129. ),
  130. ),
  131. body: Container(
  132. color: Colors.grey.withOpacity(0.3),
  133. child:
  134. // (Menus.length==0)?Container(alignment: Alignment.center,
  135. // child: Text('Empty',
  136. // style: TextStyle(fontSize: 20,color: Colors.black38,fontWeight: FontWeight.bold),),)
  137. // :
  138. Column(
  139. children: <Widget>[
  140. Expanded(
  141. flex: 1,
  142. child: Container(
  143. padding: const EdgeInsets.only(left: 10,top:10,right: 5),
  144. alignment: Alignment.bottomCenter,
  145. child: Row(
  146. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  147. children: <Widget>[
  148. Row(
  149. children: <Widget>[
  150. Icon(Icons.dashboard,color: Colors.blueGrey,size: 20,),
  151. SizedBox(width: 5,),
  152. Text('Menu')
  153. ],
  154. ),
  155. PopupMenuButton(
  156. itemBuilder: (context)=>[
  157. PopupMenuItem(
  158. value: "changeAddress",
  159. child: Row(
  160. children: <Widget>[
  161. Icon(Icons.network_wifi,color: Colors.blueGrey,),
  162. SizedBox(width: 10,),
  163. Text('Change Host Address',style: TextStyle(color: Colors.blueGrey,fontWeight: FontWeight.w500),)
  164. ],
  165. ),
  166. ),
  167. PopupMenuItem(
  168. value:'backup',
  169. child: Row(
  170. children: <Widget>[
  171. Icon(Icons.save,color: Colors.black,),
  172. SizedBox(width: 10,),
  173. Text('Backup Data')
  174. ],
  175. ),
  176. ),
  177. PopupMenuItem(
  178. value:'restore',
  179. child: Row(
  180. children: <Widget>[
  181. Icon(Icons.sync,color: Colors.black,),
  182. SizedBox(width: 10,),
  183. Text('Restore Data')
  184. ],
  185. ),
  186. ),
  187. ],
  188. onSelected: (value)async{
  189. if(value == "changeAddress"){
  190. hostAddress.text = prefs.getString(keyClass.hostAddress)??'https://asset.thamringroup.web.id';
  191. await showDialog(context: context,builder: (context)=>AlertDialog(
  192. title: Text('Set IP Address'),
  193. content: TextField(
  194. controller: hostAddress,
  195. onSubmitted: (value){
  196. prefs.setString(keyClass.hostAddress,(value=='')?'https://asset.thamringroup.web.id':value);
  197. Navigator.pop(context);
  198. },
  199. ),
  200. actions: <Widget>[
  201. FlatButton(
  202. child: Text('OK'),
  203. onPressed: (){
  204. prefs.setString(keyClass.hostAddress,(hostAddress.text=='')?'https://asset.thamringroup.web.id':hostAddress.text);
  205. Navigator.pop(context);
  206. },
  207. )
  208. ],
  209. ));
  210. setState(() {
  211. });
  212. }
  213. if(value == 'backup'){
  214. if(prefs.getString(keyClass.dbName) != null){
  215. bool isBackup = await showDialog(context: context,builder: (context)=>AlertDialog(
  216. title: Text('Backup Data ?'),
  217. content: Text('Backup data akan menghapus dan mengganti data backup unit dan cabang sebelumnya.'),
  218. actions: <Widget>[
  219. TextButton(
  220. child: Text('OK'),
  221. onPressed: ()async{
  222. Navigator.pop(context,true);
  223. },
  224. ),
  225. TextButton(
  226. child: Text('Cancel'),
  227. onPressed: ()=>Navigator.pop(context,false),
  228. )
  229. ],
  230. ));
  231. if(isBackup??false){
  232. var result = await DBHelper.database.backupDb(context);
  233. util.showToast(result["STATUS"]==1?'NORMAL':'ERROR', result['MSG']);
  234. }
  235. }
  236. else{
  237. util.showToast('ERROR', "Data Unit cabang tidak ditemukan. Silakan get data terlbih dahulu.");
  238. }
  239. }
  240. if(value == 'restore'){
  241. if(prefs.getString(keyClass.dbName) == null){
  242. util.showToast('ERROR', "Data Unit cabang tidak ditemukan. Silakan get data terlbih dahulu.");
  243. }
  244. else{
  245. if(prefs.getString(keyClass.dbName) == prefs.getString(keyClass.backup_stock_id)){
  246. String stock_taking_id = prefs.getString(keyClass.dbName);
  247. if(stock_taking_id!=null){
  248. bool isRestore = await showDialog(context: context,builder: (context)=>AlertDialog(
  249. title: Text('Restore Data ?'),
  250. content: Text('Restore data akan menghapus dan mengganti data unit dan cabang yang ada dengan data backup.'),
  251. actions: <Widget>[
  252. TextButton(
  253. child: Text('OK'),
  254. onPressed: ()async{
  255. Navigator.pop(context,true);
  256. },
  257. ),
  258. TextButton(
  259. child: Text('Cancel'),
  260. onPressed: ()=>Navigator.pop(context,false),
  261. )
  262. ],
  263. ));
  264. if(isRestore??false){
  265. var response;
  266. bool isclear;
  267. Directory documentsDirectory = await getExternalStorageDirectory();
  268. String path = join(documentsDirectory.path, "assets.db");
  269. File db = File(path);
  270. if(db.existsSync()){
  271. isclear = await clearData(context);
  272. }
  273. else{
  274. isclear = true;
  275. }
  276. if(isclear??false){
  277. var result = await DBHelper.database.restoreDb(context);
  278. if(result["STATUS"]==1){
  279. // await prefs.remove(keyClass.lastDownload);
  280. // await prefs.remove(keyClass.lastUpload);
  281. // await prefs.remove(keyClass.targetProccess);
  282. // await prefs.remove(keyClass.submitProccess);
  283. setState(() {
  284. // lastUpload = '';
  285. // lastDownload = '';
  286. // timeString = '';
  287. });
  288. // valueTab value = await DBHelper.database.getValue(keyClass.tgl_start);
  289. // if(value != null)await prefs.setString(keyClass.lastDownload, DateFormat('dd-MM-yyyy HH:mm:ss').parse(value.value).toIso8601String());
  290. // else {
  291. // await prefs.setString(keyClass.lastDownload, DateTime.now().toIso8601String());
  292. // }
  293. // value = await DBHelper.database.getValue(keyClass.stock_id);
  294. // if(value != null) await prefs.setString(keyClass.stock_id,value.value);
  295. // else {
  296. await prefs.setString(keyClass.dbName,prefs.getString(keyClass.backup_stock_id));
  297. // }
  298. // loadState();
  299. setState(() {
  300. // lastDownload = prefs.getString(keyClass.lastDownload);
  301. });
  302. }
  303. response = result["MSG"];
  304. }
  305. if(response != null)util.showToast('GENERAL', response);
  306. }
  307. }
  308. }
  309. else {
  310. util.showToast("ERROR", "File Backup tidak ditemukan atau sudah selesai");
  311. }
  312. }
  313. }
  314. },
  315. child: Padding(
  316. padding: const EdgeInsets.all(8.0),
  317. child: Icon(Icons.clear_all,color: Colors.blueGrey,size: 20,),
  318. ),
  319. ),
  320. ],
  321. ),
  322. ),
  323. ),
  324. Flexible(
  325. flex: 10,
  326. child: Container(
  327. alignment: Alignment.topCenter,
  328. child: GridView.count(
  329. padding: EdgeInsets.all(0),
  330. crossAxisCount: 2,
  331. children: [
  332. InkWell(
  333. onTap: ()async{
  334. String Address = prefs.getString(keyClass.hostAddress);
  335. // await Future.delayed(Duration(milliseconds: 300));
  336. util.showLoading(context,dissmissable: false);
  337. var bUnits = await util.JsonDataPostRaw({}, "${Address??"https://asset.thamringroup.web.id"}/admin/getBisnisList",timeout: true,duration: 5);
  338. Navigator.pop(context);
  339. if(bUnits["STATUS"]==1){
  340. var selectedBisnis= bUnits["DATA"][0]["id"];
  341. var bisnisPicked = await showDialog(context: context,builder: (context)=>StatefulBuilder(
  342. builder: (context,setState)=>AlertDialog(
  343. title: Text('Pick Bisnis Unit'),
  344. content: DropdownButtonFormField(
  345. onChanged: (value)async{
  346. setState(() {
  347. selectedBisnis = value;
  348. });
  349. },
  350. value: selectedBisnis,
  351. items: new List<DropdownMenuItem<dynamic>>.from(bUnits['DATA'].map((value){
  352. String showText = value["name"];
  353. if(showText.length>30) showText = showText.substring(0,30);
  354. return DropdownMenuItem(
  355. child: Text(showText),
  356. value: value["id"],
  357. );
  358. })),
  359. ),
  360. actions: <Widget>[
  361. FlatButton(
  362. onPressed: ()async{
  363. Navigator.pop(context,true);
  364. },
  365. child: Text('Next'),
  366. ),
  367. FlatButton(
  368. onPressed: ()async{
  369. Navigator.pop(context,false);
  370. },
  371. child: Text('Cancel'),
  372. )
  373. ],
  374. ),
  375. ));
  376. if(bisnisPicked??false){
  377. util.showLoading(context,dissmissable: false);
  378. var result = await util.JsonDataPostRaw({"bUnit":selectedBisnis}, "${Address??"https://asset.thamringroup.web.id"}/admin/getrefDbList");
  379. Navigator.pop(context);
  380. if(result['STATUS']==1){
  381. bool isClear = await clearData(context);
  382. if(isClear??false){
  383. String selected = result['DATA'][0]["fullName"];
  384. bool res =await showDialog(context: context,builder: (context)=>StatefulBuilder(
  385. builder: (context,setState)=>AlertDialog(
  386. title: Text('Pick Database'),
  387. content: DropdownButtonFormField(
  388. onChanged: (value){
  389. setState(() {
  390. selected = value;
  391. });
  392. },
  393. value: selected,
  394. items: new List<DropdownMenuItem<dynamic>>.from(result['DATA'].map((value){
  395. String showText = value["name"];
  396. if(showText.length>20) showText = showText.substring(0,20);
  397. return DropdownMenuItem(
  398. child: Text(showText),
  399. value: value["fullName"],
  400. );
  401. })),
  402. ),
  403. actions: <Widget>[
  404. FlatButton(
  405. onPressed: ()async{
  406. Navigator.pop(context,true);
  407. },
  408. child: Text('Get'),
  409. ),
  410. FlatButton(
  411. onPressed: ()async{
  412. Navigator.pop(context,false);
  413. },
  414. child: Text('Cancel'),
  415. )
  416. ],
  417. ),
  418. ));
  419. if(res??false){
  420. // util.showLoading(context,dissmissable: false);
  421. await prefs.setString(keyClass.dbName,selected);
  422. file_Trans_Handler trans = new file_Trans_Handler();
  423. await trans.downloadFile("assets.db", "${Address??"https://asset.thamringroup.web.id"}/admin/downloadDb/$selectedBisnis/$selected");
  424. _dlulStream = trans.progress.listen((value)async {
  425. setState(() {
  426. progressDL = (value!=-1.0)?value:null;
  427. });
  428. if(value!=null&&value >= 1.0) {
  429. _dlulStream.cancel();
  430. progressDL = null;
  431. // setState(() {
  432. // lastDownload = DateTime.now().toIso8601String();
  433. // });
  434. // await prefs.setString(keyClass.lastDownload, lastDownload);
  435. // await DBHelper.database.insertUpdateValue(new valueTab(name: 'TGL_START',value: DateFormat('dd-MM-yyyy HH:mm:ss').format(DateTime.parse(lastDownload))));
  436. // await DBHelper.database.insertUpdateValue(new valueTab(name: 'TGL_STOCK_TAKING',value: DateFormat('dd-MM-yyyy').format(DateTime.parse(lastDownload))));
  437. // await DBHelper.database.closeDb();
  438. // var allUnits = await DBHelper.database.getAllAsset();
  439. // print('${allUnits.length} Units');
  440. if(prefs.getString(keyClass.backup_stock_id) == null) prefs.setString(keyClass.backup_stock_id,selected);
  441. util.showToast('ALERT','Data Downloaded');
  442. }
  443. if(value==-1.0){
  444. util.showToast('ALERT','Data Error ${trans.error}');
  445. }
  446. });
  447. // Navigator.pop(context);
  448. setState(() {
  449. });
  450. }
  451. }
  452. }
  453. else{
  454. await util.showToast("ERROR",result['ERROR']??"Database tidak ditemukan");
  455. }
  456. }
  457. }
  458. else{
  459. await util.showToast("ERROR",bUnits['DATA']??'not responding');
  460. }
  461. },
  462. child: Padding(
  463. padding: const EdgeInsets.only(left: 10,top:10,right: 5),
  464. child: Container(
  465. decoration: BoxDecoration(
  466. color: Colors.white,
  467. borderRadius: BorderRadius.circular(10)
  468. ),
  469. child: Column(
  470. mainAxisAlignment: MainAxisAlignment.center,
  471. children: <Widget>[
  472. Expanded(
  473. flex: 4,
  474. child: Container(alignment: Alignment.center,child: (progressDL==null)?Icon(Icons.add_to_home_screen,size: 100,color: Colors.blueGrey,):Stack(
  475. children: <Widget>[
  476. Container(width: 100,height: 100,child: CircularProgressIndicator(backgroundColor: Color(0xFFB4B4B4),valueColor:new AlwaysStoppedAnimation<Color>(Colors.blueGrey),value: progressDL,)),
  477. Container(width: 100,height: 100,alignment: Alignment.center,child: Text("${(progressDL*100).floor().toString()}%",style: TextStyle(color: Colors.blueGrey,fontWeight: FontWeight.bold,fontSize: 25),),)
  478. ],
  479. )),
  480. ),
  481. Flexible(
  482. flex: 2,
  483. child: Text('Get Data Master',style: TextStyle(color: Colors.blueGrey,fontSize: 18,fontWeight: FontWeight.bold),),
  484. ),
  485. ],
  486. ),
  487. ),
  488. ),
  489. ),
  490. Padding(
  491. padding: const EdgeInsets.only(left: 5,top:10,right: 10),
  492. child: Material(
  493. color: Colors.white,
  494. child: InkWell(
  495. onTap: ()async{
  496. await Future.delayed(Duration(milliseconds: 300));
  497. Directory documentsDirectory = await getExternalStorageDirectory();
  498. String path = join(documentsDirectory.path, "assets.db");
  499. File db = File(path);
  500. if(db.existsSync()) Navigator.pushNamed(context, '/stocking');
  501. else{
  502. util.showToast('Alert', 'Please download data master first');
  503. }
  504. },
  505. child: Container(
  506. decoration: BoxDecoration(
  507. borderRadius: BorderRadius.circular(10)
  508. ),
  509. child: Column(
  510. mainAxisAlignment: MainAxisAlignment.center,
  511. children: <Widget>[
  512. Expanded(
  513. flex: 4,
  514. child: Container(alignment: Alignment.center,child: Icon(Icons.aspect_ratio,size: 100,color: Colors.blueGrey,)),
  515. ),
  516. Flexible(
  517. flex: 2,
  518. child: Text('Start Stocking',style: TextStyle(color: Colors.blueGrey,fontSize: 18,fontWeight: FontWeight.bold),),
  519. ),
  520. ],
  521. ),
  522. ),
  523. ),
  524. ),
  525. ),
  526. InkWell(
  527. onTap: ()async{
  528. final file = File(
  529. "${(await getExternalStorageDirectory()).path}/assets.db");
  530. if(file.existsSync()){
  531. TextEditingController sendingUser = new TextEditingController();
  532. sendingUser.text = prefs.getString(keyClass.user)??'';
  533. bool isUserDefined = await showDialog(context: context,
  534. barrierDismissible: false,
  535. builder: (context)=>AlertDialog(
  536. title: Text('Sender'),
  537. content: TextField(
  538. controller: sendingUser,
  539. ),
  540. actions: [
  541. FlatButton(
  542. child: Text('Send'),
  543. onPressed: ()async{
  544. if(sendingUser.text!='') Navigator.pop(context,true);
  545. else Navigator.pop(context,false);
  546. },
  547. )
  548. ],
  549. ));
  550. if(isUserDefined??false){
  551. prefs.setString(keyClass.user, sendingUser.text);
  552. util.showToast("ALERT",'Preparing Data');
  553. await DBHelper.database.setOpenState();
  554. await DBHelper.database.closeDb();
  555. file_Trans_Handler trans = new file_Trans_Handler();
  556. util.showToast("ALERT",'Sending Data');
  557. setState(() {
  558. progress = 0;
  559. });
  560. trans.uploadFile("assets.db", "${prefs.getString(keyClass.hostAddress)??"https://asset.thamringroup.web.id"}/admin/uploadSqliteDb",sendingUser.text,context);
  561. _dlulStream = trans.progress.listen((value) async {
  562. setState(() {
  563. progress = (value!=-1.0)?value:null;
  564. });
  565. if(value!=null&&value >= 1.0) {
  566. if(trans.error==''&&trans.isFinish){
  567. _dlulStream.cancel();
  568. progress = null;
  569. util.showToast("SUCCESS",(trans.success!='')?trans.success:'Data uploaded');
  570. }
  571. }
  572. if(value==-1.0&&trans.isFinish){
  573. _dlulStream.cancel();
  574. progress = null;
  575. util.showToast("ERROR",'Data upload error. ${trans.error}');
  576. }
  577. });
  578. }
  579. else util.showToast("ALERT",'Sending user not filled');
  580. }
  581. else{
  582. util.showToast("ALERT",'No database file found');
  583. }
  584. },
  585. child: Padding(
  586. padding: const EdgeInsets.only(left: 10,top:10,right: 5),
  587. child: Container(
  588. decoration: BoxDecoration(
  589. color: Colors.white,
  590. borderRadius: BorderRadius.circular(10)
  591. ),
  592. child: Column(
  593. mainAxisAlignment: MainAxisAlignment.center,
  594. children: <Widget>[
  595. Expanded(
  596. flex: 4,
  597. child: Container(alignment: Alignment.center,child: (progress==null)?Icon(Icons.send,size: 100,color: Colors.blueGrey,):Stack(
  598. children: <Widget>[
  599. Container(width: 100,height: 100,child: CircularProgressIndicator(backgroundColor: Color(0xFFB4B4B4),valueColor:new AlwaysStoppedAnimation<Color>(Colors.blueGrey),value: progress,)),
  600. Container(width: 100,height: 100,alignment: Alignment.center,child: Text("${(progress*100).floor().toString()}%",style: TextStyle(color: Colors.blueGrey,fontWeight: FontWeight.bold,fontSize: 25),),)
  601. ],
  602. )),
  603. ),
  604. Flexible(
  605. flex: 2,
  606. child: Text('Send Data',style: TextStyle(color: Colors.blueGrey,fontSize: 18,fontWeight: FontWeight.bold),),
  607. ),
  608. ],
  609. ),
  610. ),
  611. ),
  612. ),
  613. InkWell(
  614. onTap: ()async{
  615. Directory documentsDirectory = await getExternalStorageDirectory();
  616. String path = join(documentsDirectory.path, "assets.db");
  617. File db = File(path);
  618. if(db.existsSync()) await clearData(context);
  619. else util.showToast('Alert', 'No database file found');
  620. },
  621. child: Padding(
  622. padding: const EdgeInsets.only(left: 5,top:10,right: 10),
  623. child: Container(
  624. decoration: BoxDecoration(
  625. color: Colors.white,
  626. borderRadius: BorderRadius.circular(10)
  627. ),
  628. child: Column(
  629. mainAxisAlignment: MainAxisAlignment.center,
  630. children: <Widget>[
  631. Expanded(
  632. flex: 4,
  633. child: Container(alignment: Alignment.center,child: Icon(Icons.delete,size: 100,color: Colors.blueGrey,)),
  634. ),
  635. Flexible(
  636. flex: 2,
  637. child: Text('Clear Data',style: TextStyle(color: Colors.blueGrey,fontSize: 18,fontWeight: FontWeight.bold),),
  638. ),
  639. ],
  640. ),
  641. ),
  642. ),
  643. ),
  644. ],
  645. ),
  646. ),
  647. ),
  648. Flexible(
  649. flex: 2,
  650. child: Container(
  651. padding: EdgeInsets.all(8),
  652. alignment: Alignment.bottomRight,
  653. child: Column(
  654. crossAxisAlignment: CrossAxisAlignment.end,
  655. mainAxisAlignment: MainAxisAlignment.end,
  656. children: <Widget>[
  657. Text((prefs.getString(keyClass.dbName)!=null)?"Master Data : ${prefs.getString(keyClass.dbName)}":'',style: TextStyle(color: Colors.blueGrey),),
  658. Text('Connected to ${prefs.getString(keyClass.hostAddress)??'https://asset.thamringroup.web.id'}',style: TextStyle(color: Colors.blueGrey),),
  659. ],
  660. ),
  661. ),
  662. ),
  663. ],
  664. ),
  665. ),
  666. );
  667. }
  668. }