get clinic list after changing the language

merge-requests/146/head
hussam al-habibeh 4 years ago
parent 629ccbeda8
commit aa57f4c4d7

@ -213,5 +213,7 @@ const Map<String, Map<String, String>> localizedValues = {
},
'livecare': {'en': 'Live Care', 'ar': 'Live Care'},
'beingBad': {'en': 'being bad', 'ar': 'سيء'},
'beingGreat': {'en': 'being great', 'ar': 'راثع'},
'beingGreat': {'en': 'being great', 'ar': 'رائع'},
'cancel': {'en': 'CANCEL', 'ar': 'الغاء'},
'done': {'en': 'DONE', 'ar': 'تأكيد'},
};

@ -72,10 +72,15 @@ class ProjectProvider with ChangeNotifier {
currentLanguage = 'en';
sharedPref.setString(APP_Language, 'en');
}
getProfile();
callServicesAfterChangeLang();
notifyListeners();
}
callServicesAfterChangeLang() {
getProfile();
getClinicNames();
}
@override
void dispose() {
if (subscription != null) subscription.cancel();

@ -61,6 +61,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
_isInit = false;
}
BuildContext myContext;
GlobalKey _one = GlobalKey();
@ -101,7 +102,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
alignment: Alignment.centerLeft,
alignment: projectsProvider.isArabic
? Alignment.topRight
: Alignment.topLeft,
),
),
Row(
@ -112,6 +115,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
InkWell(
onTap: () {
showCupertinoPicker(
decKey: '',
context: context,
actionList: projectsProvider.clinicList);
},
@ -310,7 +314,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
TranslationBase.of(context).patientServices,
fontWeight: FontWeight.bold,
),
alignment: Alignment.centerLeft,
alignment: projectsProvider.isArabic
? Alignment.topRight
: Alignment.topLeft,
),
),
Expanded(
@ -538,19 +544,17 @@ class _DashboardScreenState extends State<DashboardScreen> {
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
CupertinoButton(
child: Text(
'Cancel'.toUpperCase(),
// style: TextStyle(context)
),
child: Text(TranslationBase.of(context).cancel
// style: TextStyle(context)
),
onPressed: () {
Navigator.pop(context);
},
),
CupertinoButton(
child: Text(
'Done'.toUpperCase(),
// style: textStyle(context),
),
child: Text(TranslationBase.of(context).done
// style: textStyle(context),
),
onPressed: () {
Navigator.pop(context);
// onSelectFun(cupertinoPickerIndex);
@ -564,14 +568,19 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Color(0xfff7f7f7),
child: Column(
children: actionList
.map((e) => Container(
child: InkWell(
onTap: () =>
changeClinic(e.clinicID, context),
child: Text(
e.clinicName,
style: TextStyle(fontSize: 15),
)),
.map((e) => Flexible(
child: Container(
child: InkWell(
onTap: () =>
changeClinic(e.clinicID, context),
child: Text(
e.clinicName ?? 'asd',
style: TextStyle(
fontSize:
SizeConfig.textMultiplier *
1.9),
)),
),
))
.toList(),
))

@ -11,6 +11,7 @@ import '../util/dr_app_toast_msg.dart';
import 'package:connectivity/connectivity.dart';
import 'dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -51,7 +52,7 @@ class Helpers {
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
CupertinoButton(
child: Text('Cancel'.toUpperCase(),
child: Text(TranslationBase.of(context).cancel,
style: textStyle(context)),
onPressed: () {
Navigator.pop(context);
@ -59,7 +60,7 @@ class Helpers {
),
CupertinoButton(
child: Text(
'Done'.toUpperCase(),
TranslationBase.of(context).done,
style: textStyle(context),
),
onPressed: () {

@ -233,6 +233,8 @@ class TranslationBase {
String get livecare => localizedValues['livecare'][locale.languageCode];
String get beingBad => localizedValues['beingBad'][locale.languageCode];
String get beingGreat => localizedValues['beingGreat'][locale.languageCode];
String get cancel => localizedValues['cancel'][locale.languageCode];
String get done => localizedValues['done'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save