import 'package:tuoc/model/master_data/master_data.dart';
import 'package:tuoc/service/api.dart';
import 'package:tuoc/util/database_util.dart';

class AppUtil{
  static getMasterData() async {
    Api api = Api<MasterDataModel>();

    var res = await api.getMasterData({});

    if(res.fail == null){
      MasterDataModel model = res.success;
      if(model.statusCode == 200){
        DatabaseUtil dbs = DatabaseUtil();
        await dbs.insertData(dbName:'master_data', data: model.data);
      }
    }
  }
}