Translation updates

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

@ -12,5 +12,25 @@ const Map<String, Map<String, String>> localizedValues = {
'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'}, 'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'},
'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'},
'bookAppo': {'en': 'Book Appointment', '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:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
@ -13,7 +14,7 @@ class _BookConfirmState extends State<BookConfirm> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text("Book Appointment"), title: Text(TranslationBase.of(context).bookAppo),
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
@ -25,7 +26,7 @@ class _BookConfirmState extends State<BookConfirm> {
Container( Container(
margin: EdgeInsets.only(bottom: 5.0), margin: EdgeInsets.only(bottom: 5.0),
alignment: Alignment.center, alignment: Alignment.center,
child: Text("Kindly Confirm your Appointment", child: Text(TranslationBase.of(context).confirmAppoHeading,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 22.0, fontSize: 22.0,
@ -36,7 +37,7 @@ class _BookConfirmState extends State<BookConfirm> {
), ),
Container( Container(
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 15.0),
child: Text("Doctor Information", child: Text(TranslationBase.of(context).docInfo,
style: TextStyle( style: TextStyle(
fontSize: 22.0, fontSize: 22.0,
color: Colors.black, color: Colors.black,
@ -116,7 +117,7 @@ class _BookConfirmState extends State<BookConfirm> {
), ),
Container( Container(
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 15.0),
child: Text("Appointment Information", child: Text(TranslationBase.of(context).appoInfo,
style: TextStyle( style: TextStyle(
fontSize: 22.0, fontSize: 22.0,
color: Colors.black, color: Colors.black,
@ -216,7 +217,7 @@ class _BookConfirmState extends State<BookConfirm> {
), ),
Container( Container(
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 15.0),
child: Text("Patient Information", child: Text(TranslationBase.of(context).patientInfo,
style: TextStyle( style: TextStyle(
fontSize: 22.0, fontSize: 22.0,
color: Colors.black, color: Colors.black,
@ -299,7 +300,7 @@ class _BookConfirmState extends State<BookConfirm> {
onPressed: () { onPressed: () {
navigateToBookSuccess(context); 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:diplomaticquarterapp/pages/BookAppointment/widgets/CardCommon.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../uitl/translations_delegate_base.dart';
class BookingOptions extends StatelessWidget { class BookingOptions extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: Text("Book Appointment")), appBar: AppBar(title: Text(TranslationBase.of(context).bookAppo)),
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text("Search By:", Text(TranslationBase.of(context).searchBy,
style: TextStyle( style: TextStyle(
fontSize: 24.0, fontSize: 24.0,
letterSpacing: 1.0, letterSpacing: 1.0,
@ -27,15 +29,15 @@ class BookingOptions extends StatelessWidget {
child: CardCommon( child: CardCommon(
image: image:
'assets/images/new-design/search_by_clinic.png', 'assets/images/new-design/search_by_clinic.png',
text: "Clinic", text: TranslationBase.of(context).clinic,
subText: "Name"), subText: TranslationBase.of(context).name),
), ),
Expanded( Expanded(
child: CardCommon( child: CardCommon(
image: image:
'assets/images/new-design/search_by_doctor.png', 'assets/images/new-design/search_by_doctor.png',
text: "Doctor", text: TranslationBase.of(context).doctor,
subText: "Name"), subText: TranslationBase.of(context).name),
) )
], ],
), ),

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

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

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

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

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class SearchByClinic extends StatefulWidget { 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)), 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 'package:flutter/material.dart';
import '../SearchResults.dart'; import '../SearchResults.dart';
@ -26,7 +27,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(top: 10.0, bottom: 15.0), 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)), style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
), ),
Container( Container(
@ -37,7 +38,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
_onDocTextChanged(content); _onDocTextChanged(content);
}, },
decoration: InputDecoration( decoration: InputDecoration(
labelText: "Type Doctor Name", labelText: TranslationBase.of(context).enterDocName,
fillColor: Colors.white, fillColor: Colors.white,
prefixIcon: Icon(Icons.search), prefixIcon: Icon(Icons.search),
border: OutlineInputBorder())), border: OutlineInputBorder())),
@ -66,7 +67,8 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: _isButtonDisabled ? null : _searchDoctor, 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() { void _searchDoctor() {
// if (doctorNameController.text != "")
// print(doctorNameController.text);
navigateToSearchResults(context); navigateToSearchResults(context);
// else
// print("Empty");
} }
Future navigateToSearchResults(context) async { Future navigateToSearchResults(context) async {
Navigator.push( Navigator.push(
context, MaterialPageRoute(builder: (context) => SearchResults())); 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) + return getMonth(dateTime.month) +
" " + " " +
dateTime.day.toString() + dateTime.day.toString() +
"," + ", " +
dateTime.year.toString(); dateTime.year.toString();
else else
return ""; return "";

@ -40,7 +40,43 @@ class TranslationBase {
String get bookAppo => localizedValues['bookAppo'][locale.languageCode]; 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> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save