Browse Source

show error ketika dak ado yg perlu di audit

master
jefry 2 years ago
parent
commit
27092d3e55
5 changed files with 13 additions and 5 deletions
  1. +9
    -1
      lib/Util/DBHelper.dart
  2. +1
    -1
      lib/Util/Util.dart
  3. +1
    -1
      lib/home_page.dart
  4. +1
    -1
      lib/unit_details.dart
  5. +1
    -1
      pubspec.yaml

+ 9
- 1
lib/Util/DBHelper.dart View File

@@ -19,7 +19,7 @@ class DBHelper {
if (_db == null) _db = await initDb();
return _db;
}
backupDb(context) async{
backupDb({context}) async{
var result = {"STATUS":0,"MSG":"Backup gagal!"};
var stock_id = prefs.getString(keyClass.stock_id)??'';
if(stock_id != ''){
@@ -226,6 +226,14 @@ class DBHelper {
final database = await db;
var res = await database.update("${tableName.master}", unitUpdate.toJson(),
where: "${columnName.id} = ?", whereArgs: [unitUpdate.id]);
// print('Row Updated');

var checkCount = await database.query(tableName.master,where: "${columnName.flag} = ?", whereArgs: ['TRUE']);
// print(["check count",checkCount.length]);
if(checkCount.isNotEmpty&& checkCount.length%5==0){
// print('auto backup file');
backupDb();
}
print('Row Updated');
return res;
}


+ 1
- 1
lib/Util/Util.dart View File

@@ -310,7 +310,7 @@ class Util{
}
permissionCheck(context,pHandler.Permission permissionType,ifGranted,{customMessage=''})async{
pHandler.PermissionStatus permission = await permissionType.status;
if(permission!= pHandler.PermissionStatus.granted){
if(permission!= pHandler.PermissionStatus.granted &&context != null){
if(permission== pHandler.PermissionStatus.denied || permission== pHandler.PermissionStatus.restricted){
showFlushbar(context,'${permissionType.toString().substring(permissionType.toString().lastIndexOf('.')+1)} permission is needed$customMessage. Please grant the permission!');
await Future.delayed(Duration(seconds: 3));


+ 1
- 1
lib/home_page.dart View File

@@ -634,7 +634,7 @@ class _HomePageState extends State<HomePage> {
],
));
if(isBackup??false){
var result = await DBHelper.database.backupDb(context);
var result = await DBHelper.database.backupDb(context: context);
util.showFlushbar(context, result['MSG'],color: result["STATUS"]==1?Colors.grey:Colors.red);
}
}


+ 1
- 1
lib/unit_details.dart View File

@@ -600,7 +600,7 @@ class _UnitDetailsState extends State<UnitDetails> {
String errMsg = '';
util.showLoading(context);
await Future.sync(()async{
if(currentPosisiton!=null) {
if(currentPosisiton!=null){
if(blobList.where((element) => element.blob_file!=null).length==blobList.length){
for(int i = 0 ; i<blobList.length;i++){
blobList[i].lat = currentPosisiton.latitude.toString();


+ 1
- 1
pubspec.yaml View File

@@ -1,7 +1,7 @@
name: unitstocks
description: App to stock Thamrin Brothers Units
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.7+15
version: 1.0.8+17

environment:
sdk: ">=2.1.0 <3.0.0"


Loading…
Cancel
Save