Commit 37821891 authored by Hans Muller's avatar Hans Muller

Merge pull request #1259 from HansMuller/progress_indicator

Update progress_indicator widget example

Update the progress_indicator demo: it was using Title explicitly, which is no longer needed.

Defend against a null color in updateTaskDescription. The color field in the TaskDescription struct (activity.mojom) isn't nullable.

Fixes #1248
parents abb17ea9 179ca816
......@@ -6,10 +6,10 @@ import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
class ProgressIndicatorApp extends StatefulComponent {
ProgressIndicatorAppState createState() => new ProgressIndicatorAppState();
_ProgressIndicatorAppState createState() => new _ProgressIndicatorAppState();
}
class ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
class _ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
void initState() {
super.initState();
valueAnimation = new ValuePerformance<double>()
......@@ -98,14 +98,11 @@ class ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
primarySwatch: Colors.blue,
accentColor: Colors.redAccent[200]
),
child: new Title(
title: 'Progress Indicators',
child: new Scaffold(
toolBar: new ToolBar(center: new Text('Progress Indicators')),
body: new DefaultTextStyle(
style: Theme.of(context).text.title,
child: body
)
child: new Scaffold(
toolBar: new ToolBar(center: new Text('Progress Indicators')),
body: new DefaultTextStyle(
style: Theme.of(context).text.title,
child: body
)
)
)
......@@ -114,5 +111,10 @@ class ProgressIndicatorAppState extends State<ProgressIndicatorApp> {
}
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()
..label = label
..primaryColor = color?.value;
..primaryColor = color?.value ?? 0;
_activityProxy.ptr.setTaskDescription(description);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment