import 'package:get/get.dart';
import 'package:hello_wallpaper/models/wallpaper_model.dart';
import 'package:hello_wallpaper/routes/app_pages.dart';

class ClsDetController extends GetxController {
  late final List<WallpaperData> wallpaperDataList;
  late final String clsName;

  @override
  void onInit() {
    super.onInit();
    WallpaperModel wallpaperModel = Get.arguments ?? WallpaperModel();
    clsName = wallpaperModel.name ?? '';
    wallpaperDataList = wallpaperModel.data ?? <WallpaperData>[];
  }

  /// 点击壁纸
  void onTapItem(int index) {
    Get.toNamed(AppPages.wallpaperDet, arguments: {
      'position': index,
      'wallpaperList': wallpaperDataList,
    });
  }
}
