Refs #6: use flag library

This commit is contained in:
Salvatore Giordano
2018-06-30 11:25:21 +02:00
parent 2505585404
commit 79a90cecf2
5 changed files with 325 additions and 512 deletions

View File

@@ -1,12 +1,10 @@
import 'package:flutter/foundation.dart';
/// Country element. This is the element that contains all the information
class CElement {
/// the name of the country
String name;
/// the flag of the country
String flag;
String flagUri;
/// the country code (IT,AF..)
String code;
@@ -14,18 +12,10 @@ class CElement {
/// the dial code (+39,+93..)
String dialCode;
CElement({this.name, this.flag, this.code, this.dialCode});
CElement({this.name, this.flagUri, this.code, this.dialCode});
@override
String toString() {
return defaultTargetPlatform == TargetPlatform.android
? "$flag $dialCode"
: dialCode;
}
String toString() => "$dialCode";
String toLongString() {
return defaultTargetPlatform == TargetPlatform.android
? "$flag $dialCode $name"
: "$dialCode $name";
}
String toLongString() => "$dialCode $name";
}