@@ -38,8 +38,8 @@ class SettingWidget extends StatelessWidget {
3838 return ;
3939 }
4040 if (ConfigSetting ().showResultDialog.value) {
41- SmartDialog .compatible. show (
42- widget : ResultDialog (
41+ SmartDialog .show (
42+ builder : ( BuildContext b) => ResultDialog (
4343 text: dartText,
4444 ),
4545 );
@@ -52,13 +52,13 @@ class SettingWidget extends StatelessWidget {
5252 onPressed: () {
5353 showModalBottomSheet <void >(
5454 context: context,
55+ constraints: const BoxConstraints .expand (),
5556 builder: (BuildContext ctx) {
56- return Container (
57- height: double .infinity,
58- child: const MoreSetting (),
59- );
57+ return const MoreSetting ();
6058 },
61- ).whenComplete (() {});
59+ ).whenComplete (() {
60+ ConfigSetting ().save ();
61+ });
6262 },
6363 ),
6464 Obx (() {
@@ -77,6 +77,7 @@ class SettingWidget extends StatelessWidget {
7777 .toList (),
7878 onChanged: (Locale ? value) {
7979 ConfigSetting ().locale.value = value! ;
80+ ConfigSetting ().save ();
8081 Get .updateLocale (ConfigSetting ().locale.value);
8182 controller.formatJsonAndCreateDartObject ();
8283 },
@@ -108,6 +109,7 @@ class MoreSetting extends StatelessWidget {
108109 onChanged: (bool value) {
109110 if (ConfigSetting ().enableDataProtection.value != value) {
110111 ConfigSetting ().enableDataProtection.value = value;
112+ ConfigSetting ().save ();
111113 }
112114 },
113115 );
@@ -119,6 +121,7 @@ class MoreSetting extends StatelessWidget {
119121 onChanged: (bool value) {
120122 if (value != ConfigSetting ().enableArrayProtection.value) {
121123 ConfigSetting ().enableArrayProtection.value = value;
124+ ConfigSetting ().save ();
122125 }
123126 },
124127 );
@@ -148,7 +151,7 @@ class MoreSetting extends StatelessWidget {
148151 onChanged: (int ? value) {
149152 if (ConfigSetting ().traverseArrayCount.value != value) {
150153 ConfigSetting ().traverseArrayCount.value = value! ;
151-
154+ ConfigSetting (). save ();
152155 if (controller.dartObject != null ) {
153156 controller.formatJsonAndCreateDartObject ();
154157 }
@@ -185,7 +188,7 @@ class MoreSetting extends StatelessWidget {
185188 if (ConfigSetting ().propertyNamingConventionsType.value !=
186189 value) {
187190 ConfigSetting ().propertyNamingConventionsType.value = value! ;
188-
191+ ConfigSetting (). save ();
189192 controller.updateNameByNamingConventionsType ();
190193 }
191194 },
@@ -215,7 +218,7 @@ class MoreSetting extends StatelessWidget {
215218 onChanged: (PropertyNameSortingType ? value) {
216219 if (ConfigSetting ().propertyNameSortingType.value != value) {
217220 ConfigSetting ().propertyNameSortingType.value = value! ;
218-
221+ ConfigSetting (). save ();
219222 controller.orderPropeties ();
220223 }
221224 },
@@ -229,6 +232,7 @@ class MoreSetting extends StatelessWidget {
229232 onChanged: (bool value) {
230233 if (ConfigSetting ().addMethod.value != value) {
231234 ConfigSetting ().addMethod.value = value;
235+ ConfigSetting ().save ();
232236 }
233237 },
234238 );
@@ -242,6 +246,7 @@ class MoreSetting extends StatelessWidget {
242246 if (! value) {
243247 ConfigSetting ().smartNullable.value = false ;
244248 }
249+ ConfigSetting ().save ();
245250 },
246251 );
247252 }),
@@ -255,6 +260,7 @@ class MoreSetting extends StatelessWidget {
255260 // if (!value) {
256261 // controller.updateNullable(true);
257262 // }
263+ ConfigSetting ().save ();
258264 },
259265 );
260266 }
@@ -270,6 +276,7 @@ class MoreSetting extends StatelessWidget {
270276 onChanged: (bool value) {
271277 if (ConfigSetting ().addCopyMethod.value != value) {
272278 ConfigSetting ().addCopyMethod.value = value;
279+ ConfigSetting ().save ();
273280 }
274281 },
275282 );
@@ -280,6 +287,7 @@ class MoreSetting extends StatelessWidget {
280287 value: ConfigSetting ().automaticCheck.value,
281288 onChanged: (bool value) {
282289 ConfigSetting ().automaticCheck.value = value;
290+ ConfigSetting ().save ();
283291 },
284292 );
285293 }),
@@ -290,6 +298,7 @@ class MoreSetting extends StatelessWidget {
290298 onChanged: (bool value) {
291299 if (value != ConfigSetting ().showResultDialog.value) {
292300 ConfigSetting ().showResultDialog.value = value;
301+ ConfigSetting ().save ();
293302 }
294303 },
295304 );
@@ -324,6 +333,7 @@ class MoreSetting extends StatelessWidget {
324333 controller: controller.fileHeaderHelpController,
325334 onChanged: (String value) {
326335 ConfigSetting ().fileHeaderInfo = value;
336+ ConfigSetting ().save ();
327337 },
328338 decoration: InputDecoration (
329339 contentPadding: const EdgeInsets .symmetric (horizontal: 12 ),
0 commit comments