Last active
November 13, 2020 15:32
-
-
Save panthe/420860dea32c4f94306c8d999962e9fd to your computer and use it in GitHub Desktop.
A typical Redux action
This file contains 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
import 'package:flutter/material.dart'; | |
import 'package:flutter_web_with_redux/models/user.dart'; | |
class FetchingUser { | |
bool isFetching; | |
FetchingUser({ | |
@required this.isFetching, | |
}); | |
toJson() { | |
return { | |
'isFetching': isFetching, | |
}; | |
} | |
} | |
class FetchUser {} | |
class SetUser { | |
final User user; | |
SetUser({ | |
@required this.user, | |
}); | |
toJson() { | |
return { | |
'user': user?.toJson(), | |
}; | |
} | |
} | |
class SavingUser { | |
bool isSaving; | |
SavingUser({ | |
@required this.isSaving, | |
}); | |
toJson() { | |
return { | |
'isSaving': isSaving, | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment