Reputation: 1076
Fisrt of all i am following this guide for localization which is the official guideline of flutter but at
AppLocalizations.of(context)!.helloWorld
It gives error as null
I think this is maybe because I recently updated flutter to 2.10
please confirm if that is the case
I want to achieve this kind of results like English on right and Urdu Language of Left which i don't know how to do that because in samples and guides they just show how to change overall app language not just for some strings
Also for time being, I have used easy_localization: 3.0.0
but still the problem is how i support multiple language at once with this package
Upvotes: 1
Views: 410
Reputation: 449
Example:
import 'package:flutter/material.dart' as ltr;
drawer: Directionality(
textDirection: ltr.TextDirection.ltr,
child: Container(
color: Colors.lightGreen,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('English'),
Text('عربي'),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('English'),
Text('عربي'),
],
),
],
),
),
),
Upvotes: 1