Rename ComponentState and use initState().
ComponentState becomes State, for brevity. Instead of overriding its constructor, override initState(). This makes writing States much simpler.
This commit is contained in:
@@ -10,8 +10,9 @@ class ProgressIndicatorApp extends StatefulComponent {
|
||||
ProgressIndicatorAppState createState() => new ProgressIndicatorAppState(this);
|
||||
}
|
||||
|
||||
class ProgressIndicatorAppState extends ComponentState<ProgressIndicatorApp> {
|
||||
ProgressIndicatorAppState(ProgressIndicatorApp config) : super(config) {
|
||||
class ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
|
||||
void initState(BuildContext context) {
|
||||
super.initState(context);
|
||||
valueAnimation = new ValueAnimation<double>()
|
||||
..duration = const Duration(milliseconds: 1500)
|
||||
..variable = new AnimatedValue<double>(
|
||||
|
||||
Reference in New Issue
Block a user