Skip to content

Commit 7b8e9d9

Browse files
fix: Fix analyzer issues
This commit fixes two analyzer issues: - Add part-of directive to named_colors.dart - Remove unused variable in usage_example.dart
1 parent dce2443 commit 7b8e9d9

File tree

2 files changed

+38
-20
lines changed

2 files changed

+38
-20
lines changed

example/usage_example.dart

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
1-
import 'package:pigment/pigment.dart';
21
import 'package:flutter/material.dart';
2+
import 'package:pigment/pigment.dart';
33

44
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+
}
1722

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+
}
2541
}

lib/named_colors.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
part of 'pigment.dart';
2+
13
const cssColors = {
24
'lightsalmon': '#FFA07A',
35
'salmon': '#FA8072',

0 commit comments

Comments
 (0)