- Improve GetPlatform: It is now possible to know which device the user is using if GetPlatform.isWeb is true.
context.responsiveValue used device orientation based on web and non-web applications. Now it checks if it is a desktop application (web or desktop application) to do the responsiveness calculation.
context.responsiveValue used device orientation based on web and non-web applications. Now it checks if it is a desktop application (web or desktop application) to do the responsiveness calculation. (@roipeker)
- Change: The documentation previously stated that Iterables should not access the ".value" property.
However, many users did not pay attention to this fact, and ended up generating unnecessary issues and bugs in their application.
In this version, we focus on code security. Now ".value" is protected, so it cannot be accessed externally by Lists, Maps or Sets.
@@ -329,29 +329,29 @@ Pass parameters to `GetMaterialApp` to define the locale and translations.
```dart
returnGetMaterialApp(
translations:Messages(),// your translations
locale:Locale('en_US'),// translations will be displayed in that locale
fallbackLocale:Locale('en_US'),// specify the fallback locale in case an invalid locale is selected.
supportedLocales:<Locale>[Locale('en_US'),Locale('de_DE')]// specify the supported locales
locale:Locale('en','US'),// translations will be displayed in that locale
fallbackLocale:Locale('en','UK'),// specify the fallback locale in case an invalid locale is selected.
supportedLocales:<Locale>[Locale('en','UK'),Locale('en','US'),Locale('de','DE')]// specify the supported locales
);
```
#### Change locale
Call `Get.updateLocale(locale)` to update the locale. Translations then automatically use the new locale.
```dart
varlocale=Locale('en_US');
varlocale=Locale('en','US');
Get.updateLocale(locale);
```
#### System locale
To read the system locale, you could use `Platform.localeName`.
To read the system locale, you could use `window.locale`.
```dart
import'dart:ui'asui;
returnGetMaterialApp(
locale:Locale(Platform.localeName),
locale:ui.window.locale,
);
```
### More details about internationalization
**See a more in-depth explanation of internationalization [here](./docs/en_US/internationalization.md)**
## Change Theme
Please do not use any higher level widget than GetMaterialApp in order to update it. This can trigger duplicate keys. A lot of people are used to the prehistoric approach of creating a "ThemeProvider" widget just to change the theme of your app, and this is definitely NOT necessary with Get.