import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:wallpaper/routes/app_routes.dart';
import "package:wallpaper/utils/assettool.dart";
import 'package:wallpaper/models/imgnetodel.dart';
class HomePageController extends GetxController {
  var typeList  = <NetImgCategory>[].obs;
  @override
  void onReady() async{
    super.onReady();
    
    setupTypeListData();
  }

  void setupTypeListData() async{
    var temData =  await loadWallpaperJsonFromAsset();
    typeList.value = temData.map((e) => NetImgCategory.fromJson(e)).toList();
  }

  void goCategoryView(var title,var dataModel){
    Get.toNamed(AppRoutes.imgcategorypage, arguments: {"stitle":title,"dataModel":dataModel});
  }
}