Search code examples
flutterright-to-left

flutter RTL syntax error with "package:intl/intl.dart"


Hi i recently try to use a date Picker for flutter and i didn't find any Doc or tutorial for it so i open flutter gallery project and try to copy code . as following the code i import "package:intl/intl.dart" library . after that in main.dart build function:

  Widget build(BuildContext context) {
return new MaterialApp(
    title: 'Welcome to Flutter',
    theme: new ThemeData.light(),
    home: new InitiateAppPage(),
    builder: (BuildContext context, Widget child) {
      return new Directionality(
        textDirection: TextDirection.rtl,
        child: child,
      );
    },
    );   }

Element 'TextDirection' from SDK library 'ui.dart' is implicitly hidden by 'intl.dart'. any solution for this problem?


Solution

  • import the namespace as below and use the alias name

    import 'package:intl/intl.dart' as intl;