import 'package:equatable/equatable.dart';
import 'package:zhiying_base_widget/widgets/home/home_slide_banner/model/home_slide_banner_model.dart';

abstract class HomeSlideBannerState extends Equatable {
  const HomeSlideBannerState();

  @override
  List<Object> get props => [];
}

/// 初始化状态
class InitialHomeSlideBannerState extends HomeSlideBannerState {
  @override
  List<Object> get props => [];
}

/// 缓存数据
class HomeSlideBannerCachedState extends HomeSlideBannerState {
  HomeSlideBannerModel datas;

  HomeSlideBannerCachedState({this.datas});

  @override
  List<Object> get props => [this.datas];
}

/// 数据加载完毕状态
class HomeSlideBannerLoadedState extends HomeSlideBannerState {
  HomeSlideBannerModel datas;

  HomeSlideBannerLoadedState({this.datas});

  HomeSlideBannerLoadedState copyWith({HomeSlideBannerModel newData}) {
    return HomeSlideBannerLoadedState(
      datas: newData ?? datas,
    );
  }

  @override
  List<Object> get props => [datas];
}

/// 数据加载失败
class HomeSlideBannerLoadError extends HomeSlideBannerState {}
