0

i want to change text direction of whole app right to left

my main code is :

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
   return ChangeNotifierProvider(

       create: (context)=>HomeModel(),

       child: MaterialApp(


        debugShowCheckedModeBanner: false,


         home: Directionality(
         textDirection:
         TextDirection.rtl,
             child: FirstScreen()),
      
          ));
        }

  }

but only first screen view is right to left and when navigate to second page again it is from left to right .

sara s
  • 69
  • 1
  • 8
  • 1
    Read the [TextDirection-class documentation](https://api.flutter.dev/flutter/dart-ui/TextDirection-class.html) on design discussion. You must use `Directionality.of(context)` to extract directionality in another context. – Chance May 08 '21 at 14:10
  • Chance i read this part but did not understand what should i do. can u write code please – sara s May 08 '21 at 14:59
  • can you try tapping into theme data property and change this property using copywith ? – Krish Bhanushali May 08 '21 at 15:16
  • I was going to answer the question, but I already have a similar [answer](https://stackoverflow.com/questions/50535185/right-to-left-rtl-in-flutter) here. – Chance May 08 '21 at 16:38
  • i read that question before. my problem is that just first page direction changes not whole app direction – sara s May 09 '21 at 06:31

0 Answers0