How to Implement Localization for Azure Adb2c (Custom Policy) In flutter (dart)?

Viewed 105

I am trying to implement a localization for Azure Adb2c in Flutter, in angular localization is implemented using ui_locales = language in configuration, I can't achive this in Flutter aad_oauth. Is there any other ways to implement this?

1 Answers

To add localization in flutter, By default Flutter only provides US English localizations. To add support for other languages, an application must specify additional MaterialApp (or CupertinoApp) properties, and include a package called flutter_localizations To use flutter_localizations, add the package as a dependency to your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations: 
    sdk: flutter  

  

Next, run pub get packages, then import the flutter_localizations library and specify localizationsDelegates and supportedLocales for MaterialApp:

import 'package:flutter_localizations/flutter_localizations.dart';

and then add your code. If you want to use your own localized messages first add the flutter_localizations and then Add the intl package to the pubspec.yaml file:

Related