Skip to content

Commit

Permalink
change language fade and slide transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemix committed Jun 22, 2018
1 parent 3e8b73e commit 4ecb95e
Show file tree
Hide file tree
Showing 10 changed files with 314 additions and 203 deletions.
37 changes: 0 additions & 37 deletions lib/_i18n/translations.dart

This file was deleted.

18 changes: 16 additions & 2 deletions lib/app_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class AppColors {
static var primaryTextColor =
violetRedColor; // <color name="crimson">#DD153D</color>
static var secondaryTextColor =
armadilloColor; // <color name="scarlett">#802028</color>
rajahBlue; // <color name="scarlett">#802028</color>
static var tertiaryTextColor = stormGrayColor;

static var accentColor =
new Color(0xFFD36A76); // <color name="fuzzy_wuzzy_brown">#D36A76</color>
tangerineColor; // <color name="fuzzy_wuzzy_brown">#D36A76</color>
static var almondColor =
new Color(0xFFEFDDCC); // <color name="almond">#EFDDCC</color>
static var rodeoDustColor =
Expand Down Expand Up @@ -58,4 +58,18 @@ class AppColors {

static var violetRedColor =
new Color(0xFFF55B9A); // <color name="violet_red">#F55B9A</color>

static var rajahBlue =
new Color(0xFFF9B16E); // <color name="rajah">#F9B16E</color>

static var curiousBlue =
new Color(0xFF358ABD); // <color name="curious_blue">#358ABD</color>

static var moodyBlueColor =
new Color(0xFF7E78D8); // <color name="moody_blue">#7E78D8</color>

static var tangerineColor =
new Color(0xFFF2D200); // <color name="tangerine">#F2D200</color>


}
20 changes: 10 additions & 10 deletions lib/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ List<Destination> getDestinations() {
price: 650,
numDays: 8,
airlines: 'Turkish Airlines',
airlnesAr: 'الخطوط الجوية التركية',
airlinesAr: 'الخطوط الجوية التركية',
food: 'Breakfast and dinner',
foodAr: 'فطور و عشاء',
hotelStars: 5,
Expand Down Expand Up @@ -50,7 +50,7 @@ List<Destination> getDestinations() {
price: 900,
numDays: 7,
airlines: 'Turkish Airlines',
airlnesAr: 'الخطوط الجوية التركية',
airlinesAr: 'الخطوط الجوية التركية',
food: 'Breakfast',
foodAr: 'فطور',
hotelStars: 4,
Expand Down Expand Up @@ -102,7 +102,7 @@ List<Destination> getDestinations() {
price: 780,
numDays: 10,
airlines: 'Iraqi Airlines (Charter)',
airlnesAr: 'الخطوط الجوية العراقية (چارتر)',
airlinesAr: 'الخطوط الجوية العراقية (چارتر)',
food: 'Breakfast',
foodAr: 'فطور',
hotelStars: 5,
Expand Down Expand Up @@ -155,7 +155,7 @@ List<Destination> getDestinations() {
price: 1850,
numDays: 5,
airlines: 'Iraqi Airlines (Charter)',
airlnesAr: 'الخطوط الجوية العراقية (چارتر)',
airlinesAr: 'الخطوط الجوية العراقية (چارتر)',
food: 'Breakfast and dinner',
foodAr: 'فطور و عشاء',
hotelStars: 4,
Expand Down Expand Up @@ -191,7 +191,7 @@ List<Destination> getDestinations() {
price: 700,
numDays: 10,
airlines: 'Iraqi Airlines (Charter)',
airlnesAr: 'الخطوط الجوية العراقية (چارتر)',
airlinesAr: 'الخطوط الجوية العراقية (چارتر)',
food: 'Breakfast and dinner',
foodAr: 'فطور و عشاء',
hotelStars: 4,
Expand Down Expand Up @@ -228,7 +228,7 @@ List<Destination> getDestinations() {
price: 1100,
numDays: 12,
airlines: 'Royal Jordanian',
airlnesAr: 'الملكية الاردنية',
airlinesAr: 'الملكية الاردنية',
food: 'Breakfast and dinner',
foodAr: 'فطور و عشاء',
hotelStars: 5,
Expand Down Expand Up @@ -264,7 +264,7 @@ List<Destination> getDestinations() {
price: 550,
numDays: 8,
airlines: 'Iraqi Airlines',
airlnesAr: 'الخطوط الجوية العراقية',
airlinesAr: 'الخطوط الجوية العراقية',
food: 'Breakfast, launch, and dinner',
foodAr: 'فطور و غداء و عشاء',
hotelStars: 7,
Expand Down Expand Up @@ -301,7 +301,7 @@ List<Destination> getDestinations() {
price: 550,
numDays: 8,
airlines: 'الخطوط الجوية العراقية',
airlnesAr: 'Middle East Airlines',
airlinesAr: 'Middle East Airlines',
food: 'Breakfast, launch, and dinner',
foodAr: 'فطور و غداء و عشاء',
hotelStars: 5,
Expand Down Expand Up @@ -347,7 +347,7 @@ List<Destination> getDestinations() {
price: 1750,
numDays: 14,
airlines: 'Middle East Airlines',
airlnesAr: 'خطوط الشرق الاوسط اللبنانية',
airlinesAr: 'خطوط الشرق الاوسط اللبنانية',
food: 'Breakfast, launch, and dinner',
foodAr: 'فطور و غداء و عشاء',
hotelStars: 5,
Expand Down Expand Up @@ -393,7 +393,7 @@ List<Destination> getDestinations() {
price: 1350,
numDays: 14,
airlines: 'Iraqi Airlines',
airlnesAr: 'الخطوط الجوية العراقية',
airlinesAr: 'الخطوط الجوية العراقية',
food: 'Breakfast',
foodAr: 'فطور',
hotelStars: 10,
Expand Down
57 changes: 57 additions & 0 deletions lib/internationalizations/translations.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

import 'package:flutter/widgets.dart';

class Translations {
Translations(this.locale);

final Locale locale;

static Translations of(BuildContext context) {
return Localizations.of<Translations>(context, Translations);
}

static Map<String, Map<String, String>> _localizedValues = {
'en': {
'title': 'Tourism Demo',
'language': 'عربي',
'june': 'June',
'days': 'Days',
'hotels': 'hotels',
'star': 'star',
},
'ar': {
'title': 'تطبيق سياحة',
'language': 'English',
'june': 'حزيران',
'days': 'أيام',
'star': 'نجوم',
'hotels': 'فنادق',
},
};

Map get _vocabularies => _localizedValues[locale.languageCode];

String get title {
return _vocabularies['title'];
}

String get language {
return _vocabularies['language'];
}

String get june {
return _vocabularies['june'];
}

String get days {
return _vocabularies['days'];
}

String get hotels {
return _vocabularies['hotels'];
}

String get star {
return _vocabularies['star'];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';

import 'package:flutter/widgets.dart';
import 'package:flutter/foundation.dart' show SynchronousFuture;
import 'package:tourism_demo/_i18n/translations.dart';
import 'package:tourism_demo/internationalizations/translations.dart';

class TranslationsDelegate
extends LocalizationsDelegate<Translations> {
Expand Down
Loading

0 comments on commit 4ecb95e

Please sign in to comment.