add translate to delivery branch.

logut
enadhilal 5 years ago
parent de394ec807
commit 4d5b10e90b

@ -33,6 +33,51 @@ const Map<String, Map<String, String>> 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': 'الشحنة التالية'
}
};

@ -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: () {},

@ -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: <Widget>[
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,

@ -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<TranslationBase> {

@ -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: <Widget>[
Text(
'payment',
TranslationBase
.of(context)
.payment,
),
SizedBox(
width: 170,
@ -125,7 +129,11 @@ class CustomerBrief extends StatelessWidget {
),
Row(
children: <Widget>[
Text('Delivery Time'),
Text(
TranslationBase
.of(context)
.delivryTime,
),
SizedBox(
width: 50,
),

Loading…
Cancel
Save