Commit 15a13b89 authored by Ian Hickson's avatar Ian Hickson

Merge pull request #713 from Hixie/title

Allow non-Material apps to use the Title widget.
parents 5252a300 5dd8bd6e
......@@ -53,7 +53,6 @@ export 'src/material/theme.dart';
export 'src/material/theme_data.dart';
export 'src/material/time_picker.dart';
export 'src/material/time_picker_dialog.dart';
export 'src/material/title.dart';
export 'src/material/toggleable.dart';
export 'src/material/tool_bar.dart';
export 'src/material/typography.dart';
......
......@@ -10,7 +10,6 @@ import 'package:flutter/widgets.dart';
import 'page.dart';
import 'theme.dart';
import 'title.dart';
const TextStyle _errorTextStyle = const TextStyle(
color: const Color(0xD0FF0000),
......@@ -107,16 +106,18 @@ class _MaterialAppState extends State<MaterialApp> implements BindingObserver {
}
Widget build(BuildContext context) {
ThemeData theme = config.theme ?? new ThemeData.fallback();
return new MediaQuery(
data: new MediaQueryData(size: _size),
child: new Theme(
data: config.theme ?? new ThemeData.fallback(),
data: theme,
child: new DefaultTextStyle(
style: _errorTextStyle,
child: new DefaultAssetBundle(
bundle: _defaultBundle,
child: new Title(
title: config.title,
color: theme.primaryColor,
child: new Navigator(
key: _navigator,
initialRoute: ui.window.defaultRouteName,
......
......@@ -5,21 +5,21 @@
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'theme.dart';
class Title extends StatelessComponent {
Title({ this.title, this.child });
Title({ this.title, this.child, this.color });
final Widget child;
final String title;
final Color color;
Widget build(BuildContext context) {
updateTaskDescription(title, Theme.of(context).primaryColor);
updateTaskDescription(title, color);
return child;
}
void debugFillDescription(List<String> description) {
super.debugFillDescription(description);
description.add('"$title"');
description.add('color: $color');
}
}
......@@ -33,6 +33,7 @@ export 'src/widgets/routes.dart';
export 'src/widgets/scrollable.dart';
export 'src/widgets/statistics_overlay.dart';
export 'src/widgets/status_transitions.dart';
export 'src/widgets/title.dart';
export 'src/widgets/transitions.dart';
export 'src/widgets/unique_component.dart';
......
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