Upgrade progress_indicator demo defend against null color in updateTaskDescription
This commit is contained in:
parent
abb17ea93f
commit
179ca8164e
@ -6,10 +6,10 @@ import 'package:flutter/animation.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class ProgressIndicatorApp extends StatefulComponent {
|
class ProgressIndicatorApp extends StatefulComponent {
|
||||||
ProgressIndicatorAppState createState() => new ProgressIndicatorAppState();
|
_ProgressIndicatorAppState createState() => new _ProgressIndicatorAppState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
|
class _ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
valueAnimation = new ValuePerformance<double>()
|
valueAnimation = new ValuePerformance<double>()
|
||||||
@ -98,8 +98,6 @@ class ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
|
|||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
accentColor: Colors.redAccent[200]
|
accentColor: Colors.redAccent[200]
|
||||||
),
|
),
|
||||||
child: new Title(
|
|
||||||
title: 'Progress Indicators',
|
|
||||||
child: new Scaffold(
|
child: new Scaffold(
|
||||||
toolBar: new ToolBar(center: new Text('Progress Indicators')),
|
toolBar: new ToolBar(center: new Text('Progress Indicators')),
|
||||||
body: new DefaultTextStyle(
|
body: new DefaultTextStyle(
|
||||||
@ -108,11 +106,15 @@ class ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(new ProgressIndicatorApp());
|
runApp(new MaterialApp(
|
||||||
|
title: 'Progress Indicators',
|
||||||
|
routes: {
|
||||||
|
'/': (RouteArguments args) => new ProgressIndicatorApp()
|
||||||
|
}
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ void updateTaskDescription(String label, Color color) {
|
|||||||
|
|
||||||
TaskDescription description = new TaskDescription()
|
TaskDescription description = new TaskDescription()
|
||||||
..label = label
|
..label = label
|
||||||
..primaryColor = color?.value;
|
..primaryColor = color?.value ?? 0;
|
||||||
|
|
||||||
_activityProxy.ptr.setTaskDescription(description);
|
_activityProxy.ptr.setTaskDescription(description);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user