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

Tried calling: restart() when i try to convert the app language #14

Closed
mohmmed750 opened this issue Nov 12, 2020 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@mohmmed750
Copy link

I have a problem,
when I try to converter the app language, I faced a problem,

[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: NoSuchMethodError: The method 'restart' was called on null. E/flutter ( 6490): Receiver: null E/flutter ( 6490): Tried calling: restart() E/flutter ( 6490): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5) E/flutter ( 6490): #1 LocalizedApp.restart (package:localize_and_translate/src/main.class.dart:258:11) E/flutter ( 6490): #2 LocalizeAndTranslate.setNewLanguage (package:localize_and_translate/src/main.class.dart:197:20) E/flutter ( 6490): <asynchronous suspension> E/flutter ( 6490): #3 _settingsState._onBackPressed.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:erp_accounting_app/drawer_pages/setting.dart:159:32) E/flutter ( 6490): #4 new Future.delayed.<anonymous closure> (dart:async/future.dart:326:39)

this is my code :

translator.setNewLanguage( context, newLanguage: translator.currentLanguage == 'ar' ? 'en' : 'ar', remember: true, restart: true, );

what is the problem ??

@msayed-net msayed-net added the duplicate This issue or pull request already exists label Nov 12, 2020
@msayed-net
Copy link
Owner

This is duplicated with #13 and closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants