Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -176,6 +176,7 @@
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
107 changes: 47 additions & 60 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
const MyApp({Key key}) : super(key: key);
const MyApp({Key? key}) : super(key: key);

@override
MyAppState createState() => MyAppState();
Expand Down Expand Up @@ -93,6 +93,7 @@ class MyAppState extends State<MyApp> {
GlobalWidgetsLocalizations.delegate,
],
home: Scaffold(
backgroundColor: Colors.red,
appBar: AppBar(
title: const Text('CountryPicker Example'),
),
Expand All @@ -101,66 +102,52 @@ class MyAppState extends State<MyApp> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
CountryCodePicker(
onChanged: print,
// Initial selection and favorite can be one of code ('IT') OR dial_code('+39')
initialSelection: 'IT',
favorite: const ['+39', 'FR'],
countryFilter: const ['IT', 'FR'],
showFlagDialog: false,
comparator: (a, b) => b.name.compareTo(a.name),
//Get the country information relevant to the initial selection
onInit: (code) => debugPrint(
"on init ${code.name} ${code.dialCode} ${code.name}"),
),
CountryCodePicker(
onChanged: print,
// Initial selection and favorite can be one of code ('IT') OR dial_code('+39')
initialSelection: 'IT',
favorite: const ['+39', 'FR'],
countryFilter: const ['IT', 'FR'],
// flag can be styled with BoxDecoration's `borderRadius` and `shape` fields
flagDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(7),
),
),
const SizedBox(
width: 400,
height: 60,
child: CountryCodePicker(
onChanged: print,
hideMainText: true,
showFlagMain: true,
showFlag: false,
initialSelection: 'TF',
hideSearch: true,
showCountryOnly: true,
showOnlyCountryWhenClosed: true,
alignLeft: true,
),
),
SizedBox(
width: 400,
height: 60,
child: CountryCodePicker(
onChanged: (element) => debugPrint(element.toLongString()),
initialSelection: 'TF',
showCountryOnly: true,
showOnlyCountryWhenClosed: true,
favorite: const ['+39', 'FR'],
),
),
SizedBox(
width: 100,
height: 60,
child: CountryCodePicker(
enabled: false,
onChanged: (c) => c.name,
initialSelection: 'TF',
showCountryOnly: true,
showOnlyCountryWhenClosed: true,
favorite: const ['+39', 'FR'],
),

showCodeOnly: false,
withoutBottomSheetheight: 0.80 ,

boxDecoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(18),
border: Border.all(
color: Colors.red,

// Border color
width: 2.0, // Border width
), ),
showBottomSheetheight: 0.80,
txtFieldHintTxt: "البحث",
clickableFilepicker:true,
hideLineAbovFiled:false ,
textDirection: TextDirection.rtl,

flagDecoration:BoxDecoration(


color: Colors.white.withOpacity(0.7),
shape: BoxShape.circle, // Make the container circular
border: Border.all(color: Colors.grey)),

textStyle:TextStyle(color: Colors.black , fontWeight: FontWeight.bold , fontSize: 13),


/*flagDecoration:BoxDecoration(

color: Colors.white.withOpacity(0.7),
shape: BoxShape.circle, // Make the container circular
border: Border.all(color: Colors.grey),

),*/
onChanged: (value) {
// Handle country code change
print(value);
},
// Initial selection and favorite country
initialSelection: 'SA',
// Add Saudi Arabia to the favorites
favorite: ['+966', 'SA'],
),

],
),
),
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version: 1.0.0+1
publish_to: none

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions ios/Flutter/Generated.xcconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/bezzo/flutter
FLUTTER_APPLICATION_PATH=/Users/bezzo/Desktop/CountryCodePicker
FLUTTER_ROOT=/Users/kareem/Developer/flutter
FLUTTER_APPLICATION_PATH=/Users/kareem/Documents/KareemMacFolders/Flutter_Active_Projects/CountryCodePicker
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
Expand Down
4 changes: 2 additions & 2 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/bezzo/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/bezzo/Desktop/CountryCodePicker"
export "FLUTTER_ROOT=/Users/kareem/Developer/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/kareem/Documents/KareemMacFolders/Flutter_Active_Projects/CountryCodePicker"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
Expand Down
Loading