File tree 3 files changed +20
-12
lines changed
3 files changed +20
-12
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "java.configuration.updateBuildConfiguration" : " interactive"
3
+ }
Original file line number Diff line number Diff line change @@ -15,8 +15,12 @@ class _MyAppState extends State<MyApp> {
15
15
LiveIcon liveIcon = LiveIcon ();
16
16
17
17
@override
18
- void initState () async {
18
+ void initState () {
19
19
super .initState ();
20
+ initialize ();
21
+ }
22
+
23
+ void initialize () async {
20
24
await liveIcon.initialize (icons: [
21
25
const LiveIconData (
22
26
iconName: "darkTheme" ,
@@ -37,7 +41,12 @@ class _MyAppState extends State<MyApp> {
37
41
title: const Text ('Plugin example app' ),
38
42
),
39
43
body: Center (
40
- child: Text ('' ),
44
+ child: ElevatedButton (
45
+ child: Text ('Initialize' ),
46
+ onPressed: () {
47
+ initialize ();
48
+ },
49
+ ),
41
50
),
42
51
),
43
52
);
Original file line number Diff line number Diff line change @@ -15,15 +15,11 @@ class LiveIcon {
15
15
}
16
16
17
17
List <Map <String , String >> _serializeLiveIconData (List <LiveIconData > icons) {
18
- List <Map <String , String >> iconData;
19
- for (LiveIconData icon in icons) {
20
- iconData.add (
21
- < String , String > {
22
- 'iconName' : icon.iconName,
23
- 'className' : icon.className,
24
- },
25
- );
26
- }
27
- return iconData;
18
+ return icons
19
+ .map ((icon) => < String , String > {
20
+ 'iconName' : icon.iconName,
21
+ 'className' : icon.className,
22
+ })
23
+ .toList ();
28
24
}
29
25
}
You can’t perform that action at this time.
0 commit comments