@@ -186,7 +186,7 @@ class TunStackItem extends ConsumerWidget {
186186 }
187187}
188188
189- class BypassDomainItem extends ConsumerWidget {
189+ class BypassDomainItem extends StatelessWidget {
190190 const BypassDomainItem ({super .key});
191191
192192 _initActions (BuildContext context, WidgetRef ref) {
@@ -219,32 +219,33 @@ class BypassDomainItem extends ConsumerWidget {
219219 }
220220
221221 @override
222- Widget build (BuildContext context, ref) {
223- final bypassDomain =
224- ref.watch (networkSettingProvider.select ((state) => state.bypassDomain));
225-
222+ Widget build (BuildContext context) {
226223 return ListItem .open (
227224 title: Text (appLocalizations.bypassDomain),
228225 subtitle: Text (appLocalizations.bypassDomainDesc),
229226 delegate: OpenDelegate (
230227 isBlur: false ,
231228 isScaffold: true ,
232229 title: appLocalizations.bypassDomain,
233- widget: Builder (builder: (context) {
234- _initActions (context, ref);
235- return ListPage (
236- title: appLocalizations.bypassDomain,
237- items: bypassDomain,
238- titleBuilder: (item) => Text (item),
239- onChange: (items) {
240- ref.read (networkSettingProvider.notifier).updateState (
241- (state) => state.copyWith (
242- bypassDomain: List .from (items),
243- ),
244- );
245- },
246- );
247- }),
230+ widget: Consumer (
231+ builder: (_, ref, __) {
232+ _initActions (context, ref);
233+ final bypassDomain = ref.watch (
234+ networkSettingProvider.select ((state) => state.bypassDomain));
235+ return ListPage (
236+ title: appLocalizations.bypassDomain,
237+ items: bypassDomain,
238+ titleBuilder: (item) => Text (item),
239+ onChange: (items) {
240+ ref.read (networkSettingProvider.notifier).updateState (
241+ (state) => state.copyWith (
242+ bypassDomain: List .from (items),
243+ ),
244+ );
245+ },
246+ );
247+ },
248+ ),
248249 extendPageWidth: 360 ,
249250 ),
250251 );
@@ -293,25 +294,29 @@ class RouteAddressItem extends ConsumerWidget {
293294 if (bypassPrivate) {
294295 return Container ();
295296 }
296- final routeAddress = ref.watch (
297- patchClashConfigProvider.select ((state) => state.tun.routeAddress));
298297 return ListItem .open (
299298 title: Text (appLocalizations.routeAddress),
300299 subtitle: Text (appLocalizations.routeAddressDesc),
301300 delegate: OpenDelegate (
302301 isBlur: false ,
303302 isScaffold: true ,
304303 title: appLocalizations.routeAddress,
305- widget: ListPage (
306- title: appLocalizations.routeAddress,
307- items: routeAddress,
308- titleBuilder: (item) => Text (item),
309- onChange: (items) {
310- ref.read (patchClashConfigProvider.notifier).updateState (
311- (state) => state.copyWith.tun (
312- routeAddress: List .from (items),
313- ),
314- );
304+ widget: Consumer (
305+ builder: (_, ref, __) {
306+ final routeAddress = ref.watch (patchClashConfigProvider
307+ .select ((state) => state.tun.routeAddress));
308+ return ListPage (
309+ title: appLocalizations.routeAddress,
310+ items: routeAddress,
311+ titleBuilder: (item) => Text (item),
312+ onChange: (items) {
313+ ref.read (patchClashConfigProvider.notifier).updateState (
314+ (state) => state.copyWith.tun (
315+ routeAddress: List .from (items),
316+ ),
317+ );
318+ },
319+ );
315320 },
316321 ),
317322 extendPageWidth: 360 ,
0 commit comments