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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user