Init core module

This commit is contained in:
dab246
2021-07-27 12:50:45 +07:00
committed by Dat H. Pham
parent e26927790b
commit 5b0a8f6fb2
30 changed files with 1029 additions and 0 deletions
@@ -0,0 +1,14 @@
import 'package:core/core.dart';
import 'package:dartz/dartz.dart';
import 'package:meta/meta.dart';
import 'package:equatable/equatable.dart';
@immutable
abstract class AppState with EquatableMixin {
final Either<Failure, Success> viewState;
AppState(this.viewState);
@override
List<Object?> get props => [viewState];
}
+5
View File
@@ -0,0 +1,5 @@
import 'package:equatable/equatable.dart';
abstract class Failure extends Equatable {}
abstract class FeatureFailure extends Failure {}
+15
View File
@@ -0,0 +1,15 @@
import 'package:equatable/equatable.dart';
abstract class Success with EquatableMixin {}
abstract class ViewState extends Success {}
class UIState extends ViewState {
static final idle = UIState();
static final loading = UIState();
UIState() : super();
@override
List<Object?> get props => [];
}