Flutter Date Range Picker Localization (SfDateRangePicker)

By default, the SfDateRangePicker widget supports US English localizations. You can change other languages by specifying the MaterialApp properties and adding the flutter_localizations package to your application.

To use flutter_localizations, add the package as a dependency to your pubspec.yaml file.

  • DART
  • dependencies:
    flutter_localizations:
      sdk: flutter

    Next, import the flutter_localizations library and specify localizationsDelegates and supportedLocale for MaterialApp.

    import 'package:flutter_localizations/flutter_localizations.dart';
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          localizationsDelegates: [
            GlobalMaterialLocalizations.delegate,
            GlobalWidgetsLocalizations.delegate,
          ],
          supportedLocales: [
            const Locale('zh'),
            const Locale('ar'),
            const Locale('ja'),
          ],
          locale: const Locale('zh'),
          title: 'DateRangePicker Localization',
          home: Scaffold(
            appBar: AppBar(title: Text('Calendar')),
            body: SfDateRangePicker(view: DateRangePickerView.month),
          ),
        );
      }

    Localization Date Range Picker