slang_flutter 3.9.0 slang_flutter: ^3.9.0 copied to clipboard
Flutter support for slang. This library provides helpful Flutter API.
slang_flutter #
This is a support package for slang.
Import this package if you develop flutter apps.
dependencies:
slang: <version>
slang_flutter: <version>
RichText #
This package enables RichText support.
BuildContext translations #
This package adds BuildContext
integration to rebuild all widgets on locale change.
// get translation instance and mark this widget for rebuild on locale change
final t = Translations.of(context);
String a = t.myTranslation;
String b = context.t.myTranslation; // build-in extensions for BuildContext
Additional API #
Some useful methods provided by this package.
// use current device locale
LocaleSettings.useDeviceLocale();
// get current device locale
AppLocale locale = AppLocaleUtils.findDeviceLocale();
// get supported locales (handy for MaterialApp)
List<Locale> locales = AppLocaleUtils.supportedLocales;