File tree Expand file tree Collapse file tree 3 files changed +20
-12
lines changed
Expand file tree Collapse file tree 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> {
1515 LiveIcon liveIcon = LiveIcon ();
1616
1717 @override
18- void initState () async {
18+ void initState () {
1919 super .initState ();
20+ initialize ();
21+ }
22+
23+ void initialize () async {
2024 await liveIcon.initialize (icons: [
2125 const LiveIconData (
2226 iconName: "darkTheme" ,
@@ -37,7 +41,12 @@ class _MyAppState extends State<MyApp> {
3741 title: const Text ('Plugin example app' ),
3842 ),
3943 body: Center (
40- child: Text ('' ),
44+ child: ElevatedButton (
45+ child: Text ('Initialize' ),
46+ onPressed: () {
47+ initialize ();
48+ },
49+ ),
4150 ),
4251 ),
4352 );
Original file line number Diff line number Diff line change @@ -15,15 +15,11 @@ class LiveIcon {
1515 }
1616
1717 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 ();
2824 }
2925}
You can’t perform that action at this time.
0 commit comments