123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import 'package:cs_resources/generated/assets.dart';
- import 'package:flutter/material.dart';
- import 'package:shared/utils/color_utils.dart';
- class GarageState {
- List<Map<String, dynamic>>? topSectionsData;
- int? curPage;
- int? pageSize;
- int? filterCount;
- int? activeIndex = 0;
- List tabsList = [];
- List<Map<String,dynamic>> categoryList = [];
- List? list = [];
- GarageState({
- this.topSectionsData,
- this.curPage,
- this.pageSize,
- this.filterCount,
- this.activeIndex,
- List<Map<String, dynamic>>? categoryList,
- required this.tabsList,
- this.list,
- }): categoryList = categoryList ?? [];
- GarageState copyWith({
- List<Map<String, dynamic>>? topSectionsData,
- List<Map<String, dynamic>>? categoryList,
- int? curPage,
- int? pageSize,
- int? filterCount,
- int? activeIndex,
- List? tabsList,
- List? list,
- }) {
- return GarageState(
- topSectionsData: topSectionsData ?? this.topSectionsData,
- curPage: curPage ?? this.curPage,
- pageSize: pageSize ?? this.pageSize,
- filterCount: filterCount ?? this.filterCount,
- activeIndex: activeIndex ?? this.activeIndex,
- categoryList: categoryList ?? this.categoryList,
- tabsList: tabsList ?? this.tabsList,
- list: list ?? this.list,
- );
- }
- Map<String, dynamic> toMap() {
- return {
- 'topSectionsData': this.topSectionsData,
- 'curPage': this.curPage,
- 'pageSize': this.pageSize,
- 'filterCount': this.filterCount,
- 'activeIndex': this.activeIndex,
- 'tabsList': this.tabsList,
- 'list': this.list,
- 'categoryList': this.categoryList,
- };
- }
- factory GarageState.fromMap(Map<String, dynamic> map) {
- return GarageState(
- topSectionsData: map['topSectionsData'] as List<Map<String, dynamic>>,
- curPage: map['curPage'] as int,
- pageSize: map['pageSize'] as int,
- filterCount: map['filterCount'] as int,
- activeIndex: map['activeIndex'] as int,
- tabsList: map['tabsList'] as List,
- list: map['list'] as List,
- );
- }
- }
|