|
1 |
| -import 'package:pigment/pigment.dart'; |
2 | 1 | import 'package:flutter/material.dart';
|
| 2 | +import 'package:pigment/pigment.dart'; |
3 | 3 |
|
4 | 4 | void main() {
|
5 |
| - LinearGradient g = new LinearGradient( |
6 |
| - colors: [ |
7 |
| - Pigment.fromString("rgb(0, 225, 170)"), |
8 |
| - Pigment.fromString("rgb(27, 26, 64)"), |
9 |
| - Pigment.fromString("rgb(221, 64, 86)"), |
10 |
| - Pigment.fromString("#5442FE"), |
11 |
| - Pigment.fromString("#50E8D7"), |
12 |
| - Pigment.fromString("#FF3472"), |
13 |
| - Pigment.fromString("#a0227baa"), |
14 |
| - Pigment.fromString("#EFEFEF"), |
15 |
| - Pigment.fromString("#AEF"), |
16 |
| - Pigment.fromString("#01B9"), |
| 5 | + runApp(new MyApp()); |
| 6 | +} |
| 7 | + |
| 8 | +class MyApp extends StatelessWidget { |
| 9 | + @override |
| 10 | + Widget build(BuildContext context) { |
| 11 | + return new MaterialApp( |
| 12 | + title: 'Pigment Example', |
| 13 | + home: new MyHomePage(), |
| 14 | + ); |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +class MyHomePage extends StatefulWidget { |
| 19 | + @override |
| 20 | + _MyHomePageState createState() => new _MyHomePageState(); |
| 21 | +} |
17 | 22 |
|
18 |
| - Pigment.fromCSSColor(CSSColor.rosybrown), // #BC8F8F |
19 |
| - Pigment.fromCSSColor(CSSColor.palegoldenrod), // #EEE8AA |
20 |
| - Pigment.fromString('lightsalmon'), // #FFA07A |
21 |
| - Pigment.fromString('deeppink'), // #FF1493 |
22 |
| - new Pigment(0xFFAA23F2) // #AA23F2 |
23 |
| - ], |
24 |
| - ); |
| 23 | +class _MyHomePageState extends State<MyHomePage> { |
| 24 | + @override |
| 25 | + Widget build(BuildContext context) { |
| 26 | + return new Scaffold( |
| 27 | + backgroundColor: Pigment.fromString("blue"), |
| 28 | + appBar: new AppBar( |
| 29 | + title: new Text("Pigment Example"), |
| 30 | + ), |
| 31 | + body: new Center( |
| 32 | + child: new Text( |
| 33 | + 'Hello, World!', |
| 34 | + style: new TextStyle( |
| 35 | + color: Pigment.fromCSSColor(CSSColor.lightgoldenrodyellow), |
| 36 | + ), |
| 37 | + ), |
| 38 | + ), |
| 39 | + ); |
| 40 | + } |
25 | 41 | }
|
0 commit comments