Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问一下国际化,为什么我push新页面后,新页面的的语言并没有及时改变啊 #532

Closed
programmerElephant opened this issue Aug 10, 2019 · 2 comments

Comments

@programmerElephant
Copy link

programmerElephant commented Aug 10, 2019

image

image

// 用这种方法push页面语言不会改变,
Navigator.of(context).push(
                 MaterialPageRoute(
                   builder: (BuildContext context) {
                     return RegisterPage();
                   },
                 ),
               );

// 如果是这样的话就可以改变
 Navigator.of(context).push(
                 MaterialPageRoute(
                   builder: (BuildContext context) {
                     return StoreBuilder<AppState>(
                       builder: (context, store) {
                         return Localizations.override(
                           context: context,
                           locale: store.state.localeState.locale,
                           child: RegisterPage(),
                         );
                       },
                     );
                   },
                 ),

页面我都用basepage来包装了一下,我想问一下,是否是每一个新页面我都要包装一层Localizations.override,我看你的项目里面没有包装诶

@programmerElephant
Copy link
Author

加了一句super.build(context);就只需要在根路由套一层。

@CarGuo
Copy link
Owner

CarGuo commented Aug 12, 2019

不是很理解你的问题

@CarGuo CarGuo closed this as completed Aug 13, 2019
@jayVRIY jayVRIY mentioned this issue Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants