add sync data package, enable offline display of mzansi wallet, about mih & mzansi ai
This commit is contained in:
parent
f588e9f715
commit
6ad1ea613c
18 changed files with 826 additions and 833 deletions
|
|
@ -1,13 +1,34 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_hive/about_mih_hive_data.dart';
|
||||
|
||||
class AboutMihProvider extends ChangeNotifier {
|
||||
int toolIndex;
|
||||
String version = "1.3.0";
|
||||
final AboutMihHiveData _hiveData;
|
||||
|
||||
AboutMihProvider({
|
||||
int toolIndex;
|
||||
String version = "1.4.0";
|
||||
int? userCount;
|
||||
int? businessCount;
|
||||
|
||||
AboutMihProvider(
|
||||
this._hiveData, {
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void loadCachedAboutMihSate() {
|
||||
userCount = _hiveData.getcachedUserCount();
|
||||
businessCount = _hiveData.getcachedBusinessCount();
|
||||
|
||||
KenLogger.success("About Mih Data Loaded from Cache");
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<bool> syncWithMihServerData() async {
|
||||
bool success = await _hiveData.syncAboutMihDataWithServer();
|
||||
loadCachedAboutMihSate();
|
||||
return success;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
notifyListeners();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue