Git Product home page Git Product logo

Comments (6)

erperejildo avatar erperejildo commented on June 6, 2024 1

https://zapp.run/edit/flutter-z7ec06l27ed0?entry=lib/main.dart&file=assets/i18n/en.json:59-105

@erperejildo - can you reproduce this issue in a sample project? I will take a look.

https://zapp.run/edit/flutter-z7ec06l27ed0?entry=lib/main.dart&file=lib/options.dart

Here is a working example and you can find the fixes below:

https://zapp.run/edit/flutter-zwek06ldwel0?entry=lib/main.dart&file=lib/main.dart

  1. You need to wrap the MaterialApp into a LocalizationProvider:
 return LocalizationProvider(
      state: LocalizationProvider.of(context).state,
      child:  MaterialApp(
        title: 'Flutter App!!',
        locale: localizationDelegate.currentLocale,
  1. MyHomePage should not be a constant

home: MyHomePage(title: 'Flutter Example App'),

instead of

home: const MyHomePage(title: 'Flutter Example App'),

Forgot to wrap it in the example but what I had in my code was the const since it was suggesting me to add it. Thanks, working now

from flutter_translate.

stale avatar stale commented on June 6, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from flutter_translate.

erperejildo avatar erperejildo commented on June 6, 2024

still having the same problem

from flutter_translate.

bratan avatar bratan commented on June 6, 2024

@erperejildo - can you reproduce this issue in a sample project? I will take a look.

from flutter_translate.

erperejildo avatar erperejildo commented on June 6, 2024

@erperejildo - can you reproduce this issue in a sample project? I will take a look.

https://zapp.run/edit/flutter-z7ec06l27ed0?entry=lib/main.dart&file=lib/options.dart

from flutter_translate.

bratan avatar bratan commented on June 6, 2024

@erperejildo - can you reproduce this issue in a sample project? I will take a look.

https://zapp.run/edit/flutter-z7ec06l27ed0?entry=lib/main.dart&file=lib/options.dart

Here is a working example and you can find the fixes below:

https://zapp.run/edit/flutter-zwek06ldwel0?entry=lib/main.dart&file=lib/main.dart

  1. You need to wrap the MaterialApp into a LocalizationProvider:
 return LocalizationProvider(
      state: LocalizationProvider.of(context).state,
      child:  MaterialApp(
        title: 'Flutter App!!',
        locale: localizationDelegate.currentLocale,
  1. MyHomePage should not be a constant

home: MyHomePage(title: 'Flutter Example App'),

instead of

home: const MyHomePage(title: 'Flutter Example App'),

from flutter_translate.

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.