Add Material light and dark themes to Sky widgets
R=ianh@google.com, hixie Review URL: https://codereview.chromium.org/1204523002.
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
import 'package:sky/rendering/sky_binding.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/theme_data.dart';
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/widgets/basic.dart';
|
||||
import 'package:sky/widgets/navigator.dart';
|
||||
import 'package:sky/widgets/theme.dart';
|
||||
@@ -51,7 +50,10 @@ class StocksApp extends App {
|
||||
|
||||
Widget build() {
|
||||
return new Theme(
|
||||
data: new ThemeData(color: colors.Purple, text: typography.white),
|
||||
data: new ThemeData.light(
|
||||
primary: colors.Purple,
|
||||
accent: colors.RedAccent,
|
||||
darkToolbar: true),
|
||||
child: new Navigator(_navigationState)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
import 'package:sky/editing/input.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/widgets/basic.dart';
|
||||
import 'package:sky/widgets/drawer.dart';
|
||||
import 'package:sky/widgets/drawer_header.dart';
|
||||
@@ -161,7 +160,7 @@ class StockHome extends Component {
|
||||
left: new IconButton(
|
||||
icon: 'navigation/menu_white',
|
||||
onPressed: _handleOpenDrawer),
|
||||
center: new Text('Stocks', style: typography.white.title),
|
||||
center: new Text('Stocks'),
|
||||
right: [
|
||||
new IconButton(
|
||||
icon: 'action/search_white',
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
import 'package:sky/painting/text_style.dart';
|
||||
import 'package:sky/rendering/box.dart';
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/widgets/ink_well.dart';
|
||||
import 'package:sky/widgets/basic.dart';
|
||||
import 'package:sky/widgets/theme.dart';
|
||||
|
||||
import 'stock_arrow.dart';
|
||||
import 'stock_data.dart';
|
||||
@@ -43,7 +43,7 @@ class StockRow extends Component {
|
||||
new Flexible(
|
||||
child: new Text(
|
||||
changeInPrice,
|
||||
style: typography.black.caption.copyWith(textAlign: TextAlign.right)
|
||||
style: Theme.of(this).text.caption.copyWith(textAlign: TextAlign.right)
|
||||
)
|
||||
)
|
||||
];
|
||||
|
||||
@@ -77,10 +77,10 @@ class SectorApp extends App {
|
||||
|
||||
Widget build() {
|
||||
return new Theme(
|
||||
data: new ThemeData(color: colors.Blue, text: typography.white),
|
||||
data: new ThemeData.light(primary: colors.Blue, darkToolbar: true),
|
||||
child: new Scaffold(
|
||||
toolbar: new ToolBar(
|
||||
center: new Text('Sector Layout in a Widget Tree', style: typography.white.title)),
|
||||
center: new Text('Sector Layout in a Widget Tree')),
|
||||
body: new Material(
|
||||
edge: MaterialEdge.canvas,
|
||||
child: new Flex([
|
||||
|
||||
@@ -108,11 +108,11 @@ HAL: This mission is too important for me to allow you to jeopardize it.''';
|
||||
);
|
||||
|
||||
return new Theme(
|
||||
data: new ThemeData(color: Blue, text: white),
|
||||
data: new ThemeData.light(primary: Blue, darkToolbar: true),
|
||||
child: new Scaffold(
|
||||
body: new Material(child: interactiveBody),
|
||||
toolbar: new ToolBar(
|
||||
center: new Text('Hal and Dave', style: white.title)
|
||||
center: new Text('Hal and Dave')
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user