Translation updates

merge-requests/2/head
haroon amjad 4 years ago
parent 1554a6bdf5
commit 9842c3a0b1

@ -12,5 +12,25 @@ const Map<String, Map<String, String>> localizedValues = {
'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'},
'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'},
'bookAppo': {'en': 'Book Appointment', 'ar': 'حجز موعد'},
'searchBy': {'en': 'Search By:', 'ar': 'البحث عن طريق:'},
'clinic': {'en': 'Clinic', 'ar': 'العيادة'},
'name': {'en': 'Name', 'ar': 'الإسم'},
'doctor': {'en': 'Doctor', 'ar': 'الطبيب'},
'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'},
'doctorName': {'en': 'Doctor Name', 'ar': 'إسم الطبيب'},
'nearestAppo': {'en': 'Nearest appointment', 'ar': 'أقرب موعد'},
'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'},
'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'},
'search': {'en': 'Search', 'ar': 'بحث'},
'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'},
'docInfo': {'en': 'Doctor Information', 'ar': 'معلومات الطبيب'},
'appoInfo': {'en': 'Appointment Information', 'ar': 'معلومات الموعد'},
'availableAppo': {'en': 'Available Appointments', 'ar': 'المواعيد المتاحة'},
'gender': {'en': 'Gender', 'ar': 'الجنس'},
'nationality': {'en': 'nationality', 'ar': 'الجنسية'},
'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'},
'confirmAppoHeading': {'en': 'Kindly confirm your Appointment', 'ar': 'يرجى تأكيد موعدك'},
'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'},
};

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
@ -13,7 +14,7 @@ class _BookConfirmState extends State<BookConfirm> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Book Appointment"),
title: Text(TranslationBase.of(context).bookAppo),
),
body: SingleChildScrollView(
child: Container(
@ -25,7 +26,7 @@ class _BookConfirmState extends State<BookConfirm> {
Container(
margin: EdgeInsets.only(bottom: 5.0),
alignment: Alignment.center,
child: Text("Kindly Confirm your Appointment",
child: Text(TranslationBase.of(context).confirmAppoHeading,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 22.0,
@ -36,7 +37,7 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.only(top: 15.0),
child: Text("Doctor Information",
child: Text(TranslationBase.of(context).docInfo,
style: TextStyle(
fontSize: 22.0,
color: Colors.black,
@ -116,7 +117,7 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.only(top: 15.0),
child: Text("Appointment Information",
child: Text(TranslationBase.of(context).appoInfo,
style: TextStyle(
fontSize: 22.0,
color: Colors.black,
@ -216,7 +217,7 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.only(top: 15.0),
child: Text("Patient Information",
child: Text(TranslationBase.of(context).patientInfo,
style: TextStyle(
fontSize: 22.0,
color: Colors.black,
@ -299,7 +300,7 @@ class _BookConfirmState extends State<BookConfirm> {
onPressed: () {
navigateToBookSuccess(context);
},
child: Text('BOOK NOW', style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)),
),
),
),

@ -1,17 +1,19 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/CardCommon.dart';
import 'package:flutter/material.dart';
import '../../uitl/translations_delegate_base.dart';
class BookingOptions extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Book Appointment")),
appBar: AppBar(title: Text(TranslationBase.of(context).bookAppo)),
body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Search By:",
Text(TranslationBase.of(context).searchBy,
style: TextStyle(
fontSize: 24.0,
letterSpacing: 1.0,
@ -27,15 +29,15 @@ class BookingOptions extends StatelessWidget {
child: CardCommon(
image:
'assets/images/new-design/search_by_clinic.png',
text: "Clinic",
subText: "Name"),
text: TranslationBase.of(context).clinic,
subText: TranslationBase.of(context).name),
),
Expanded(
child: CardCommon(
image:
'assets/images/new-design/search_by_doctor.png',
text: "Doctor",
subText: "Name"),
text: TranslationBase.of(context).doctor,
subText: TranslationBase.of(context).name),
)
],
),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
@ -25,7 +26,7 @@ class _DoctorProfileState extends State<DoctorProfile>
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Book Appointment"),
title: Text(TranslationBase.of(context).bookAppo),
actions: <Widget>[
IconButton(
icon: Icon(
@ -58,7 +59,7 @@ class _DoctorProfileState extends State<DoctorProfile>
navigateToBookConfirm(context);
},
child:
Text('BOOK NOW', style: TextStyle(fontSize: 18.0)),
Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)),
),
),
)
@ -136,7 +137,6 @@ class _DoctorProfileState extends State<DoctorProfile>
),
),
TabBar(
indicatorColor: new Color(0xFFc5272d),
onTap: (index) {
setState(() {
index == 1
@ -147,10 +147,10 @@ class _DoctorProfileState extends State<DoctorProfile>
},
tabs: [
Tab(
child: Text("Doctor Information",
child: Text(TranslationBase.of(context).docInfo,
style: TextStyle(color: Colors.black))),
Tab(
child: Text("Available Appointments",
child: Text(TranslationBase.of(context).availableAppo,
style: TextStyle(color: Colors.black)),
)
],

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
class Search extends StatefulWidget {
@ -22,14 +23,14 @@ class _SearchState extends State<Search> with SingleTickerProviderStateMixin {
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(text: "Clinic Name"),
Tab(text: TranslationBase.of(context).clinicName),
Tab(
text: "Doctor Name",
text: TranslationBase.of(context).doctorName,
)
],
controller: _tabController,
),
title: Text("Book Appointment"),
title: Text(TranslationBase.of(context).bookAppo),
),
body: TabBarView(children: [
SearchByClinic(),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'widgets/DoctorView.dart';
@ -7,7 +8,7 @@ class SearchResults extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Book Appointment"),
title: Text(TranslationBase.of(context).bookAppo),
),
body: Container(
child: SingleChildScrollView(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
class DoctorInformation extends StatelessWidget {
@ -24,7 +25,7 @@ class DoctorInformation extends StatelessWidget {
"assets/images/new-design/doctor_information_icon.png"),
Container(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: Text("Doctor Information",
child: Text(TranslationBase.of(context).docInfo,
style:
TextStyle(fontSize: 16.0, letterSpacing: 0.8)),
),
@ -36,8 +37,8 @@ class DoctorInformation extends StatelessWidget {
child: Table(
children: [
TableRow(children: [
TableCell(child: _getHeadingText("Gender")),
TableCell(child: _getHeadingText("Nationality")),
TableCell(child: _getHeadingText(TranslationBase.of(context).gender)),
TableCell(child: _getHeadingText(TranslationBase.of(context).nationality)),
]),
TableRow(children: [
TableCell(child: _getNormalText("Male")),
@ -54,7 +55,7 @@ class DoctorInformation extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_getHeadingText("Clinic"),
_getHeadingText(TranslationBase.of(context).clinic),
_getNormalText("INTERNAL MEDICINE CLINIC")
],
),
@ -79,7 +80,7 @@ class DoctorInformation extends StatelessWidget {
"assets/images/new-design/doctor_qualification_icon.png"),
Container(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: Text("Doctor Qualifications",
child: Text(TranslationBase.of(context).docQualifications,
style:
TextStyle(fontSize: 16.0, letterSpacing: 0.8)),
),
@ -91,7 +92,7 @@ class DoctorInformation extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_getHeadingText("Clinic"),
_getHeadingText(TranslationBase.of(context).clinic),
_getNormalText("INTERNAL MEDICINE CLINIC")
],
),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
class SearchByClinic extends StatefulWidget {
@ -27,7 +28,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
});
},
),
Text('Nearest Appointment',
Text(TranslationBase.of(context).nearestAppo,
style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
],
),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import '../SearchResults.dart';
@ -26,7 +27,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 10.0, bottom: 15.0),
child: Text("Type the name of the doctor to help you find him",
child: Text(TranslationBase.of(context).searchByDocText,
style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
),
Container(
@ -37,7 +38,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
_onDocTextChanged(content);
},
decoration: InputDecoration(
labelText: "Type Doctor Name",
labelText: TranslationBase.of(context).enterDocName,
fillColor: Colors.white,
prefixIcon: Icon(Icons.search),
border: OutlineInputBorder())),
@ -66,7 +67,8 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: _isButtonDisabled ? null : _searchDoctor,
child: Text('Search', style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).search,
style: TextStyle(fontSize: 18.0)),
),
);
}
@ -86,27 +88,11 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}
void _searchDoctor() {
// if (doctorNameController.text != "")
// print(doctorNameController.text);
navigateToSearchResults(context);
// else
// print("Empty");
}
Future navigateToSearchResults(context) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => SearchResults()));
}
_isDoctorNameValid() {
if (doctorNameController.text != null || doctorNameController.text != "") {
if (doctorNameController.text.length >= 4) {
return true;
} else {
return false;
}
} else {
return false;
}
}
}

@ -99,7 +99,7 @@ class DateUtil {
return getMonth(dateTime.month) +
" " +
dateTime.day.toString() +
"," +
", " +
dateTime.year.toString();
else
return "";

@ -40,7 +40,43 @@ class TranslationBase {
String get bookAppo => localizedValues['bookAppo'][locale.languageCode];
String get searchBy => localizedValues['searchBy'][locale.languageCode];
String get clinic => localizedValues['clinic'][locale.languageCode];
String get name => localizedValues['name'][locale.languageCode];
String get doctor => localizedValues['doctor'][locale.languageCode];
String get clinicName => localizedValues['clinicName'][locale.languageCode];
String get doctorName => localizedValues['doctorName'][locale.languageCode];
String get nearestAppo => localizedValues['nearestAppo'][locale.languageCode];
String get searchByDocText => localizedValues['searchByDocText'][locale.languageCode];
String get enterDocName => localizedValues['enterDocName'][locale.languageCode];
String get search => localizedValues['search'][locale.languageCode];
String get bookNow => localizedValues['bookNow'][locale.languageCode];
String get docInfo => localizedValues['docInfo'][locale.languageCode];
String get appoInfo => localizedValues['appoInfo'][locale.languageCode];
String get availableAppo => localizedValues['availableAppo'][locale.languageCode];
String get gender => localizedValues['gender'][locale.languageCode];
String get nationality => localizedValues['nationality'][locale.languageCode];
String get docQualifications => localizedValues['docQualifications'][locale.languageCode];
String get confirmAppoHeading => localizedValues['confirmAppoHeading'][locale.languageCode];
String get patientInfo => localizedValues['patientInfo'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save