Move theme into material.dart
Also, introduce Colors and Typography to hold the material colors and the typography declarations. Previously we expected clients of these libraries to import them into a namespace, but that doesn't play nice with re-exporting them from material.dart.
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
class Field extends Component {
|
||||
@@ -66,7 +65,7 @@ class AddressBookApp extends App {
|
||||
new AspectRatio(
|
||||
aspectRatio: 16.0 / 9.0,
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(backgroundColor: colors.Purple[300])
|
||||
decoration: new BoxDecoration(backgroundColor: Colors.purple[300])
|
||||
)
|
||||
),
|
||||
new Field(inputKey: nameKey, icon: "social/person", placeholder: "Name"),
|
||||
@@ -102,13 +101,13 @@ class AddressBookApp extends App {
|
||||
Widget build() {
|
||||
ThemeData theme = new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Teal,
|
||||
accentColor: colors.PinkAccent[100]
|
||||
primarySwatch: Colors.teal,
|
||||
accentColor: Colors.pinkAccent[100]
|
||||
);
|
||||
return new Theme(
|
||||
data: theme,
|
||||
child: new DefaultTextStyle(
|
||||
style: typography.error, // if you see this, you've forgotten to correctly configure the text style!
|
||||
style: Typography.error, // if you see this, you've forgotten to correctly configure the text style!
|
||||
child: new Title(
|
||||
title: 'Address Book',
|
||||
child: new Navigator(_navigationState)
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
AssetBundle _initBundle() {
|
||||
@@ -58,7 +57,7 @@ class SkyDemo {
|
||||
final String href;
|
||||
final String bundle;
|
||||
final String description;
|
||||
final typography.TextTheme textTheme;
|
||||
final TextTheme textTheme;
|
||||
final BoxDecoration decoration;
|
||||
}
|
||||
|
||||
@@ -68,7 +67,7 @@ List<SkyDemo> demos = [
|
||||
href: '../../stocks/lib/main.dart',
|
||||
bundle: 'stocks.skyx',
|
||||
description: 'Multi-screen app with scrolling list',
|
||||
textTheme: typography.black,
|
||||
textTheme: Typography.black,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundImage: new BackgroundImage(
|
||||
image: _bundle.loadImage('assets/stocks_thumbnail.png'),
|
||||
@@ -81,7 +80,7 @@ List<SkyDemo> demos = [
|
||||
href: '../../game/lib/main.dart',
|
||||
bundle: 'game.skyx',
|
||||
description: '2D game using sprite sheets',
|
||||
textTheme: typography.white,
|
||||
textTheme: Typography.white,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundImage: new BackgroundImage(
|
||||
image: _bundle.loadImage('assets/game_thumbnail.png'),
|
||||
@@ -94,9 +93,9 @@ List<SkyDemo> demos = [
|
||||
href: '../../fitness/lib/main.dart',
|
||||
bundle: 'fitness.skyx',
|
||||
description: 'Track progress towards healthy goals',
|
||||
textTheme: typography.white,
|
||||
textTheme: Typography.white,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: colors.Indigo[500]
|
||||
backgroundColor: Colors.indigo[500]
|
||||
)
|
||||
),
|
||||
new SkyDemo(
|
||||
@@ -104,9 +103,9 @@ List<SkyDemo> demos = [
|
||||
href: '../../widgets/card_collection.dart',
|
||||
bundle: 'cards.skyx',
|
||||
description: 'Infinite list of swipeable cards',
|
||||
textTheme: typography.white,
|
||||
textTheme: Typography.white,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: colors.RedAccent[200]
|
||||
backgroundColor: Colors.redAccent[200]
|
||||
)
|
||||
),
|
||||
new SkyDemo(
|
||||
@@ -114,7 +113,7 @@ List<SkyDemo> demos = [
|
||||
href: '../../rendering/interactive_flex.dart',
|
||||
bundle: 'interactive_flex.skyx',
|
||||
description: 'Swipe to reflow the app',
|
||||
textTheme: typography.white,
|
||||
textTheme: Typography.white,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0081C6)
|
||||
)
|
||||
@@ -127,9 +126,9 @@ List<SkyDemo> demos = [
|
||||
href: '../../mine_digger/lib/main.dart',
|
||||
bundle: 'mine_digger.skyx',
|
||||
description: 'Clone of the classic Minesweeper game',
|
||||
textTheme: typography.white,
|
||||
textTheme: Typography.white,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: colors.black
|
||||
backgroundColor: Colors.black
|
||||
)
|
||||
),
|
||||
|
||||
@@ -188,7 +187,7 @@ class SkyHome extends App {
|
||||
return new Theme(
|
||||
data: new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Teal
|
||||
primarySwatch: Colors.teal
|
||||
),
|
||||
child: new Title(
|
||||
title: 'Sky Demos',
|
||||
|
||||
@@ -6,9 +6,10 @@ library fitness;
|
||||
|
||||
import 'package:playfair/playfair.dart' as playfair;
|
||||
import 'package:sky/animation.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
import 'user_data.dart';
|
||||
import 'date_utils.dart';
|
||||
import 'dart:async';
|
||||
@@ -171,8 +172,8 @@ class FitnessApp extends App {
|
||||
return new Theme(
|
||||
data: new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Indigo,
|
||||
accentColor: colors.PinkAccent[200]
|
||||
primarySwatch: Colors.indigo,
|
||||
accentColor: Colors.pinkAccent[200]
|
||||
),
|
||||
child: new Title(
|
||||
title: 'Fitness',
|
||||
|
||||
@@ -2,7 +2,7 @@ name: fitness
|
||||
dependencies:
|
||||
sky: any
|
||||
sky_tools: any
|
||||
playfair: ^0.0.7
|
||||
playfair: ^0.0.8
|
||||
path: ^1.3.6
|
||||
dependency_overrides:
|
||||
material_design_icons:
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/src/rendering/object.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/button_base.dart';
|
||||
@@ -13,7 +14,6 @@ import 'package:sky/src/widgets/framework.dart';
|
||||
import 'package:sky/src/widgets/navigator.dart';
|
||||
import 'package:sky/src/widgets/theme.dart';
|
||||
import 'package:sky/src/widgets/title.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:skysprites/skysprites.dart';
|
||||
|
||||
import 'game_demo.dart';
|
||||
@@ -99,7 +99,7 @@ class GameDemoApp extends App {
|
||||
// a custom theme swatch to match the purples in the sprites.
|
||||
ThemeData theme = new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Purple
|
||||
primarySwatch: Colors.purple
|
||||
);
|
||||
|
||||
return new Theme(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'dart:sky';
|
||||
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
import 'package:skysprites/skysprites.dart';
|
||||
|
||||
@@ -37,7 +37,7 @@ class TestDrawAtlasApp extends App {
|
||||
Widget build() {
|
||||
ThemeData theme = new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Purple
|
||||
primarySwatch: Colors.purple
|
||||
);
|
||||
|
||||
return new Theme(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'dart:sky' as sky;
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
import 'package:skysprites/skysprites.dart';
|
||||
|
||||
@@ -38,7 +38,7 @@ class TestApp extends App {
|
||||
Widget build() {
|
||||
ThemeData theme = new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Purple
|
||||
primarySwatch: Colors.purple
|
||||
);
|
||||
|
||||
return new Theme(
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'dart:sky' as sky;
|
||||
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
import 'package:skysprites/skysprites.dart';
|
||||
|
||||
@@ -50,7 +48,7 @@ class TestApp extends App {
|
||||
Widget build() {
|
||||
ThemeData theme = new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Purple
|
||||
primarySwatch: Colors.purple
|
||||
);
|
||||
|
||||
return new Theme(
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
import 'dart:sky' as sky;
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
// Classic minesweeper-inspired game. The mouse controls are standard
|
||||
@@ -184,7 +184,7 @@ class MineDiggerApp extends App {
|
||||
toolbar: buildToolBar(),
|
||||
body: new Container(
|
||||
child: new Center(child: board),
|
||||
decoration: new BoxDecoration(backgroundColor: colors.Grey[50])
|
||||
decoration: new BoxDecoration(backgroundColor: Colors.grey[50])
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -4,14 +4,15 @@
|
||||
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
|
||||
import 'solid_color_box.dart';
|
||||
|
||||
Color randomColor() {
|
||||
final List<Color> allColors = [
|
||||
colors.Blue,
|
||||
colors.Indigo
|
||||
Colors.blue,
|
||||
Colors.indigo
|
||||
].map((p) => p.values).fold([], (a, b) => a..addAll(b));
|
||||
final random = new math.Random();
|
||||
return allColors[random.nextInt(allColors.length)];
|
||||
|
||||
@@ -5,15 +5,14 @@
|
||||
import 'dart:sky';
|
||||
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/shadows.dart';
|
||||
import 'package:sky/material.dart';
|
||||
|
||||
void main() {
|
||||
var coloredBox = new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
gradient: new RadialGradient(
|
||||
center: Point.origin, radius: 500.0,
|
||||
colors: [colors.Yellow[500], colors.Blue[500]]),
|
||||
colors: [Colors.yellow[500], Colors.blue[500]]),
|
||||
boxShadow: shadows[3])
|
||||
);
|
||||
var paddedBox = new RenderPadding(
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
|
||||
import 'dart:sky' as sky;
|
||||
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
|
||||
// Material design colors. :p
|
||||
List<Color> kColors = [
|
||||
colors.Teal[500],
|
||||
colors.Amber[500],
|
||||
colors.Purple[500],
|
||||
colors.LightBlue[500],
|
||||
colors.DeepPurple[500],
|
||||
colors.Lime[500],
|
||||
Colors.teal[500],
|
||||
Colors.amber[500],
|
||||
Colors.purple[500],
|
||||
Colors.lightBlue[500],
|
||||
Colors.deepPurple[500],
|
||||
Colors.lime[500],
|
||||
];
|
||||
|
||||
class Dot {
|
||||
|
||||
@@ -7,9 +7,8 @@ library stocks;
|
||||
import 'dart:math' as math;
|
||||
import 'dart:sky' as sky;
|
||||
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/animation.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
import 'stock_data.dart';
|
||||
@@ -82,19 +81,19 @@ class StocksApp extends App {
|
||||
if (optimismSetting == StockMode.optimistic) {
|
||||
theme = new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Purple
|
||||
primarySwatch: Colors.purple
|
||||
);
|
||||
} else {
|
||||
theme = new ThemeData(
|
||||
brightness: ThemeBrightness.dark,
|
||||
accentColor: colors.RedAccent[200]
|
||||
accentColor: Colors.redAccent[200]
|
||||
);
|
||||
}
|
||||
|
||||
return new Theme(
|
||||
data: theme,
|
||||
child: new DefaultTextStyle(
|
||||
style: typography.error, // if you see this, you've forgotten to correctly configure the text style!
|
||||
style: Typography.error, // if you see this, you've forgotten to correctly configure the text style!
|
||||
child: new Title(
|
||||
title: 'Stocks',
|
||||
child: new Navigator(_navigationState)
|
||||
|
||||
@@ -18,8 +18,8 @@ class StockArrow extends Component {
|
||||
|
||||
Color _colorForPercentChange(double percentChange) {
|
||||
if (percentChange > 0)
|
||||
return colors.Green[_colorIndexForPercentChange(percentChange)];
|
||||
return colors.Red[_colorIndexForPercentChange(percentChange)];
|
||||
return Colors.green[_colorIndexForPercentChange(percentChange)];
|
||||
return Colors.red[_colorIndexForPercentChange(percentChange)];
|
||||
}
|
||||
|
||||
Widget build() {
|
||||
|
||||
@@ -275,7 +275,7 @@ class StockHome extends StatefulComponent {
|
||||
return _snackBarAnchor.build(
|
||||
new FloatingActionButton(
|
||||
child: new Icon(type: 'content/add', size: 24),
|
||||
backgroundColor: colors.RedAccent[200],
|
||||
backgroundColor: Colors.redAccent[200],
|
||||
onPressed: _handleStockPurchased
|
||||
));
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
|
||||
class BigSwitchApp extends App {
|
||||
bool _value = false;
|
||||
@@ -22,7 +22,7 @@ class BigSwitchApp extends App {
|
||||
padding: new EdgeDims.all(20.0),
|
||||
transform: scale,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: colors.Teal[600]
|
||||
backgroundColor: Colors.teal[600]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/animation.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
class CardModel {
|
||||
@@ -19,10 +18,10 @@ class CardModel {
|
||||
class CardCollectionApp extends App {
|
||||
|
||||
static const TextStyle cardLabelStyle =
|
||||
const TextStyle(color: colors.white, fontSize: 18.0, fontWeight: bold);
|
||||
const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: bold);
|
||||
|
||||
final TextStyle backgroundTextStyle =
|
||||
typography.white.title.copyWith(textAlign: TextAlign.center);
|
||||
Typography.white.title.copyWith(textAlign: TextAlign.center);
|
||||
|
||||
MixedViewportLayoutState _layoutState = new MixedViewportLayoutState();
|
||||
List<CardModel> _cardModels;
|
||||
@@ -38,7 +37,7 @@ class CardCollectionApp extends App {
|
||||
48.0, 63.0, 82.0, 146.0, 60.0, 55.0, 84.0, 96.0, 50.0
|
||||
];
|
||||
_cardModels = new List.generate(cardHeights.length, (i) {
|
||||
Color color = Color.lerp(colors.Red[300], colors.Blue[900], i / cardHeights.length);
|
||||
Color color = Color.lerp(Colors.red[300], Colors.blue[900], i / cardHeights.length);
|
||||
return new CardModel(i, cardHeights[i], color);
|
||||
});
|
||||
super.initState();
|
||||
@@ -211,8 +210,8 @@ class CardCollectionApp extends App {
|
||||
return new Theme(
|
||||
data: new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Blue,
|
||||
accentColor: colors.RedAccent[200]
|
||||
primarySwatch: Colors.blue,
|
||||
accentColor: Colors.redAccent[200]
|
||||
),
|
||||
child: new Title(
|
||||
title: 'Cards',
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/widgets.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/material.dart';
|
||||
|
||||
void main() => runApp(new DatePickerDemo());
|
||||
|
||||
@@ -26,7 +26,7 @@ class DatePickerDemo extends App {
|
||||
return new Theme(
|
||||
data: new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Teal
|
||||
primarySwatch: Colors.teal
|
||||
),
|
||||
child: new Stack([
|
||||
new Scaffold(
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'dart:sky' as sky;
|
||||
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
final double kTop = 10.0 + sky.view.paddingTop;
|
||||
@@ -39,9 +39,9 @@ class ExampleDragTarget extends StatefulComponent {
|
||||
decoration: new BoxDecoration(
|
||||
border: new Border.all(
|
||||
width: 3.0,
|
||||
color: data.isEmpty ? colors.white : colors.Blue[500]
|
||||
color: data.isEmpty ? Colors.white : Colors.blue[500]
|
||||
),
|
||||
backgroundColor: data.isEmpty ? colors.Grey[500] : colors.Green[500]
|
||||
backgroundColor: data.isEmpty ? Colors.grey[500] : Colors.green[500]
|
||||
),
|
||||
child: new Center(
|
||||
child: new Text(_text)
|
||||
@@ -58,7 +58,7 @@ class Dot extends Component {
|
||||
width: 50.0,
|
||||
height: 50.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: colors.DeepOrange[500]
|
||||
backgroundColor: Colors.deepOrange[500]
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -140,7 +140,7 @@ class DragAndDropApp extends App {
|
||||
}
|
||||
|
||||
return new Container(
|
||||
decoration: new BoxDecoration(backgroundColor: colors.Pink[500]),
|
||||
decoration: new BoxDecoration(backgroundColor: Colors.pink[500]),
|
||||
child: new Stack(layers)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
class CardModel {
|
||||
@@ -17,10 +17,10 @@ class CardModel {
|
||||
class EnsureVisibleApp extends App {
|
||||
|
||||
static const TextStyle cardLabelStyle =
|
||||
const TextStyle(color: colors.white, fontSize: 18.0, fontWeight: bold);
|
||||
const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: bold);
|
||||
|
||||
static const TextStyle selectedCardLabelStyle =
|
||||
const TextStyle(color: colors.white, fontSize: 24.0, fontWeight: bold);
|
||||
const TextStyle(color: Colors.white, fontSize: 24.0, fontWeight: bold);
|
||||
|
||||
List<CardModel> cardModels;
|
||||
MixedViewportLayoutState layoutState = new MixedViewportLayoutState();
|
||||
@@ -33,7 +33,7 @@ class EnsureVisibleApp extends App {
|
||||
48.0, 63.0, 82.0, 146.0, 60.0, 55.0, 84.0, 96.0, 50.0
|
||||
];
|
||||
cardModels = new List.generate(cardHeights.length, (i) {
|
||||
Color color = Color.lerp(colors.Red[300], colors.Blue[900], i / cardHeights.length);
|
||||
Color color = Color.lerp(Colors.red[300], Colors.blue[900], i / cardHeights.length);
|
||||
return new CardModel(i, cardHeights[i], color);
|
||||
});
|
||||
|
||||
@@ -83,8 +83,8 @@ class EnsureVisibleApp extends App {
|
||||
child: new Theme(
|
||||
data: new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Blue,
|
||||
accentColor: colors.RedAccent[200]
|
||||
primarySwatch: Colors.blue,
|
||||
accentColor: Colors.redAccent[200]
|
||||
),
|
||||
child: new Title(
|
||||
title: 'Cards',
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
import 'dart:sky' as sky;
|
||||
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
class CardModel {
|
||||
@@ -67,7 +67,7 @@ class Marker extends Component {
|
||||
class OverlayGeometryApp extends App {
|
||||
|
||||
static const TextStyle cardLabelStyle =
|
||||
const TextStyle(color: colors.white, fontSize: 18.0, fontWeight: bold);
|
||||
const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: bold);
|
||||
|
||||
List<CardModel> cardModels;
|
||||
MixedViewportLayoutState layoutState = new MixedViewportLayoutState();
|
||||
@@ -82,7 +82,7 @@ class OverlayGeometryApp extends App {
|
||||
48.0, 63.0, 82.0, 146.0, 60.0, 55.0, 84.0, 96.0, 50.0
|
||||
];
|
||||
cardModels = new List.generate(cardHeights.length, (i) {
|
||||
Color color = Color.lerp(colors.Red[300], colors.Blue[900], i / cardHeights.length);
|
||||
Color color = Color.lerp(Colors.red[300], Colors.blue[900], i / cardHeights.length);
|
||||
return new CardModel(i, cardHeights[i], color);
|
||||
});
|
||||
super.initState();
|
||||
@@ -163,8 +163,8 @@ class OverlayGeometryApp extends App {
|
||||
child: new Theme(
|
||||
data: new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Blue,
|
||||
accentColor: colors.RedAccent[200]
|
||||
primarySwatch: Colors.blue,
|
||||
accentColor: Colors.redAccent[200]
|
||||
),
|
||||
child: new Title(title: 'Cards', child: new Stack(layers))
|
||||
)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/theme/colors.dart';
|
||||
import 'package:sky/animation.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
class CardModel {
|
||||
@@ -18,7 +18,7 @@ class CardModel {
|
||||
class PageableListApp extends App {
|
||||
|
||||
static const TextStyle cardLabelStyle =
|
||||
const TextStyle(color: white, fontSize: 18.0, fontWeight: bold);
|
||||
const TextStyle(color: Colors.white, fontSize: 18.0, fontWeight: bold);
|
||||
|
||||
List<CardModel> cardModels;
|
||||
Size pageSize = new Size(200.0, 200.0);
|
||||
@@ -33,7 +33,7 @@ class PageableListApp extends App {
|
||||
.toList();
|
||||
|
||||
cardModels = new List.generate(cardSizes.length, (i) {
|
||||
Color color = Color.lerp(Red[300], Blue[900], i / cardSizes.length);
|
||||
Color color = Color.lerp(Colors.red[300], Colors.blue[900], i / cardSizes.length);
|
||||
return new CardModel(i, cardSizes[i], color);
|
||||
});
|
||||
|
||||
@@ -167,8 +167,8 @@ class PageableListApp extends App {
|
||||
child: new Theme(
|
||||
data: new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: Blue,
|
||||
accentColor: RedAccent[200]
|
||||
primarySwatch: Colors.blue,
|
||||
accentColor: Colors.redAccent[200]
|
||||
),
|
||||
child: new Title(
|
||||
title: 'PageableList',
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
import 'package:mojo/mojo/url_response.mojom.dart';
|
||||
import 'package:sky_services/media/media.mojom.dart';
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
// All of these sounds are marked as public domain at soundbible.
|
||||
@@ -42,12 +42,12 @@ class Key {
|
||||
|
||||
class PianoApp extends App {
|
||||
final List<Key> keys = [
|
||||
new Key(colors.Red[500], chimes),
|
||||
new Key(colors.Orange[500], chainsaw),
|
||||
new Key(colors.Yellow[500], stag),
|
||||
new Key(colors.Green[500], frogs),
|
||||
new Key(colors.Blue[500], rattle),
|
||||
new Key(colors.Purple[500], iLoveYou),
|
||||
new Key(Colors.red[500], chimes),
|
||||
new Key(Colors.orange[500], chainsaw),
|
||||
new Key(Colors.yellow[500], stag),
|
||||
new Key(Colors.green[500], frogs),
|
||||
new Key(Colors.blue[500], rattle),
|
||||
new Key(Colors.purple[500], iLoveYou),
|
||||
];
|
||||
|
||||
PianoApp() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/animation.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
class ProgressIndicatorApp extends App {
|
||||
@@ -90,8 +90,8 @@ class ProgressIndicatorApp extends App {
|
||||
child: new Theme(
|
||||
data: new ThemeData(
|
||||
brightness: ThemeBrightness.light,
|
||||
primarySwatch: colors.Blue,
|
||||
accentColor: colors.RedAccent[200]
|
||||
primarySwatch: Colors.blue,
|
||||
accentColor: Colors.redAccent[200]
|
||||
),
|
||||
child: new Title(
|
||||
title: 'Cards',
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
class ScaleApp extends App {
|
||||
@@ -41,7 +41,7 @@ class ScaleApp extends App {
|
||||
double radius = size.width / 2.0 * _zoom;
|
||||
Gradient gradient = new RadialGradient(
|
||||
center: center, radius: radius,
|
||||
colors: [colors.Blue[200], colors.Blue[800]]
|
||||
colors: [Colors.blue[200], Colors.blue[800]]
|
||||
);
|
||||
Paint paint = new Paint()
|
||||
..shader = gradient.createShader();
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
class StyledTextApp extends App {
|
||||
@@ -32,8 +32,8 @@ HAL: This mission is too important for me to allow you to jeopardize it.''';
|
||||
// [["Dave", "Open the pod bay..."] ...]
|
||||
List<List<String>> nameLines;
|
||||
|
||||
final TextStyle daveStyle = new TextStyle(color: colors.Indigo[400], height: 1.8);
|
||||
final TextStyle halStyle = new TextStyle(color: colors.Red[400], fontFamily: "monospace");
|
||||
final TextStyle daveStyle = new TextStyle(color: Colors.indigo[400], height: 1.8);
|
||||
final TextStyle halStyle = new TextStyle(color: Colors.red[400], fontFamily: "monospace");
|
||||
final TextStyle boldStyle = const TextStyle(fontWeight: bold);
|
||||
final TextStyle underlineStyle = const TextStyle(
|
||||
decoration: underline,
|
||||
@@ -100,7 +100,7 @@ HAL: This mission is too important for me to allow you to jeopardize it.''';
|
||||
data: new ThemeData.light(),
|
||||
child: new Scaffold(
|
||||
body: new Material(
|
||||
color: colors.Grey[50],
|
||||
color: Colors.grey[50],
|
||||
child: interactiveBody
|
||||
),
|
||||
toolbar: new ToolBar(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
|
||||
class TabbedNavigatorApp extends App {
|
||||
@@ -122,7 +122,7 @@ class TabbedNavigatorApp extends App {
|
||||
assert(selectedIndices.length == 5);
|
||||
|
||||
ToolBar toolbar = new ToolBar(
|
||||
center: new Text('Tabbed Navigator', style: typography.white.title)
|
||||
center: new Text('Tabbed Navigator', style: Typography.white.title)
|
||||
);
|
||||
|
||||
return new Scaffold(
|
||||
|
||||
15
packages/flutter/lib/material.dart
Normal file
15
packages/flutter/lib/material.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
/// Widgets implementing Material Design
|
||||
///
|
||||
/// See https://www.google.com/design/spec/material-design/introduction.html
|
||||
library material;
|
||||
|
||||
export 'src/material/colors.dart';
|
||||
export 'src/material/edges.dart';
|
||||
export 'src/material/shadows.dart';
|
||||
export 'src/material/theme_data.dart';
|
||||
export 'src/material/typography.dart';
|
||||
export 'src/material/constants.dart';
|
||||
@@ -2,5 +2,5 @@ This directory provides constants for Material Design.
|
||||
|
||||
http://www.google.com/design/spec/material-design/
|
||||
|
||||
Files in this directory only depend on [painting.dart](../painting.dart) and
|
||||
Files in this directory only depend on [painting.dart](../../painting.dart) and
|
||||
`sky:dart`.
|
||||
380
packages/flutter/lib/src/material/colors.dart
Normal file
380
packages/flutter/lib/src/material/colors.dart
Normal file
@@ -0,0 +1,380 @@
|
||||
// Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:sky' show Color;
|
||||
|
||||
/// [Color] constants which represent Material design's
|
||||
/// [color palette](http://www.google.com/design/spec/style/color.html).
|
||||
class Colors {
|
||||
Colors._();
|
||||
|
||||
static const white = const Color(0xFFFFFFFF);
|
||||
static const black = const Color(0xFF000000);
|
||||
static const transparent = const Color(0x00000000);
|
||||
static const white54 = const Color(0x8AFFFFFF);
|
||||
static const white87 = const Color(0xDDFFFFFF);
|
||||
static const black54 = const Color(0x8A000000);
|
||||
static const black87 = const Color(0xDD000000);
|
||||
|
||||
static const Map<int, Color> red = const {
|
||||
50: const Color(0xFFFFEBEE),
|
||||
100: const Color(0xFFFFCDD2),
|
||||
200: const Color(0xFFEF9A9A),
|
||||
300: const Color(0xFFE57373),
|
||||
400: const Color(0xFFEF5350),
|
||||
500: const Color(0xFFF44336),
|
||||
600: const Color(0xFFE53935),
|
||||
700: const Color(0xFFD32F2F),
|
||||
800: const Color(0xFFC62828),
|
||||
900: const Color(0xFFB71C1C),
|
||||
};
|
||||
|
||||
static const Map<int, Color> redAccent = const {
|
||||
100: const Color(0xFFFF8A80),
|
||||
200: const Color(0xFFFF5252),
|
||||
400: const Color(0xFFFF1744),
|
||||
700: const Color(0xFFD50000),
|
||||
};
|
||||
|
||||
static const Map<int, Color> pink = const {
|
||||
50: const Color(0xFFFCE4EC),
|
||||
100: const Color(0xFFF8BBD0),
|
||||
200: const Color(0xFFF48FB1),
|
||||
300: const Color(0xFFF06292),
|
||||
400: const Color(0xFFEC407A),
|
||||
500: const Color(0xFFE91E63),
|
||||
600: const Color(0xFFD81B60),
|
||||
700: const Color(0xFFC2185B),
|
||||
800: const Color(0xFFAD1457),
|
||||
900: const Color(0xFF880E4F),
|
||||
};
|
||||
|
||||
static const Map<int, Color> pinkAccent = const {
|
||||
100: const Color(0xFFFF80AB),
|
||||
200: const Color(0xFFFF4081),
|
||||
400: const Color(0xFFF50057),
|
||||
700: const Color(0xFFC51162),
|
||||
};
|
||||
|
||||
static const Map<int, Color> purple = const {
|
||||
50: const Color(0xFFF3E5F5),
|
||||
100: const Color(0xFFE1BEE7),
|
||||
200: const Color(0xFFCE93D8),
|
||||
300: const Color(0xFFBA68C8),
|
||||
400: const Color(0xFFAB47BC),
|
||||
500: const Color(0xFF9C27B0),
|
||||
600: const Color(0xFF8E24AA),
|
||||
700: const Color(0xFF7B1FA2),
|
||||
800: const Color(0xFF6A1B9A),
|
||||
900: const Color(0xFF4A148C),
|
||||
};
|
||||
|
||||
static const Map<int, Color> purpleAccent = const {
|
||||
100: const Color(0xFFEA80FC),
|
||||
200: const Color(0xFFE040FB),
|
||||
400: const Color(0xFFD500F9),
|
||||
700: const Color(0xFFAA00FF),
|
||||
};
|
||||
|
||||
static const Map<int, Color> deepPurple = const {
|
||||
50: const Color(0xFFEDE7F6),
|
||||
100: const Color(0xFFD1C4E9),
|
||||
200: const Color(0xFFB39DDB),
|
||||
300: const Color(0xFF9575CD),
|
||||
400: const Color(0xFF7E57C2),
|
||||
500: const Color(0xFF673AB7),
|
||||
600: const Color(0xFF5E35B1),
|
||||
700: const Color(0xFF512DA8),
|
||||
800: const Color(0xFF4527A0),
|
||||
900: const Color(0xFF311B92),
|
||||
};
|
||||
|
||||
static const Map<int, Color> deepPurpleAccent = const {
|
||||
100: const Color(0xFFB388FF),
|
||||
200: const Color(0xFF7C4DFF),
|
||||
400: const Color(0xFF651FFF),
|
||||
700: const Color(0xFF6200EA),
|
||||
};
|
||||
|
||||
static const Map<int, Color> indigo = const {
|
||||
50: const Color(0xFFE8EAF6),
|
||||
100: const Color(0xFFC5CAE9),
|
||||
200: const Color(0xFF9FA8DA),
|
||||
300: const Color(0xFF7986CB),
|
||||
400: const Color(0xFF5C6BC0),
|
||||
500: const Color(0xFF3F51B5),
|
||||
600: const Color(0xFF3949AB),
|
||||
700: const Color(0xFF303F9F),
|
||||
800: const Color(0xFF283593),
|
||||
900: const Color(0xFF1A237E),
|
||||
};
|
||||
|
||||
static const Map<int, Color> indigoAccent = const {
|
||||
100: const Color(0xFF8C9EFF),
|
||||
200: const Color(0xFF536DFE),
|
||||
400: const Color(0xFF3D5AFE),
|
||||
700: const Color(0xFF304FFE),
|
||||
};
|
||||
|
||||
static const Map<int, Color> blue = const {
|
||||
50: const Color(0xFFE3F2FD),
|
||||
100: const Color(0xFFBBDEFB),
|
||||
200: const Color(0xFF90CAF9),
|
||||
300: const Color(0xFF64B5F6),
|
||||
400: const Color(0xFF42A5F5),
|
||||
500: const Color(0xFF2196F3),
|
||||
600: const Color(0xFF1E88E5),
|
||||
700: const Color(0xFF1976D2),
|
||||
800: const Color(0xFF1565C0),
|
||||
900: const Color(0xFF0D47A1),
|
||||
};
|
||||
|
||||
static const Map<int, Color> blueAccent = const {
|
||||
100: const Color(0xFF82B1FF),
|
||||
200: const Color(0xFF448AFF),
|
||||
400: const Color(0xFF2979FF),
|
||||
700: const Color(0xFF2962FF),
|
||||
};
|
||||
|
||||
static const Map<int, Color> lightBlue = const {
|
||||
50: const Color(0xFFE1F5FE),
|
||||
100: const Color(0xFFB3E5FC),
|
||||
200: const Color(0xFF81D4FA),
|
||||
300: const Color(0xFF4FC3F7),
|
||||
400: const Color(0xFF29B6F6),
|
||||
500: const Color(0xFF03A9F4),
|
||||
600: const Color(0xFF039BE5),
|
||||
700: const Color(0xFF0288D1),
|
||||
800: const Color(0xFF0277BD),
|
||||
900: const Color(0xFF01579B),
|
||||
};
|
||||
|
||||
static const Map<int, Color> lightBlueAccent = const {
|
||||
100: const Color(0xFF80D8FF),
|
||||
200: const Color(0xFF40C4FF),
|
||||
400: const Color(0xFF00B0FF),
|
||||
700: const Color(0xFF0091EA),
|
||||
};
|
||||
|
||||
static const Map<int, Color> cyan = const {
|
||||
50: const Color(0xFFE0F7FA),
|
||||
100: const Color(0xFFB2EBF2),
|
||||
200: const Color(0xFF80DEEA),
|
||||
300: const Color(0xFF4DD0E1),
|
||||
400: const Color(0xFF26C6DA),
|
||||
500: const Color(0xFF00BCD4),
|
||||
600: const Color(0xFF00ACC1),
|
||||
700: const Color(0xFF0097A7),
|
||||
800: const Color(0xFF00838F),
|
||||
900: const Color(0xFF006064),
|
||||
};
|
||||
|
||||
static const Map<int, Color> cyanAccent = const {
|
||||
100: const Color(0xFF84FFFF),
|
||||
200: const Color(0xFF18FFFF),
|
||||
400: const Color(0xFF00E5FF),
|
||||
700: const Color(0xFF00B8D4),
|
||||
};
|
||||
|
||||
static const Map<int, Color> teal = const {
|
||||
50: const Color(0xFFE0F2F1),
|
||||
100: const Color(0xFFB2DFDB),
|
||||
200: const Color(0xFF80CBC4),
|
||||
300: const Color(0xFF4DB6AC),
|
||||
400: const Color(0xFF26A69A),
|
||||
500: const Color(0xFF009688),
|
||||
600: const Color(0xFF00897B),
|
||||
700: const Color(0xFF00796B),
|
||||
800: const Color(0xFF00695C),
|
||||
900: const Color(0xFF004D40),
|
||||
};
|
||||
|
||||
static const Map<int, Color> tealAccent = const {
|
||||
100: const Color(0xFFA7FFEB),
|
||||
200: const Color(0xFF64FFDA),
|
||||
400: const Color(0xFF1DE9B6),
|
||||
700: const Color(0xFF00BFA5),
|
||||
};
|
||||
|
||||
static const Map<int, Color> green = const {
|
||||
50: const Color(0xFFE8F5E9),
|
||||
100: const Color(0xFFC8E6C9),
|
||||
200: const Color(0xFFA5D6A7),
|
||||
300: const Color(0xFF81C784),
|
||||
400: const Color(0xFF66BB6A),
|
||||
500: const Color(0xFF4CAF50),
|
||||
600: const Color(0xFF43A047),
|
||||
700: const Color(0xFF388E3C),
|
||||
800: const Color(0xFF2E7D32),
|
||||
900: const Color(0xFF1B5E20),
|
||||
};
|
||||
|
||||
static const Map<int, Color> greenAccent = const {
|
||||
100: const Color(0xFFB9F6CA),
|
||||
200: const Color(0xFF69F0AE),
|
||||
400: const Color(0xFF00E676),
|
||||
700: const Color(0xFF00C853),
|
||||
};
|
||||
|
||||
static const Map<int, Color> lightGreen = const {
|
||||
50: const Color(0xFFF1F8E9),
|
||||
100: const Color(0xFFDCEDC8),
|
||||
200: const Color(0xFFC5E1A5),
|
||||
300: const Color(0xFFAED581),
|
||||
400: const Color(0xFF9CCC65),
|
||||
500: const Color(0xFF8BC34A),
|
||||
600: const Color(0xFF7CB342),
|
||||
700: const Color(0xFF689F38),
|
||||
800: const Color(0xFF558B2F),
|
||||
900: const Color(0xFF33691E),
|
||||
};
|
||||
|
||||
static const Map<int, Color> lightGreenAccent = const {
|
||||
100: const Color(0xFFCCFF90),
|
||||
200: const Color(0xFFB2FF59),
|
||||
400: const Color(0xFF76FF03),
|
||||
700: const Color(0xFF64DD17),
|
||||
};
|
||||
|
||||
static const Map<int, Color> lime = const {
|
||||
50: const Color(0xFFF9FBE7),
|
||||
100: const Color(0xFFF0F4C3),
|
||||
200: const Color(0xFFE6EE9C),
|
||||
300: const Color(0xFFDCE775),
|
||||
400: const Color(0xFFD4E157),
|
||||
500: const Color(0xFFCDDC39),
|
||||
600: const Color(0xFFC0CA33),
|
||||
700: const Color(0xFFAFB42B),
|
||||
800: const Color(0xFF9E9D24),
|
||||
900: const Color(0xFF827717),
|
||||
};
|
||||
|
||||
static const Map<int, Color> limeAccent = const {
|
||||
100: const Color(0xFFF4FF81),
|
||||
200: const Color(0xFFEEFF41),
|
||||
400: const Color(0xFFC6FF00),
|
||||
700: const Color(0xFFAEEA00),
|
||||
};
|
||||
|
||||
static const Map<int, Color> yellow = const {
|
||||
50: const Color(0xFFFFFDE7),
|
||||
100: const Color(0xFFFFF9C4),
|
||||
200: const Color(0xFFFFF59D),
|
||||
300: const Color(0xFFFFF176),
|
||||
400: const Color(0xFFFFEE58),
|
||||
500: const Color(0xFFFFEB3B),
|
||||
600: const Color(0xFFFDD835),
|
||||
700: const Color(0xFFFBC02D),
|
||||
800: const Color(0xFFF9A825),
|
||||
900: const Color(0xFFF57F17),
|
||||
};
|
||||
|
||||
static const Map<int, Color> yellowAccent = const {
|
||||
100: const Color(0xFFFFFF8D),
|
||||
200: const Color(0xFFFFFF00),
|
||||
400: const Color(0xFFFFEA00),
|
||||
700: const Color(0xFFFFD600),
|
||||
};
|
||||
|
||||
static const Map<int, Color> amber = const {
|
||||
50: const Color(0xFFFFF8E1),
|
||||
100: const Color(0xFFFFECB3),
|
||||
200: const Color(0xFFFFE082),
|
||||
300: const Color(0xFFFFD54F),
|
||||
400: const Color(0xFFFFCA28),
|
||||
500: const Color(0xFFFFC107),
|
||||
600: const Color(0xFFFFB300),
|
||||
700: const Color(0xFFFFA000),
|
||||
800: const Color(0xFFFF8F00),
|
||||
900: const Color(0xFFFF6F00),
|
||||
};
|
||||
|
||||
static const Map<int, Color> amberAccent = const {
|
||||
100: const Color(0xFFFFE57F),
|
||||
200: const Color(0xFFFFD740),
|
||||
400: const Color(0xFFFFC400),
|
||||
700: const Color(0xFFFFAB00),
|
||||
};
|
||||
|
||||
static const Map<int, Color> orange = const {
|
||||
50: const Color(0xFFFFF3E0),
|
||||
100: const Color(0xFFFFE0B2),
|
||||
200: const Color(0xFFFFCC80),
|
||||
300: const Color(0xFFFFB74D),
|
||||
400: const Color(0xFFFFA726),
|
||||
500: const Color(0xFFFF9800),
|
||||
600: const Color(0xFFFB8C00),
|
||||
700: const Color(0xFFF57C00),
|
||||
800: const Color(0xFFEF6C00),
|
||||
900: const Color(0xFFE65100),
|
||||
};
|
||||
|
||||
static const Map<int, Color> orangeAccent = const {
|
||||
100: const Color(0xFFFFD180),
|
||||
200: const Color(0xFFFFAB40),
|
||||
400: const Color(0xFFFF9100),
|
||||
700: const Color(0xFFFF6D00),
|
||||
};
|
||||
|
||||
static const Map<int, Color> deepOrange = const {
|
||||
50: const Color(0xFFFBE9E7),
|
||||
100: const Color(0xFFFFCCBC),
|
||||
200: const Color(0xFFFFAB91),
|
||||
300: const Color(0xFFFF8A65),
|
||||
400: const Color(0xFFFF7043),
|
||||
500: const Color(0xFFFF5722),
|
||||
600: const Color(0xFFF4511E),
|
||||
700: const Color(0xFFE64A19),
|
||||
800: const Color(0xFFD84315),
|
||||
900: const Color(0xFFBF360C),
|
||||
};
|
||||
|
||||
static const Map<int, Color> deepOrangeAccent = const {
|
||||
100: const Color(0xFFFF9E80),
|
||||
200: const Color(0xFFFF6E40),
|
||||
400: const Color(0xFFFF3D00),
|
||||
700: const Color(0xFFDD2C00),
|
||||
};
|
||||
|
||||
static const Map<int, Color> brown = const {
|
||||
50: const Color(0xFFEFEBE9),
|
||||
100: const Color(0xFFD7CCC8),
|
||||
200: const Color(0xFFBCAAA4),
|
||||
300: const Color(0xFFA1887F),
|
||||
400: const Color(0xFF8D6E63),
|
||||
500: const Color(0xFF795548),
|
||||
600: const Color(0xFF6D4C41),
|
||||
700: const Color(0xFF5D4037),
|
||||
800: const Color(0xFF4E342E),
|
||||
900: const Color(0xFF3E2723),
|
||||
};
|
||||
|
||||
static const Map<int, Color> grey = const {
|
||||
50: const Color(0xFFFAFAFA),
|
||||
100: const Color(0xFFF5F5F5),
|
||||
200: const Color(0xFFEEEEEE),
|
||||
300: const Color(0xFFE0E0E0),
|
||||
350: const Color(0xFFD6D6D6), // only for raised button while pressed or disabled
|
||||
400: const Color(0xFFBDBDBD),
|
||||
500: const Color(0xFF9E9E9E),
|
||||
600: const Color(0xFF757575),
|
||||
700: const Color(0xFF616161),
|
||||
800: const Color(0xFF424242),
|
||||
850: const Color(0xFF303030), // only for background color in Dark theme
|
||||
900: const Color(0xFF212121),
|
||||
};
|
||||
|
||||
static const Map<int, Color> blueGrey = const {
|
||||
50: const Color(0xFFECEFF1),
|
||||
100: const Color(0xFFCFD8DC),
|
||||
200: const Color(0xFFB0BEC5),
|
||||
300: const Color(0xFF90A4AE),
|
||||
400: const Color(0xFF78909C),
|
||||
500: const Color(0xFF607D8B),
|
||||
600: const Color(0xFF546E7A),
|
||||
700: const Color(0xFF455A64),
|
||||
800: const Color(0xFF37474F),
|
||||
900: const Color(0xFF263238),
|
||||
};
|
||||
}
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
import 'dart:sky';
|
||||
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/src/material/typography.dart';
|
||||
import 'package:sky/src/material/colors.dart';
|
||||
|
||||
enum ThemeBrightness { dark, light }
|
||||
|
||||
@@ -16,12 +16,12 @@ class ThemeData {
|
||||
Map<int, Color> primarySwatch,
|
||||
Color accentColor,
|
||||
this.accentColorBrightness: ThemeBrightness.dark,
|
||||
typography.TextTheme text
|
||||
TextTheme text
|
||||
}): this.brightness = brightness,
|
||||
this.primarySwatch = primarySwatch,
|
||||
primaryColorBrightness = primarySwatch == null ? brightness : ThemeBrightness.dark,
|
||||
canvasColor = brightness == ThemeBrightness.dark ? colors.Grey[850] : colors.Grey[50],
|
||||
cardColor = brightness == ThemeBrightness.dark ? colors.Grey[800] : colors.white,
|
||||
canvasColor = brightness == ThemeBrightness.dark ? Colors.grey[850] : Colors.grey[50],
|
||||
cardColor = brightness == ThemeBrightness.dark ? Colors.grey[800] : Colors.white,
|
||||
dividerColor = brightness == ThemeBrightness.dark ? const Color(0x1FFFFFFF) : const Color(0x1F000000),
|
||||
// Some users want the pre-multiplied color, others just want the opacity.
|
||||
hintColor = brightness == ThemeBrightness.dark ? const Color(0x42FFFFFF) : const Color(0x4C000000),
|
||||
@@ -35,27 +35,27 @@ class ThemeData {
|
||||
// revert when you cancel the tap.
|
||||
highlightColor = const Color(0x33999999),
|
||||
selectedColor = const Color(0x66999999),
|
||||
text = brightness == ThemeBrightness.dark ? typography.white : typography.black {
|
||||
text = brightness == ThemeBrightness.dark ? Typography.white : Typography.black {
|
||||
assert(brightness != null);
|
||||
|
||||
if (primarySwatch == null) {
|
||||
if (brightness == ThemeBrightness.dark) {
|
||||
_primaryColor = colors.Grey[900];
|
||||
_primaryColor = Colors.grey[900];
|
||||
} else {
|
||||
_primaryColor = colors.Grey[100];
|
||||
_primaryColor = Colors.grey[100];
|
||||
}
|
||||
} else {
|
||||
_primaryColor = primarySwatch[500];
|
||||
}
|
||||
|
||||
if (accentColor == null) {
|
||||
_accentColor = primarySwatch == null ? colors.Blue[500] : primarySwatch[500];
|
||||
_accentColor = primarySwatch == null ? Colors.blue[500] : primarySwatch[500];
|
||||
} else {
|
||||
_accentColor = accentColor;
|
||||
}
|
||||
}
|
||||
|
||||
factory ThemeData.light() => new ThemeData(primarySwatch: colors.Blue, brightness: ThemeBrightness.light);
|
||||
factory ThemeData.light() => new ThemeData(primarySwatch: Colors.blue, brightness: ThemeBrightness.light);
|
||||
factory ThemeData.dark() => new ThemeData(brightness: ThemeBrightness.dark);
|
||||
factory ThemeData.fallback() => new ThemeData.light();
|
||||
|
||||
@@ -68,7 +68,7 @@ class ThemeData {
|
||||
final Color highlightColor;
|
||||
final Color selectedColor;
|
||||
final double hintOpacity;
|
||||
final typography.TextTheme text;
|
||||
final TextTheme text;
|
||||
|
||||
Color _primaryColor;
|
||||
Color get primaryColor => _primaryColor;
|
||||
@@ -7,7 +7,7 @@
|
||||
import 'dart:sky' show Color;
|
||||
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/src/material/colors.dart';
|
||||
|
||||
// TODO(eseidel): Font weights are supposed to be language relative!
|
||||
// TODO(jackson): Baseline should be language relative!
|
||||
@@ -15,30 +15,30 @@ import 'package:sky/theme/colors.dart' as colors;
|
||||
class TextTheme {
|
||||
|
||||
const TextTheme._black()
|
||||
: display4 = const TextStyle(fontSize: 112.0, fontWeight: FontWeight.w100, color: colors.black54, textBaseline: TextBaseline.alphabetic),
|
||||
display3 = const TextStyle(fontSize: 56.0, fontWeight: FontWeight.w400, color: colors.black54, textBaseline: TextBaseline.alphabetic),
|
||||
display2 = const TextStyle(fontSize: 45.0, fontWeight: FontWeight.w400, color: colors.black54, height: 48.0 / 45.0, textBaseline: TextBaseline.alphabetic),
|
||||
display1 = const TextStyle(fontSize: 34.0, fontWeight: FontWeight.w400, color: colors.black54, height: 40.0 / 34.0, textBaseline: TextBaseline.alphabetic),
|
||||
headline = const TextStyle(fontSize: 24.0, fontWeight: FontWeight.w400, color: colors.black87, height: 32.0 / 24.0, textBaseline: TextBaseline.alphabetic),
|
||||
title = const TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500, color: colors.black87, height: 28.0 / 20.0, textBaseline: TextBaseline.alphabetic),
|
||||
subhead = const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, color: colors.black87, height: 24.0 / 16.0, textBaseline: TextBaseline.alphabetic),
|
||||
body2 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: colors.black87, height: 24.0 / 14.0, textBaseline: TextBaseline.alphabetic),
|
||||
body1 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400, color: colors.black87, height: 20.0 / 14.0, textBaseline: TextBaseline.alphabetic),
|
||||
caption = const TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400, color: colors.black54, textBaseline: TextBaseline.alphabetic),
|
||||
button = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: colors.black87, textBaseline: TextBaseline.alphabetic);
|
||||
: display4 = const TextStyle(fontSize: 112.0, fontWeight: FontWeight.w100, color: Colors.black54, textBaseline: TextBaseline.alphabetic),
|
||||
display3 = const TextStyle(fontSize: 56.0, fontWeight: FontWeight.w400, color: Colors.black54, textBaseline: TextBaseline.alphabetic),
|
||||
display2 = const TextStyle(fontSize: 45.0, fontWeight: FontWeight.w400, color: Colors.black54, height: 48.0 / 45.0, textBaseline: TextBaseline.alphabetic),
|
||||
display1 = const TextStyle(fontSize: 34.0, fontWeight: FontWeight.w400, color: Colors.black54, height: 40.0 / 34.0, textBaseline: TextBaseline.alphabetic),
|
||||
headline = const TextStyle(fontSize: 24.0, fontWeight: FontWeight.w400, color: Colors.black87, height: 32.0 / 24.0, textBaseline: TextBaseline.alphabetic),
|
||||
title = const TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500, color: Colors.black87, height: 28.0 / 20.0, textBaseline: TextBaseline.alphabetic),
|
||||
subhead = const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, color: Colors.black87, height: 24.0 / 16.0, textBaseline: TextBaseline.alphabetic),
|
||||
body2 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: Colors.black87, height: 24.0 / 14.0, textBaseline: TextBaseline.alphabetic),
|
||||
body1 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400, color: Colors.black87, height: 20.0 / 14.0, textBaseline: TextBaseline.alphabetic),
|
||||
caption = const TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400, color: Colors.black54, textBaseline: TextBaseline.alphabetic),
|
||||
button = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: Colors.black87, textBaseline: TextBaseline.alphabetic);
|
||||
|
||||
const TextTheme._white()
|
||||
: display4 = const TextStyle(fontSize: 112.0, fontWeight: FontWeight.w100, color: colors.white54, textBaseline: TextBaseline.alphabetic),
|
||||
display3 = const TextStyle(fontSize: 56.0, fontWeight: FontWeight.w400, color: colors.white54, textBaseline: TextBaseline.alphabetic),
|
||||
display2 = const TextStyle(fontSize: 45.0, fontWeight: FontWeight.w400, color: colors.white54, height: 48.0 / 45.0, textBaseline: TextBaseline.alphabetic),
|
||||
display1 = const TextStyle(fontSize: 34.0, fontWeight: FontWeight.w400, color: colors.white54, height: 40.0 / 34.0, textBaseline: TextBaseline.alphabetic),
|
||||
headline = const TextStyle(fontSize: 24.0, fontWeight: FontWeight.w400, color: colors.white87, height: 32.0 / 24.0, textBaseline: TextBaseline.alphabetic),
|
||||
title = const TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500, color: colors.white87, height: 28.0 / 20.0, textBaseline: TextBaseline.alphabetic),
|
||||
subhead = const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, color: colors.white87, height: 24.0 / 16.0, textBaseline: TextBaseline.alphabetic),
|
||||
body2 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: colors.white87, height: 24.0 / 14.0, textBaseline: TextBaseline.alphabetic),
|
||||
body1 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400, color: colors.white87, height: 20.0 / 14.0, textBaseline: TextBaseline.alphabetic),
|
||||
caption = const TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400, color: colors.white54, textBaseline: TextBaseline.alphabetic),
|
||||
button = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: colors.white87, textBaseline: TextBaseline.alphabetic);
|
||||
: display4 = const TextStyle(fontSize: 112.0, fontWeight: FontWeight.w100, color: Colors.white54, textBaseline: TextBaseline.alphabetic),
|
||||
display3 = const TextStyle(fontSize: 56.0, fontWeight: FontWeight.w400, color: Colors.white54, textBaseline: TextBaseline.alphabetic),
|
||||
display2 = const TextStyle(fontSize: 45.0, fontWeight: FontWeight.w400, color: Colors.white54, height: 48.0 / 45.0, textBaseline: TextBaseline.alphabetic),
|
||||
display1 = const TextStyle(fontSize: 34.0, fontWeight: FontWeight.w400, color: Colors.white54, height: 40.0 / 34.0, textBaseline: TextBaseline.alphabetic),
|
||||
headline = const TextStyle(fontSize: 24.0, fontWeight: FontWeight.w400, color: Colors.white87, height: 32.0 / 24.0, textBaseline: TextBaseline.alphabetic),
|
||||
title = const TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500, color: Colors.white87, height: 28.0 / 20.0, textBaseline: TextBaseline.alphabetic),
|
||||
subhead = const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, color: Colors.white87, height: 24.0 / 16.0, textBaseline: TextBaseline.alphabetic),
|
||||
body2 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: Colors.white87, height: 24.0 / 14.0, textBaseline: TextBaseline.alphabetic),
|
||||
body1 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400, color: Colors.white87, height: 20.0 / 14.0, textBaseline: TextBaseline.alphabetic),
|
||||
caption = const TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400, color: Colors.white54, textBaseline: TextBaseline.alphabetic),
|
||||
button = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: Colors.white87, textBaseline: TextBaseline.alphabetic);
|
||||
|
||||
final TextStyle display4;
|
||||
final TextStyle display3;
|
||||
@@ -54,20 +54,23 @@ class TextTheme {
|
||||
|
||||
}
|
||||
|
||||
class Typography {
|
||||
Typography._();
|
||||
|
||||
const TextTheme black = const TextTheme._black();
|
||||
const TextTheme white = const TextTheme._white();
|
||||
static const TextTheme black = const TextTheme._black();
|
||||
static const TextTheme white = const TextTheme._white();
|
||||
|
||||
// TODO(abarth): Maybe this should be hard-coded in Scaffold?
|
||||
const String typeface = 'font-family: sans-serif';
|
||||
// TODO(abarth): Maybe this should be hard-coded in Scaffold?
|
||||
static const String typeface = 'font-family: sans-serif';
|
||||
|
||||
const TextStyle error = const TextStyle(
|
||||
color: const Color(0xD0FF0000),
|
||||
fontFamily: 'monospace',
|
||||
fontSize: 48.0,
|
||||
fontWeight: FontWeight.w900,
|
||||
textAlign: TextAlign.right,
|
||||
decoration: underline,
|
||||
decorationColor: const Color(0xFFFF00),
|
||||
decorationStyle: TextDecorationStyle.double
|
||||
);
|
||||
static const TextStyle error = const TextStyle(
|
||||
color: const Color(0xD0FF0000),
|
||||
fontFamily: 'monospace',
|
||||
fontSize: 48.0,
|
||||
fontWeight: FontWeight.w900,
|
||||
textAlign: TextAlign.right,
|
||||
decoration: underline,
|
||||
decorationColor: const Color(0xFFFF00),
|
||||
decorationStyle: TextDecorationStyle.double
|
||||
);
|
||||
}
|
||||
@@ -6,9 +6,8 @@ import 'dart:async';
|
||||
|
||||
import 'package:intl/date_symbols.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/services.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
import 'package:sky/src/widgets/gesture_detector.dart';
|
||||
@@ -129,19 +128,19 @@ class DatePickerHeader extends Component {
|
||||
|
||||
Widget build() {
|
||||
ThemeData theme = Theme.of(this);
|
||||
typography.TextTheme headerTheme;
|
||||
TextTheme headerTheme;
|
||||
Color dayColor;
|
||||
Color yearColor;
|
||||
switch(theme.primaryColorBrightness) {
|
||||
case ThemeBrightness.light:
|
||||
headerTheme = typography.black;
|
||||
dayColor = mode == DatePickerMode.day ? colors.black87 : colors.black54;
|
||||
yearColor = mode == DatePickerMode.year ? colors.black87 : colors.black54;
|
||||
headerTheme = Typography.black;
|
||||
dayColor = mode == DatePickerMode.day ? Colors.black87 : Colors.black54;
|
||||
yearColor = mode == DatePickerMode.year ? Colors.black87 : Colors.black54;
|
||||
break;
|
||||
case ThemeBrightness.dark:
|
||||
headerTheme = typography.white;
|
||||
dayColor = mode == DatePickerMode.day ? colors.white87 : colors.white54;
|
||||
yearColor = mode == DatePickerMode.year ? colors.white87 : colors.white54;
|
||||
headerTheme = Typography.white;
|
||||
dayColor = mode == DatePickerMode.day ? Colors.white87 : Colors.white54;
|
||||
yearColor = mode == DatePickerMode.year ? Colors.white87 : Colors.white54;
|
||||
break;
|
||||
}
|
||||
TextStyle dayStyle = headerTheme.display3.copyWith(color: dayColor, height: 1.0, fontSize: 100.0);
|
||||
@@ -383,7 +382,7 @@ class YearPicker extends ScrollableWidgetList {
|
||||
int get itemCount => lastDate.year - firstDate.year + 1;
|
||||
|
||||
List<Widget> buildItems(int start, int count) {
|
||||
TextStyle style = Theme.of(this).text.body1.copyWith(color: colors.black54);
|
||||
TextStyle style = Theme.of(this).text.body1.copyWith(color: Colors.black54);
|
||||
List<Widget> items = new List<Widget>();
|
||||
for(int i = start; i < start + count; i++) {
|
||||
int year = firstDate.year + i;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:sky/animation.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/default_text_style.dart';
|
||||
import 'package:sky/src/widgets/focus.dart';
|
||||
@@ -58,9 +58,9 @@ class Dialog extends Component {
|
||||
Color get _color {
|
||||
switch (Theme.of(this).brightness) {
|
||||
case ThemeBrightness.light:
|
||||
return colors.white;
|
||||
return Colors.white;
|
||||
case ThemeBrightness.dark:
|
||||
return colors.Grey[800];
|
||||
return Colors.grey[800];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:sky/animation.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/shadows.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/animated_container.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
@@ -85,7 +84,7 @@ class Drawer extends StatefulComponent {
|
||||
child: new ColorTransition(
|
||||
performance: _performance,
|
||||
direction: showing ? Direction.forward : Direction.reverse,
|
||||
color: new AnimatedColorValue(colors.transparent, end: const Color(0x7F000000)),
|
||||
color: new AnimatedColorValue(Colors.transparent, end: const Color(0x7F000000)),
|
||||
child: new Container()
|
||||
),
|
||||
onTap: () {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/theme/view_configuration.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/default_text_style.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'dart:sky' as sky;
|
||||
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/button_base.dart';
|
||||
import 'package:sky/src/widgets/default_text_style.dart';
|
||||
@@ -46,7 +46,7 @@ class DrawerItem extends ButtonBase {
|
||||
return themeData.highlightColor;
|
||||
if (selected)
|
||||
return themeData.selectedColor;
|
||||
return colors.transparent;
|
||||
return Colors.transparent;
|
||||
}
|
||||
|
||||
sky.ColorFilter _getColorFilter(ThemeData themeData) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/theme/colors.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
import 'package:sky/src/widgets/material_button.dart';
|
||||
import 'package:sky/src/widgets/theme.dart';
|
||||
@@ -23,9 +23,9 @@ class FlatButton extends MaterialButton {
|
||||
return null;
|
||||
switch (Theme.of(this).brightness) {
|
||||
case ThemeBrightness.light:
|
||||
return Grey[400];
|
||||
return Colors.grey[400];
|
||||
case ThemeBrightness.dark:
|
||||
return Grey[200];
|
||||
return Colors.grey[200];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/theme/shadows.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/animated_container.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/default_text_style.dart';
|
||||
|
||||
@@ -6,8 +6,7 @@ import 'dart:sky' as sky;
|
||||
|
||||
import 'package:sky/animation.dart';
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/theme/colors.dart';
|
||||
import 'package:sky/theme/shadows.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
import 'package:sky/src/widgets/navigator.dart';
|
||||
@@ -78,7 +77,7 @@ class PopupMenu extends StatefulComponent {
|
||||
|
||||
void _updateBoxPainter() {
|
||||
_painter = new BoxPainter(new BoxDecoration(
|
||||
backgroundColor: Grey[50],
|
||||
backgroundColor: Colors.grey[50],
|
||||
borderRadius: 2.0,
|
||||
boxShadow: shadows[level]));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
import 'package:sky/src/widgets/material_button.dart';
|
||||
@@ -25,9 +25,9 @@ class RaisedButton extends MaterialButton {
|
||||
switch (Theme.of(this).brightness) {
|
||||
case ThemeBrightness.light:
|
||||
if (highlight)
|
||||
return colors.Grey[350];
|
||||
return Colors.grey[350];
|
||||
else
|
||||
return colors.Grey[300];
|
||||
return Colors.grey[300];
|
||||
break;
|
||||
case ThemeBrightness.dark:
|
||||
if (highlight)
|
||||
@@ -37,7 +37,7 @@ class RaisedButton extends MaterialButton {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
return colors.Grey[350];
|
||||
return Colors.grey[350];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
|
||||
import 'dart:sky' as sky;
|
||||
|
||||
import 'package:sky/src/rendering/box.dart';
|
||||
import 'package:sky/src/rendering/object.dart';
|
||||
import 'package:sky/theme/view_configuration.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
|
||||
// Slots are painted in this order and hit tested in reverse of this order
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import 'package:sky/animation.dart';
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/default_text_style.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
@@ -63,7 +63,7 @@ class SnackBar extends Component {
|
||||
child: new Container(
|
||||
margin: const EdgeDims.symmetric(vertical: 14.0),
|
||||
child: new DefaultTextStyle(
|
||||
style: typography.white.subhead,
|
||||
style: Typography.white.subhead,
|
||||
child: content
|
||||
)
|
||||
)
|
||||
|
||||
@@ -5,10 +5,9 @@
|
||||
import 'dart:async';
|
||||
import 'dart:sky' as sky;
|
||||
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/src/rendering/box.dart';
|
||||
import 'package:sky/src/rendering/object.dart';
|
||||
import 'package:sky/theme/shadows.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/theme.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
|
||||
@@ -9,8 +9,7 @@ import 'package:newton/newton.dart';
|
||||
import 'package:sky/animation.dart';
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/default_text_style.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
@@ -512,18 +511,18 @@ class TabBar extends Scrollable {
|
||||
Color backgroundColor = themeData.primaryColor;
|
||||
Color indicatorColor = themeData.accentColor;
|
||||
if (indicatorColor == backgroundColor) {
|
||||
indicatorColor = colors.white;
|
||||
indicatorColor = Colors.white;
|
||||
}
|
||||
|
||||
TextStyle textStyle;
|
||||
IconThemeColor iconThemeColor;
|
||||
switch (themeData.primaryColorBrightness) {
|
||||
case ThemeBrightness.light:
|
||||
textStyle = typography.black.body1;
|
||||
textStyle = Typography.black.body1;
|
||||
iconThemeColor = IconThemeColor.black;
|
||||
break;
|
||||
case ThemeBrightness.dark:
|
||||
textStyle = typography.white.body1;
|
||||
textStyle = Typography.white.body1;
|
||||
iconThemeColor = IconThemeColor.white;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:sky/theme/theme_data.dart';
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
|
||||
export 'package:sky/theme/theme_data.dart' show ThemeData, ThemeBrightness;
|
||||
export 'package:sky/material.dart' show ThemeData, ThemeBrightness;
|
||||
|
||||
class Theme extends Inherited {
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
|
||||
import 'package:sky/src/widgets/theme.dart';
|
||||
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/painting.dart';
|
||||
import 'package:sky/src/rendering/flex.dart';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/default_text_style.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
import 'package:sky/src/widgets/icon.dart';
|
||||
import 'package:sky/theme/shadows.dart';
|
||||
import 'package:sky/theme/typography.dart' as typography;
|
||||
import 'package:sky/theme/view_configuration.dart';
|
||||
|
||||
class ToolBar extends Component {
|
||||
|
||||
@@ -32,14 +30,14 @@ class ToolBar extends Component {
|
||||
Widget build() {
|
||||
Color toolbarColor = backgroundColor;
|
||||
IconThemeData iconThemeData;
|
||||
TextStyle centerStyle = typography.white.title;
|
||||
TextStyle sideStyle = typography.white.body1;
|
||||
TextStyle centerStyle = Typography.white.title;
|
||||
TextStyle sideStyle = Typography.white.body1;
|
||||
if (toolbarColor == null) {
|
||||
ThemeData themeData = Theme.of(this);
|
||||
toolbarColor = themeData.primaryColor;
|
||||
if (themeData.primaryColorBrightness == ThemeBrightness.light) {
|
||||
centerStyle = typography.black.title;
|
||||
sideStyle = typography.black.body2;
|
||||
centerStyle = Typography.black.title;
|
||||
sideStyle = Typography.black.body2;
|
||||
iconThemeData = const IconThemeData(color: IconThemeColor.black);
|
||||
} else {
|
||||
iconThemeData = const IconThemeData(color: IconThemeColor.white);
|
||||
|
||||
@@ -1,377 +0,0 @@
|
||||
// Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:sky' show Color;
|
||||
|
||||
/// [Color] constants which represent Material design's
|
||||
/// [color palette](http://www.google.com/design/spec/style/color.html).
|
||||
|
||||
const white = const Color(0xFFFFFFFF);
|
||||
const black = const Color(0xFF000000);
|
||||
const transparent = const Color(0x00000000);
|
||||
const white54 = const Color(0x8AFFFFFF);
|
||||
const white87 = const Color(0xDDFFFFFF);
|
||||
const black54 = const Color(0x8A000000);
|
||||
const black87 = const Color(0xDD000000);
|
||||
|
||||
const Map<int, Color> Red = const {
|
||||
50: const Color(0xFFFFEBEE),
|
||||
100: const Color(0xFFFFCDD2),
|
||||
200: const Color(0xFFEF9A9A),
|
||||
300: const Color(0xFFE57373),
|
||||
400: const Color(0xFFEF5350),
|
||||
500: const Color(0xFFF44336),
|
||||
600: const Color(0xFFE53935),
|
||||
700: const Color(0xFFD32F2F),
|
||||
800: const Color(0xFFC62828),
|
||||
900: const Color(0xFFB71C1C),
|
||||
};
|
||||
|
||||
const Map<int, Color> RedAccent = const {
|
||||
100: const Color(0xFFFF8A80),
|
||||
200: const Color(0xFFFF5252),
|
||||
400: const Color(0xFFFF1744),
|
||||
700: const Color(0xFFD50000),
|
||||
};
|
||||
|
||||
const Map<int, Color> Pink = const {
|
||||
50: const Color(0xFFFCE4EC),
|
||||
100: const Color(0xFFF8BBD0),
|
||||
200: const Color(0xFFF48FB1),
|
||||
300: const Color(0xFFF06292),
|
||||
400: const Color(0xFFEC407A),
|
||||
500: const Color(0xFFE91E63),
|
||||
600: const Color(0xFFD81B60),
|
||||
700: const Color(0xFFC2185B),
|
||||
800: const Color(0xFFAD1457),
|
||||
900: const Color(0xFF880E4F),
|
||||
};
|
||||
|
||||
const Map<int, Color> PinkAccent = const {
|
||||
100: const Color(0xFFFF80AB),
|
||||
200: const Color(0xFFFF4081),
|
||||
400: const Color(0xFFF50057),
|
||||
700: const Color(0xFFC51162),
|
||||
};
|
||||
|
||||
const Map<int, Color> Purple = const {
|
||||
50: const Color(0xFFF3E5F5),
|
||||
100: const Color(0xFFE1BEE7),
|
||||
200: const Color(0xFFCE93D8),
|
||||
300: const Color(0xFFBA68C8),
|
||||
400: const Color(0xFFAB47BC),
|
||||
500: const Color(0xFF9C27B0),
|
||||
600: const Color(0xFF8E24AA),
|
||||
700: const Color(0xFF7B1FA2),
|
||||
800: const Color(0xFF6A1B9A),
|
||||
900: const Color(0xFF4A148C),
|
||||
};
|
||||
|
||||
const Map<int, Color> PurpleAccent = const {
|
||||
100: const Color(0xFFEA80FC),
|
||||
200: const Color(0xFFE040FB),
|
||||
400: const Color(0xFFD500F9),
|
||||
700: const Color(0xFFAA00FF),
|
||||
};
|
||||
|
||||
const Map<int, Color> DeepPurple = const {
|
||||
50: const Color(0xFFEDE7F6),
|
||||
100: const Color(0xFFD1C4E9),
|
||||
200: const Color(0xFFB39DDB),
|
||||
300: const Color(0xFF9575CD),
|
||||
400: const Color(0xFF7E57C2),
|
||||
500: const Color(0xFF673AB7),
|
||||
600: const Color(0xFF5E35B1),
|
||||
700: const Color(0xFF512DA8),
|
||||
800: const Color(0xFF4527A0),
|
||||
900: const Color(0xFF311B92),
|
||||
};
|
||||
|
||||
const Map<int, Color> DeepPurpleAccent = const {
|
||||
100: const Color(0xFFB388FF),
|
||||
200: const Color(0xFF7C4DFF),
|
||||
400: const Color(0xFF651FFF),
|
||||
700: const Color(0xFF6200EA),
|
||||
};
|
||||
|
||||
const Map<int, Color> Indigo = const {
|
||||
50: const Color(0xFFE8EAF6),
|
||||
100: const Color(0xFFC5CAE9),
|
||||
200: const Color(0xFF9FA8DA),
|
||||
300: const Color(0xFF7986CB),
|
||||
400: const Color(0xFF5C6BC0),
|
||||
500: const Color(0xFF3F51B5),
|
||||
600: const Color(0xFF3949AB),
|
||||
700: const Color(0xFF303F9F),
|
||||
800: const Color(0xFF283593),
|
||||
900: const Color(0xFF1A237E),
|
||||
};
|
||||
|
||||
const Map<int, Color> IndigoAccent = const {
|
||||
100: const Color(0xFF8C9EFF),
|
||||
200: const Color(0xFF536DFE),
|
||||
400: const Color(0xFF3D5AFE),
|
||||
700: const Color(0xFF304FFE),
|
||||
};
|
||||
|
||||
const Map<int, Color> Blue = const {
|
||||
50: const Color(0xFFE3F2FD),
|
||||
100: const Color(0xFFBBDEFB),
|
||||
200: const Color(0xFF90CAF9),
|
||||
300: const Color(0xFF64B5F6),
|
||||
400: const Color(0xFF42A5F5),
|
||||
500: const Color(0xFF2196F3),
|
||||
600: const Color(0xFF1E88E5),
|
||||
700: const Color(0xFF1976D2),
|
||||
800: const Color(0xFF1565C0),
|
||||
900: const Color(0xFF0D47A1),
|
||||
};
|
||||
|
||||
const Map<int, Color> BlueAccent = const {
|
||||
100: const Color(0xFF82B1FF),
|
||||
200: const Color(0xFF448AFF),
|
||||
400: const Color(0xFF2979FF),
|
||||
700: const Color(0xFF2962FF),
|
||||
};
|
||||
|
||||
const Map<int, Color> LightBlue = const {
|
||||
50: const Color(0xFFE1F5FE),
|
||||
100: const Color(0xFFB3E5FC),
|
||||
200: const Color(0xFF81D4FA),
|
||||
300: const Color(0xFF4FC3F7),
|
||||
400: const Color(0xFF29B6F6),
|
||||
500: const Color(0xFF03A9F4),
|
||||
600: const Color(0xFF039BE5),
|
||||
700: const Color(0xFF0288D1),
|
||||
800: const Color(0xFF0277BD),
|
||||
900: const Color(0xFF01579B),
|
||||
};
|
||||
|
||||
const Map<int, Color> LightBlueAccent = const {
|
||||
100: const Color(0xFF80D8FF),
|
||||
200: const Color(0xFF40C4FF),
|
||||
400: const Color(0xFF00B0FF),
|
||||
700: const Color(0xFF0091EA),
|
||||
};
|
||||
|
||||
const Map<int, Color> Cyan = const {
|
||||
50: const Color(0xFFE0F7FA),
|
||||
100: const Color(0xFFB2EBF2),
|
||||
200: const Color(0xFF80DEEA),
|
||||
300: const Color(0xFF4DD0E1),
|
||||
400: const Color(0xFF26C6DA),
|
||||
500: const Color(0xFF00BCD4),
|
||||
600: const Color(0xFF00ACC1),
|
||||
700: const Color(0xFF0097A7),
|
||||
800: const Color(0xFF00838F),
|
||||
900: const Color(0xFF006064),
|
||||
};
|
||||
|
||||
const Map<int, Color> CyanAccent = const {
|
||||
100: const Color(0xFF84FFFF),
|
||||
200: const Color(0xFF18FFFF),
|
||||
400: const Color(0xFF00E5FF),
|
||||
700: const Color(0xFF00B8D4),
|
||||
};
|
||||
|
||||
const Map<int, Color> Teal = const {
|
||||
50: const Color(0xFFE0F2F1),
|
||||
100: const Color(0xFFB2DFDB),
|
||||
200: const Color(0xFF80CBC4),
|
||||
300: const Color(0xFF4DB6AC),
|
||||
400: const Color(0xFF26A69A),
|
||||
500: const Color(0xFF009688),
|
||||
600: const Color(0xFF00897B),
|
||||
700: const Color(0xFF00796B),
|
||||
800: const Color(0xFF00695C),
|
||||
900: const Color(0xFF004D40),
|
||||
};
|
||||
|
||||
const Map<int, Color> TealAccent = const {
|
||||
100: const Color(0xFFA7FFEB),
|
||||
200: const Color(0xFF64FFDA),
|
||||
400: const Color(0xFF1DE9B6),
|
||||
700: const Color(0xFF00BFA5),
|
||||
};
|
||||
|
||||
const Map<int, Color> Green = const {
|
||||
50: const Color(0xFFE8F5E9),
|
||||
100: const Color(0xFFC8E6C9),
|
||||
200: const Color(0xFFA5D6A7),
|
||||
300: const Color(0xFF81C784),
|
||||
400: const Color(0xFF66BB6A),
|
||||
500: const Color(0xFF4CAF50),
|
||||
600: const Color(0xFF43A047),
|
||||
700: const Color(0xFF388E3C),
|
||||
800: const Color(0xFF2E7D32),
|
||||
900: const Color(0xFF1B5E20),
|
||||
};
|
||||
|
||||
const Map<int, Color> GreenAccent = const {
|
||||
100: const Color(0xFFB9F6CA),
|
||||
200: const Color(0xFF69F0AE),
|
||||
400: const Color(0xFF00E676),
|
||||
700: const Color(0xFF00C853),
|
||||
};
|
||||
|
||||
const Map<int, Color> LightGreen = const {
|
||||
50: const Color(0xFFF1F8E9),
|
||||
100: const Color(0xFFDCEDC8),
|
||||
200: const Color(0xFFC5E1A5),
|
||||
300: const Color(0xFFAED581),
|
||||
400: const Color(0xFF9CCC65),
|
||||
500: const Color(0xFF8BC34A),
|
||||
600: const Color(0xFF7CB342),
|
||||
700: const Color(0xFF689F38),
|
||||
800: const Color(0xFF558B2F),
|
||||
900: const Color(0xFF33691E),
|
||||
};
|
||||
|
||||
const Map<int, Color> LightGreenAccent = const {
|
||||
100: const Color(0xFFCCFF90),
|
||||
200: const Color(0xFFB2FF59),
|
||||
400: const Color(0xFF76FF03),
|
||||
700: const Color(0xFF64DD17),
|
||||
};
|
||||
|
||||
const Map<int, Color> Lime = const {
|
||||
50: const Color(0xFFF9FBE7),
|
||||
100: const Color(0xFFF0F4C3),
|
||||
200: const Color(0xFFE6EE9C),
|
||||
300: const Color(0xFFDCE775),
|
||||
400: const Color(0xFFD4E157),
|
||||
500: const Color(0xFFCDDC39),
|
||||
600: const Color(0xFFC0CA33),
|
||||
700: const Color(0xFFAFB42B),
|
||||
800: const Color(0xFF9E9D24),
|
||||
900: const Color(0xFF827717),
|
||||
};
|
||||
|
||||
const Map<int, Color> LimeAccent = const {
|
||||
100: const Color(0xFFF4FF81),
|
||||
200: const Color(0xFFEEFF41),
|
||||
400: const Color(0xFFC6FF00),
|
||||
700: const Color(0xFFAEEA00),
|
||||
};
|
||||
|
||||
const Map<int, Color> Yellow = const {
|
||||
50: const Color(0xFFFFFDE7),
|
||||
100: const Color(0xFFFFF9C4),
|
||||
200: const Color(0xFFFFF59D),
|
||||
300: const Color(0xFFFFF176),
|
||||
400: const Color(0xFFFFEE58),
|
||||
500: const Color(0xFFFFEB3B),
|
||||
600: const Color(0xFFFDD835),
|
||||
700: const Color(0xFFFBC02D),
|
||||
800: const Color(0xFFF9A825),
|
||||
900: const Color(0xFFF57F17),
|
||||
};
|
||||
|
||||
const Map<int, Color> YellowAccent = const {
|
||||
100: const Color(0xFFFFFF8D),
|
||||
200: const Color(0xFFFFFF00),
|
||||
400: const Color(0xFFFFEA00),
|
||||
700: const Color(0xFFFFD600),
|
||||
};
|
||||
|
||||
const Map<int, Color> Amber = const {
|
||||
50: const Color(0xFFFFF8E1),
|
||||
100: const Color(0xFFFFECB3),
|
||||
200: const Color(0xFFFFE082),
|
||||
300: const Color(0xFFFFD54F),
|
||||
400: const Color(0xFFFFCA28),
|
||||
500: const Color(0xFFFFC107),
|
||||
600: const Color(0xFFFFB300),
|
||||
700: const Color(0xFFFFA000),
|
||||
800: const Color(0xFFFF8F00),
|
||||
900: const Color(0xFFFF6F00),
|
||||
};
|
||||
|
||||
const Map<int, Color> AmberAccent = const {
|
||||
100: const Color(0xFFFFE57F),
|
||||
200: const Color(0xFFFFD740),
|
||||
400: const Color(0xFFFFC400),
|
||||
700: const Color(0xFFFFAB00),
|
||||
};
|
||||
|
||||
const Map<int, Color> Orange = const {
|
||||
50: const Color(0xFFFFF3E0),
|
||||
100: const Color(0xFFFFE0B2),
|
||||
200: const Color(0xFFFFCC80),
|
||||
300: const Color(0xFFFFB74D),
|
||||
400: const Color(0xFFFFA726),
|
||||
500: const Color(0xFFFF9800),
|
||||
600: const Color(0xFFFB8C00),
|
||||
700: const Color(0xFFF57C00),
|
||||
800: const Color(0xFFEF6C00),
|
||||
900: const Color(0xFFE65100),
|
||||
};
|
||||
|
||||
const Map<int, Color> OrangeAccent = const {
|
||||
100: const Color(0xFFFFD180),
|
||||
200: const Color(0xFFFFAB40),
|
||||
400: const Color(0xFFFF9100),
|
||||
700: const Color(0xFFFF6D00),
|
||||
};
|
||||
|
||||
const Map<int, Color> DeepOrange = const {
|
||||
50: const Color(0xFFFBE9E7),
|
||||
100: const Color(0xFFFFCCBC),
|
||||
200: const Color(0xFFFFAB91),
|
||||
300: const Color(0xFFFF8A65),
|
||||
400: const Color(0xFFFF7043),
|
||||
500: const Color(0xFFFF5722),
|
||||
600: const Color(0xFFF4511E),
|
||||
700: const Color(0xFFE64A19),
|
||||
800: const Color(0xFFD84315),
|
||||
900: const Color(0xFFBF360C),
|
||||
};
|
||||
|
||||
const Map<int, Color> DeepOrangeAccent = const {
|
||||
100: const Color(0xFFFF9E80),
|
||||
200: const Color(0xFFFF6E40),
|
||||
400: const Color(0xFFFF3D00),
|
||||
700: const Color(0xFFDD2C00),
|
||||
};
|
||||
|
||||
const Map<int, Color> Brown = const {
|
||||
50: const Color(0xFFEFEBE9),
|
||||
100: const Color(0xFFD7CCC8),
|
||||
200: const Color(0xFFBCAAA4),
|
||||
300: const Color(0xFFA1887F),
|
||||
400: const Color(0xFF8D6E63),
|
||||
500: const Color(0xFF795548),
|
||||
600: const Color(0xFF6D4C41),
|
||||
700: const Color(0xFF5D4037),
|
||||
800: const Color(0xFF4E342E),
|
||||
900: const Color(0xFF3E2723),
|
||||
};
|
||||
|
||||
const Map<int, Color> Grey = const {
|
||||
50: const Color(0xFFFAFAFA),
|
||||
100: const Color(0xFFF5F5F5),
|
||||
200: const Color(0xFFEEEEEE),
|
||||
300: const Color(0xFFE0E0E0),
|
||||
350: const Color(0xFFD6D6D6), // only for raised button while pressed or disabled
|
||||
400: const Color(0xFFBDBDBD),
|
||||
500: const Color(0xFF9E9E9E),
|
||||
600: const Color(0xFF757575),
|
||||
700: const Color(0xFF616161),
|
||||
800: const Color(0xFF424242),
|
||||
850: const Color(0xFF303030), // only for background color in Dark theme
|
||||
900: const Color(0xFF212121),
|
||||
};
|
||||
|
||||
const Map<int, Color> BlueGrey = const {
|
||||
50: const Color(0xFFECEFF1),
|
||||
100: const Color(0xFFCFD8DC),
|
||||
200: const Color(0xFFB0BEC5),
|
||||
300: const Color(0xFF90A4AE),
|
||||
400: const Color(0xFF78909C),
|
||||
500: const Color(0xFF607D8B),
|
||||
600: const Color(0xFF546E7A),
|
||||
700: const Color(0xFF455A64),
|
||||
800: const Color(0xFF37474F),
|
||||
900: const Color(0xFF263238),
|
||||
};
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/rendering.dart';
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/theme/shadows.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'rendering_tester.dart';
|
||||
@@ -12,7 +11,7 @@ void main() {
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
gradient: new RadialGradient(
|
||||
center: Point.origin, radius: 500.0,
|
||||
colors: [colors.Yellow[500], colors.Blue[500]]),
|
||||
colors: [Colors.yellow[500], Colors.blue[500]]),
|
||||
boxShadow: shadows[3])
|
||||
);
|
||||
layout(root);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:sky/theme/colors.dart' as colors;
|
||||
import 'package:sky/material.dart';
|
||||
import 'package:sky/widgets.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
@@ -14,7 +14,7 @@ void main() {
|
||||
decoration: new BoxDecoration(
|
||||
shape: Shape.circle,
|
||||
border: new Border.all(width: 10.0, color: const Color(0x80FF00FF)),
|
||||
backgroundColor: colors.Teal[600]
|
||||
backgroundColor: Colors.teal[600]
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
@@ -41,7 +41,8 @@ void main() {
|
||||
test('duplicate key smoke test', () {
|
||||
WidgetTester tester = new WidgetTester();
|
||||
tester.pumpFrame(builder);
|
||||
tester.findWidget((widget) => widget is StatefulLeaf).test();
|
||||
StatefulLeaf leaf = tester.findWidget((widget) => widget is StatefulLeaf);
|
||||
leaf.test();
|
||||
tester.pumpFrameWithoutChange();
|
||||
Item lastItem = items[1];
|
||||
items.remove(lastItem);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:developer';
|
||||
import 'package:sky/src/widgets/basic.dart';
|
||||
import 'package:sky/src/widgets/framework.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
Reference in New Issue
Block a user