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

3,197

Solution 1

import the namespace as below and use the alias name

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

Solution 2

import 'dart:ui' as ui;

..

textDirection: ui.TextDirection.ltr, 
Share:
3,197
javad bat
Author by

javad bat

love to design and develop web component and design interaction simple as it could be

Updated on December 04, 2022

Comments

  • javad bat
    javad bat over 1 year

    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?