You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-71Lines changed: 37 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -384,6 +384,7 @@ class FontFamily {
384
384
385
385
### Colors
386
386
387
+
[FlutterGen] supports generating colors from [XML](example/assets/color/colors.xml) format files.
387
388
_Ignore duplicated._
388
389
389
390
```yaml
@@ -392,27 +393,15 @@ flutter_gen:
392
393
colors:
393
394
inputs:
394
395
- assets/color/colors.xml
395
-
- assets/color/colors2.json
396
-
- assets/color/colors3.xml
396
+
- assets/color/colors2.xml
397
397
```
398
398
399
-
[FlutterGen] supports the following input file formats:
400
-
401
-
- a [XML file](example/assets/color/colors.xml), the same format as the Android colors.xml files, containing tags
399
+
[FlutterGen] generates [MaterialColor](https://api.flutter.dev/flutter/material/MaterialColor-class.html) class
400
+
if the element has the attribute `type="material"`, otherwise a normal [Color](https://api.flutter.dev/flutter/material/Colors-class.html) class will be generated.
402
401
403
402
```xml
404
403
<color name="milk_tea">#F5CB84</color>
405
-
<color name="cinnamon">#955E1C</color>
406
-
<color name="black_50">#80000000</color>
407
-
```
408
-
409
-
- a [JSON file](example/assets/color/colors2.json), representing a dictionary of names -> values, each value being the hex representation of the color
0 commit comments