Code Monkey home page Code Monkey logo

Comments (13)

Eugnis avatar Eugnis commented on May 19, 2024 5

Same error with Flutter 1.9.1+hotfix.6. Updating SharedPreferences not fixed this.

from easy_localization.

damfrg avatar damfrg commented on May 19, 2024 4

Error is in saveLocale() function... in if statemente :/
Here is fix
image

from easy_localization.

pulstar avatar pulstar commented on May 19, 2024 3

I updated here, but it could not find the EasylocaLizationDelegate... I figured out the problem and is the class name, that changed from "EasylocaLizationDelegate" to "EasyLocalizationDelegate"... (notice the uppercase L position). Everything is fine now.

from easy_localization.

alectogeek avatar alectogeek commented on May 19, 2024 1

Same error on Flutter Channel master, v1.12.3-pre.10

from easy_localization.

pulstar avatar pulstar commented on May 19, 2024 1

Glad to hear about that! Hope the package at pub.dev be updated soon.

from easy_localization.

aissat avatar aissat commented on May 19, 2024 1

@pulstar it's ready
enjoying

from easy_localization.

pulstar avatar pulstar commented on May 19, 2024

I am experiencing the same problem, but my device language is correct.

E/flutter ( 5394): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: 'dart:ui/window.dart': Failed assertion: line 281: '': is not true.
E/flutter ( 5394): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:40:39)
E/flutter ( 5394): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
E/flutter ( 5394): #2 new Locale (dart:ui/window.dart:281:15)
E/flutter ( 5394): #3 _EasyLocalizationState.saveLocale. (package:easy_localization/easy_localization_provider.dart:58:24)
E/flutter ( 5394): #4 State.setState (package:flutter/src/widgets/framework.dart:1141:30)
E/flutter ( 5394): #5 _EasyLocalizationState.saveLocale (package:easy_localization/easy_localization_provider.dart:57:7)
E/flutter ( 5394):
E/flutter ( 5394): #6 _EasyLocalizationState.initState (package:easy_localization/easy_localization_provider.dart:36:5)
E/flutter ( 5394): #7 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4068:58)
E/flutter ( 5394): #8 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3919:5)
E/flutter ( 5394): #9 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter ( 5394): #10 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
E/flutter ( 5394): #11 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:998:16)
E/flutter ( 5394): #12 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:969:5)
E/flutter ( 5394): #13 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:915:17)
E/flutter ( 5394): #14 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2328:19)
E/flutter ( 5394): #15 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:914:13)
E/flutter ( 5394): #16 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:795:7)
E/flutter ( 5394): #17 runApp (package:flutter/src/widgets/binding.dart:845:7)
E/flutter ( 5394): #18 main (package:bargainer_pro/main.dart:29:3)
E/flutter ( 5394): #19 _runMainZoned.. (dart:ui/hooks.dart:229:25)
E/flutter ( 5394): #20 _rootRun (dart:async/zone.dart:1124:13)
E/flutter ( 5394): #21 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter ( 5394): #22 _runZoned (dart:async/zone.dart:1516:10)
E/flutter ( 5394): #23 runZoned (dart:async/zone.dart:1500:12)
E/flutter ( 5394): #24 _runMainZoned. (dart:ui/hooks.dart:221:5)
E/flutter ( 5394): #25 _startIsolate. (dart:isolate-patch/isolate_patch.dart:305:19)
E/flutter ( 5394): #26 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

from easy_localization.

pulstar avatar pulstar commented on May 19, 2024

This problem have something to do with SharedPreferences plug-in. I updated it to the version ^0.5.4+5 and removed the line below from my main.dart file. This solved the problem above.

SharedPreferences.setMockInitialValues({});

from easy_localization.

alectogeek avatar alectogeek commented on May 19, 2024

Looks like smth happens during creation of new Locale

image
image

from easy_localization.

alectogeek avatar alectogeek commented on May 19, 2024

Any updates here? Guys, who faced same problem, can I send my app to prod with this error?

from easy_localization.

damfrg avatar damfrg commented on May 19, 2024

|| allowed _codeLang to be null and _codeCoun was set to some value.. Replace || with && and i added extra measure _codeLang != '' to fullfill assert in Locale constructor...

from easy_localization.

dominwong4 avatar dominwong4 commented on May 19, 2024

image
I Fix it like this. but it is not a best solution if you don't have default lang

from easy_localization.

jalalonagh avatar jalalonagh commented on May 19, 2024

damfrg solution worked for me , but I don't know Why ?

from easy_localization.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.