diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5cfdfbe..cb04aa4 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -33,6 +33,51 @@ const Map> localizedValues = { 'login': { 'en': 'Login', 'ar': 'تسجيل الدخول' + }, + 'deliveryInfo': { + 'en': 'Delivery information', + 'ar': 'معلومات الشحنة' + }, + 'confirmationSent': { + 'en': 'Confirmation email and SMS has been sent', + 'ar': 'تم إرسال التأكيد للبرييد الإلكتروني والرسائل النصية القصيرة' + }, + 'location': { + 'en': 'Location', + 'ar': 'الموقع' + }, + 'call': { + 'en': 'Call', + 'ar': 'اتصال' + }, + 'sms': { + 'en': 'SMS', + 'ar': 'رسالة نصية' + }, + 'packageContent': { + 'en': 'Package Content', + 'ar': 'محتوى الحزمة' + }, + 'payment': { + 'en': 'Payment', + 'ar': 'دفع' + }, + 'delivryTime': { + 'en': 'Delivery Time', + 'ar': 'وقت التوصيل' + }, + 'clientReached': { + 'en': 'Client Reached', + 'ar': 'الوصول الى العميل' + }, + 'addNoteBtn': { + 'en': 'Add Note', + 'ar': 'اضافة ملاحظة' + }, + 'nextDelivery': { + 'en': 'Next Delivery', + 'ar': 'الشحنة التالية' } + }; diff --git a/lib/pages/delivery/delivery_confirmed_page.dart b/lib/pages/delivery/delivery_confirmed_page.dart index e7af05a..32922ab 100644 --- a/lib/pages/delivery/delivery_confirmed_page.dart +++ b/lib/pages/delivery/delivery_confirmed_page.dart @@ -2,6 +2,7 @@ import 'package:driverapp/widgets/delivery/customer_brief_card.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../uitl/translations_delegate_base.dart'; import '../../widgets/others/app_scaffold_widget.dart'; class DeliveryConfirmedPage extends StatelessWidget { @@ -53,14 +54,18 @@ class DeliveryConfirmedPage extends StatelessWidget { size: 60, ), Text( - 'Delivery Confirmed', + TranslationBase + .of(context) + .deliveryInfo, style: TextStyle( color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold), ), Text( - 'Confirmation email and SMS has been sent', + TranslationBase + .of(context) + .confirmationSent, style: TextStyle( color: Colors.white, fontSize: 13, @@ -110,7 +115,9 @@ class DeliveryConfirmedPage extends StatelessWidget { color: Colors.white, ), label: Text( - 'Add Note', + TranslationBase + .of(context) + .addNoteBtn, style: TextStyle(color: Colors.white), ), onPressed: () {}, @@ -124,7 +131,9 @@ class DeliveryConfirmedPage extends StatelessWidget { side: BorderSide(color: Color(0xff41bdbb)), ), child: Text( - 'Next Delivery', + TranslationBase + .of(context) + .nextDelivery, style: TextStyle(color: Colors.white), ), onPressed: () {}, diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart index 16e4852..1604d95 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -5,6 +5,7 @@ import 'package:driverapp/widgets/delivery/package_content.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../uitl/translations_delegate_base.dart'; import '../../widgets/others/app_scaffold_widget.dart'; class InformationPage extends StatelessWidget { @@ -43,7 +44,9 @@ class InformationPage extends StatelessWidget { ), Container( child: Text( - 'Delivery information', + TranslationBase + .of(context) + .deliveryInfo, style: TextStyle( color: Colors.white, fontSize: 20, @@ -84,7 +87,9 @@ class InformationPage extends StatelessWidget { size: 30, color: Colors.white, ), - btnName: 'Location', + btnName: TranslationBase + .of(context) + .location, btnFunction: () {}, ), delivery_info_button( @@ -104,7 +109,9 @@ class InformationPage extends StatelessWidget { size: 30, color: Colors.white, ), - btnName: 'SMS', + btnName: TranslationBase + .of(context) + .sms, btnFunction: () {}, ), delivery_info_button( @@ -114,7 +121,9 @@ class InformationPage extends StatelessWidget { size: 30, color: Colors.white, ), - btnName: 'Call', + btnName: TranslationBase + .of(context) + .call, btnFunction: () {}, ), ], @@ -128,7 +137,9 @@ class InformationPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - 'Package Content', + TranslationBase + .of(context) + .packageContent, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20), @@ -186,7 +197,9 @@ class InformationPage extends StatelessWidget { side: BorderSide(color: Color(0xff41bdbb)), ), child: Text( - 'Client Reached', + TranslationBase + .of(context) + .clientReached, style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 400292e..5889d84 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -52,6 +52,33 @@ class TranslationBase { String get enterCredentialsMsg => localizedValues['enterCredentialsMsg'][locale.languageCode]; String get forgotPassword => localizedValues['forgotPassword'][locale.languageCode]; String get login => localizedValues['login'][locale.languageCode]; + + String get deliveryInfo => + localizedValues['deliveryInfo'][locale.languageCode]; + + String get location => localizedValues['location'][locale.languageCode]; + + String get call => localizedValues['call'][locale.languageCode]; + + String get sms => localizedValues['sms'][locale.languageCode]; + + String get packageContent => + localizedValues['packageContent'][locale.languageCode]; + + String get payment => localizedValues['payment'][locale.languageCode]; + + String get delivryTime => localizedValues['delivryTime'][locale.languageCode]; + + String get clientReached => + localizedValues['clientReached'][locale.languageCode]; + + String get addNoteBtn => localizedValues['addNoteBtn'][locale.languageCode]; + + String get nextDelivery => + localizedValues['nextDelivery'][locale.languageCode]; + + String get confirmationSent => + localizedValues['confirmationSent'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/delivery/customer_brief_card.dart b/lib/widgets/delivery/customer_brief_card.dart index a7dbaf8..7b2fce5 100644 --- a/lib/widgets/delivery/customer_brief_card.dart +++ b/lib/widgets/delivery/customer_brief_card.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; +import '../../uitl/translations_delegate_base.dart'; + class CustomerBrief extends StatelessWidget { final int itemId; final String time; @@ -109,7 +111,9 @@ class CustomerBrief extends StatelessWidget { Row( children: [ Text( - 'payment', + TranslationBase + .of(context) + .payment, ), SizedBox( width: 170, @@ -125,7 +129,11 @@ class CustomerBrief extends StatelessWidget { ), Row( children: [ - Text('Delivery Time'), + Text( + TranslationBase + .of(context) + .delivryTime, + ), SizedBox( width: 50, ),