Created
April 21, 2023 22:55
-
-
Save FlutterWiz/1efd9ea6328f50171b87bdfb08e5de91 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExampleState extends Equatable { | |
const ExampleState({ | |
this.user = const User(), | |
this.isLoading = false, | |
}); | |
@override | |
List<Object?> get props => [ | |
user, | |
isLoading, | |
]; | |
final User userGratitude; | |
final bool isLoading; | |
bool get isAddButtonEnabled => | |
user != const User() && | |
user.name.length >= 3 && | |
user.surname.length >= 10; | |
ExampleState copyWith({ | |
User? user, | |
bool? isLoading, | |
}) { | |
return ExampleState( | |
user: user ?? this.user, | |
isLoading: isLoading ?? this.isLoading, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment