From 7b16a2bfe7c83a45ad0e40f7e1e70833c3d32f7a Mon Sep 17 00:00:00 2001 From: Ibrahem Sayed <is1394@fayoum.edu.eg> Date: Thu, 9 Jan 2025 12:19:12 +0200 Subject: [PATCH 1/8] Update Syria Flag --- assets/flags/sy.png | Bin 480 -> 650 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/flags/sy.png b/assets/flags/sy.png index 45655a59fb88173e5ada90683e78a05369617584..4a91c45679451ff00f148dfa128b9be336f39ee2 100644 GIT binary patch literal 650 zcmeAS@N?(olHy`uVBq!ia0vp^=|F7H!3HG%&bgKhq&N#aB8wRqxP?HN@zUM8KMV{^ zHl8kyAr*7p&NB3qc9dwnFEvLZn@d|mC`9kTyM>E3RsUvK=*cH=F;Io|_GB)p6$={K z_!7Q<WBkUnP+o;)lIxQjU15I0(VP{W8R>1|d)9x>F!{glXIa|uIQQ(`(ZU>FT<dEY zm84H9x)pUylu1%)mmr$C=w!+w`-%yRraJdL5m2@~;=yMa_jJiMrLEV}JL@IXJvT%t zZmOJGTwm4n`?BzS)wCto9+f>W-Y{Fy#Vo%lDBJK&nZcW~CZ8K6i=6K8EZkH%(b!Lj zhmSvPK6^X+y=`-@MD_f#<=HLEaA3pjgDdWTHp^7pZ24EH>hnwGy4c$KP5y;@+rFni z-<jR}%l1y~-%t1J-hbP_@JhzBb>c?1MV4zX7doyXF*){(M98BXo@;{^cNVSwn=-#> z^;;Jn0khjVKGT~;vrBd4WzX{l8nB&qKdy1@)wx%p-yZomJ`IzeYFj>8)Jpon!<oTr zt_q&z6p(!U=Mm$Bv&Wuw-})?IHG4X<V^!_nHD=~ppV|M|eCzXd?&-M~zcySB4%&J3 z*roZp&!5L1Ki7IS^!Zn@u&@NXoW)l%lCHdec>HPW^vh8%a?Zs|`Y_w<xv=Kjo}S4p z`R4NZiIHzBIp+GlFYdU=KOYp7lR%*=9J)GGmc!%XDKer*rG3WzySmpm+Uyf50VXa6 MPgg&ebxsLQ0Ji@f@Bjb+ literal 480 zcmV<60U!Q}P)<h;3K|Lk000e1NJLTq003kF002V>0{{R3U6oMi00027P)t-s0002c zGDH9X004SD0eU_Idp`qvKm&X~27N&WenAL-L>!4y9*I;Qic=nnR3C~~Ac|EWi&Y?u zRU?d7BaB!mk6S2@TrH7bEs|g_lVMAtcTAyoYqE}QvXGL-tdqyAl*p}>$F7*ku$alQ zn#!`9o12@<v!BeipUt<<5hl~<-qh*d+U(=o?d0h5?dkOH>-6yJ_3!MXtL^sj^!fMo z`uF(z`S|<#{r>&_{{H{}|4Ns2<p2Nx0(4SNQ`G*+!V)+D007)cL_t(|+U?cH4#GeT z1keSCmO$tw^xk_y^Z$Psip<@T4=a&)E~}BoddD>x3o$zjQA80%6j4MGMG}hKEySRO zqy;&ikPq$T$Z&*wXeUSN4IZGK90?sK<OSM^kvYJECuk=@#-88mxBzauS@tG~DA=(G zZcFe>aT9mJjz{nu&~0#`F4*x1eyZ_p?M+Rz<B_NkALk#`_?-w@0`vy}Yij&Xgmm*W z#A&Wajo(R-sB(y(y&qBMcLL=4qW5{Dm*1uSKlv+UWg#YOA&MxXh$4z8qDVp!8~Fk{ WVMLz3KDGA%0000<MNUMnLSTaSE#Y<m From 3b2dccf241d922a105304716e3bded6051e53cce Mon Sep 17 00:00:00 2001 From: Ibrahem Sayed <is1394@fayoum.edu.eg> Date: Thu, 9 Jan 2025 14:30:05 +0200 Subject: [PATCH 2/8] Update Syria Flag Show --- example/pubspec.lock | 69 +++++++++++++++++++--------- lib/country_picker_dialog.dart | 25 ++++++---- pubspec.lock | 83 ++++++++++++++++++++-------------- 3 files changed, 112 insertions(+), 65 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index aa66e30c..c84f0fcd 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" fake_async: dependency: transitive description: @@ -65,39 +65,63 @@ packages: path: ".." relative: true source: path - version: "3.2.0" + version: "3.3.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + url: "https://pub.dev" + source: hosted + version: "10.0.5" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + url: "https://pub.dev" + source: hosted + version: "3.0.5" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" matcher: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.15.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" sky_engine: dependency: transitive description: flutter @@ -115,18 +139,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -147,10 +171,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.7.2" vector_math: dependency: transitive description: @@ -159,13 +183,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - web: + vm_service: dependency: transitive description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + name: vm_service + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "14.2.5" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/lib/country_picker_dialog.dart b/lib/country_picker_dialog.dart index 8d078a60..52b17c4a 100644 --- a/lib/country_picker_dialog.dart +++ b/lib/country_picker_dialog.dart @@ -120,16 +120,21 @@ class _CountryPickerDialogState extends State<CountryPickerDialog> { itemBuilder: (ctx, index) => Column( children: <Widget>[ ListTile( - leading: kIsWeb - ? Image.asset( - 'assets/flags/${_filteredCountries[index].code.toLowerCase()}.png', - package: 'intl_phone_field', - width: 32, - ) - : Text( - _filteredCountries[index].flag, - style: const TextStyle(fontSize: 18), - ), + leading: Image.asset( + 'assets/flags/${_filteredCountries[index].code.toLowerCase()}.png', + package: 'intl_phone_field', + width: 32, + ), + // kIsWeb + // ? Image.asset( + // 'assets/flags/${_filteredCountries[index].code.toLowerCase()}.png', + // package: 'intl_phone_field', + // width: 32, + // ) + // : Text( + // _filteredCountries[index].flag, + // style: const TextStyle(fontSize: 18), + // ), contentPadding: widget.style?.listTilePadding, title: Text( _filteredCountries[index].localizedName(widget.languageCode), diff --git a/pubspec.lock b/pubspec.lock index 9fad3df1..7a7bb8b6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -77,10 +77,10 @@ packages: dependency: transitive description: name: coverage - sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + sha256: e3493833ea012784c740e341952298f1cc77f1f01b1bbc3eb4eecf6984fb7f43 url: "https://pub.dev" source: hosted - version: "1.6.3" + version: "1.11.1" crypto: dependency: transitive description: @@ -171,6 +171,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + url: "https://pub.dev" + source: hosted + version: "10.0.5" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + url: "https://pub.dev" + source: hosted + version: "3.0.5" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" lints: dependency: transitive description: @@ -191,26 +215,26 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.15.0" mime: dependency: transitive description: @@ -239,10 +263,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" pool: dependency: transitive description: @@ -324,18 +348,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -356,26 +380,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" + sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" url: "https://pub.dev" source: hosted - version: "1.24.3" + version: "1.25.7" test_api: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.7.2" test_core: dependency: transitive description: name: test_core - sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" + sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.6.4" typed_data: dependency: transitive description: @@ -396,10 +420,10 @@ packages: dependency: transitive description: name: vm_service - sha256: ada49637c27973c183dad90beb6bd781eea4c9f5f955d35da172de0af7bd3440 + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "11.8.0" + version: "14.2.5" watcher: dependency: transitive description: @@ -408,14 +432,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -441,4 +457,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" From f1a46219b2546389cbeeda8fe62ec6da76005269 Mon Sep 17 00:00:00 2001 From: Ibrahem Sayed <is1394@fayoum.edu.eg> Date: Thu, 9 Jan 2025 14:36:56 +0200 Subject: [PATCH 3/8] Update Dialog height --- lib/country_picker_dialog.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/country_picker_dialog.dart b/lib/country_picker_dialog.dart index 52b17c4a..0b0a1209 100644 --- a/lib/country_picker_dialog.dart +++ b/lib/country_picker_dialog.dart @@ -93,6 +93,7 @@ class _CountryPickerDialogState extends State<CountryPickerDialog> { child: Container( padding: widget.style?.padding ?? const EdgeInsets.all(10), child: Column( + mainAxisSize: MainAxisSize.min, children: <Widget>[ Padding( padding: widget.style?.searchFieldPadding ?? const EdgeInsets.all(0), From 04de41c8622cf551ac65f77134aec31c44cace3e Mon Sep 17 00:00:00 2001 From: Ibrahem Sayed <is1394@fayoum.edu.eg> Date: Thu, 9 Jan 2025 14:47:33 +0200 Subject: [PATCH 4/8] Update Dialog Flag --- lib/intl_phone_field.dart | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/intl_phone_field.dart b/lib/intl_phone_field.dart index a28ddafa..f12d900f 100644 --- a/lib/intl_phone_field.dart +++ b/lib/intl_phone_field.dart @@ -471,16 +471,21 @@ class _IntlPhoneFieldState extends State<IntlPhoneField> { const SizedBox(width: 4), ], if (widget.showCountryFlag) ...[ - kIsWeb - ? Image.asset( - 'assets/flags/${_selectedCountry.code.toLowerCase()}.png', - package: 'intl_phone_field', - width: 32, - ) - : Text( - _selectedCountry.flag, - style: const TextStyle(fontSize: 18), - ), + Image.asset( + 'assets/flags/${_selectedCountry.code.toLowerCase()}.png', + package: 'intl_phone_field', + width: 32, + ), + // kIsWeb + // ? Image.asset( + // 'assets/flags/${_selectedCountry.code.toLowerCase()}.png', + // package: 'intl_phone_field', + // width: 32, + // ) + // : Text( + // _selectedCountry.flag, + // style: const TextStyle(fontSize: 18), + // ), const SizedBox(width: 8), ], FittedBox( From 159ca73439ee0abf2099b47e4729679382df97ba Mon Sep 17 00:00:00 2001 From: Ibrahem Sayed <is1394@fayoum.edu.eg> Date: Thu, 9 Jan 2025 14:48:54 +0200 Subject: [PATCH 5/8] finish updates --- pubspec.lock | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 7a7bb8b6..2d9cbe52 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -77,10 +77,10 @@ packages: dependency: transitive description: name: coverage - sha256: e3493833ea012784c740e341952298f1cc77f1f01b1bbc3eb4eecf6984fb7f43 + sha256: "3945034e86ea203af7a056d98e98e42a5518fff200d6e8e6647e1886b07e936e" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.8.0" crypto: dependency: transitive description: @@ -175,26 +175,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.0" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "2.0.1" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "2.0.1" lints: dependency: transitive description: @@ -223,18 +223,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.11.0" mime: dependency: transitive description: @@ -380,26 +380,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" + sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f url: "https://pub.dev" source: hosted - version: "1.25.7" + version: "1.24.9" test_api: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.6.1" test_core: dependency: transitive description: name: test_core - sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" + sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.5.9" typed_data: dependency: transitive description: @@ -420,10 +420,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "13.0.0" watcher: dependency: transitive description: @@ -457,5 +457,4 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.4.0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.2.0-0 <4.0.0" From e0dd7ef24201caa6ec0af95bc2e9d7ac0025763f Mon Sep 17 00:00:00 2001 From: Ibrahem Sayed <is1394@fayoum.edu.eg> Date: Thu, 9 Jan 2025 15:06:45 +0200 Subject: [PATCH 6/8] Update Dialog Flag --- example/pubspec.lock | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index c84f0fcd..5301b8cc 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -70,26 +70,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.0" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "2.0.1" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "2.0.1" matcher: dependency: transitive description: @@ -102,18 +102,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.11.0" path: dependency: transitive description: @@ -171,10 +171,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.6.1" vector_math: dependency: transitive description: @@ -187,10 +187,9 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "13.0.0" sdks: - dart: ">=3.3.0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.2.0-0 <4.0.0" From 6e00ce8071d6ee27e06e1a7503bcd0a1651a77a0 Mon Sep 17 00:00:00 2001 From: Ibrahem Sayed <is1394@fayoum.edu.eg> Date: Mon, 20 Jan 2025 15:44:30 +0200 Subject: [PATCH 7/8] Counter text - flag radius --- example/android/app/build.gradle | 2 +- example/android/build.gradle | 2 +- lib/country_picker_dialog.dart | 74 ++++++++++++++++---------------- lib/intl_phone_field.dart | 16 ++++--- pubspec.lock | 39 +++++++++-------- 5 files changed, 71 insertions(+), 62 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 7ab1667a..3bafe1b1 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -39,7 +39,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.intl_phone_field_example" - minSdkVersion 16 + minSdkVersion flutter.minSdkVersion targetSdkVersion 32 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/example/android/build.gradle b/example/android/build.gradle index 8c40237d..f87c9520 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/lib/country_picker_dialog.dart b/lib/country_picker_dialog.dart index 0b0a1209..14475222 100644 --- a/lib/country_picker_dialog.dart +++ b/lib/country_picker_dialog.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:intl_phone_field/countries.dart'; @@ -115,44 +116,45 @@ class _CountryPickerDialogState extends State<CountryPickerDialog> { ), const SizedBox(height: 20), Expanded( - child: ListView.builder( + child: ListView.separated( shrinkWrap: true, itemCount: _filteredCountries.length, - itemBuilder: (ctx, index) => Column( - children: <Widget>[ - ListTile( - leading: Image.asset( - 'assets/flags/${_filteredCountries[index].code.toLowerCase()}.png', - package: 'intl_phone_field', - width: 32, - ), - // kIsWeb - // ? Image.asset( - // 'assets/flags/${_filteredCountries[index].code.toLowerCase()}.png', - // package: 'intl_phone_field', - // width: 32, - // ) - // : Text( - // _filteredCountries[index].flag, - // style: const TextStyle(fontSize: 18), - // ), - contentPadding: widget.style?.listTilePadding, - title: Text( - _filteredCountries[index].localizedName(widget.languageCode), - style: widget.style?.countryNameStyle ?? const TextStyle(fontWeight: FontWeight.w700), - ), - trailing: Text( - '+${_filteredCountries[index].dialCode}', - style: widget.style?.countryCodeStyle ?? const TextStyle(fontWeight: FontWeight.w700), - ), - onTap: () { - _selectedCountry = _filteredCountries[index]; - widget.onCountryChanged(_selectedCountry); - Navigator.of(context).pop(); - }, - ), - widget.style?.listTileDivider ?? const Divider(thickness: 1), - ], + separatorBuilder: (context, index) => widget.style?.listTileDivider ?? const Divider(thickness: 1), + itemBuilder: (ctx, index) => ListTile( + leading: Text( + _filteredCountries[index].flag, + style: const TextStyle(fontSize: 18), + ), + // Image.asset( + // + // 'assets/flags/${_filteredCountries[index].code.toLowerCase()}.png', + // package: 'intl_phone_field', + // width: 32, + // ), + // kIsWeb + // ? Image.asset( + // 'assets/flags/${_filteredCountries[index].code.toLowerCase()}.png', + // package: 'intl_phone_field', + // width: 32, + // ) + // : Text( + // _filteredCountries[index].flag, + // style: const TextStyle(fontSize: 18), + // ), + contentPadding: widget.style?.listTilePadding, + title: Text( + _filteredCountries[index].localizedName(widget.languageCode), + style: widget.style?.countryNameStyle ?? const TextStyle(fontWeight: FontWeight.w700), + ), + trailing: Text( + '+${_filteredCountries[index].dialCode}', + style: widget.style?.countryCodeStyle ?? const TextStyle(fontWeight: FontWeight.w700), + ), + onTap: () { + _selectedCountry = _filteredCountries[index]; + widget.onCountryChanged(_selectedCountry); + Navigator.of(context).pop(); + }, ), ), ), diff --git a/lib/intl_phone_field.dart b/lib/intl_phone_field.dart index f12d900f..5d634e6a 100644 --- a/lib/intl_phone_field.dart +++ b/lib/intl_phone_field.dart @@ -249,8 +249,11 @@ class IntlPhoneField extends StatefulWidget { /// If null, default magnification configuration will be used. final TextMagnifierConfiguration? magnifierConfiguration; + /// Added by me + final bool showCounter; const IntlPhoneField({ Key? key, + this.showCounter = true, this.formFieldKey, this.initialCountryCode, this.languageCode = 'en', @@ -401,7 +404,7 @@ class _IntlPhoneFieldState extends State<IntlPhoneField> { magnifierConfiguration: widget.magnifierConfiguration, decoration: widget.decoration.copyWith( prefixIcon: _buildFlagsButton(), - counterText: !widget.enabled ? '' : null, + counterText: widget.showCounter?(!widget.enabled ? '' : null): null, ), style: widget.style, onSaved: (value) { @@ -471,10 +474,13 @@ class _IntlPhoneFieldState extends State<IntlPhoneField> { const SizedBox(width: 4), ], if (widget.showCountryFlag) ...[ - Image.asset( - 'assets/flags/${_selectedCountry.code.toLowerCase()}.png', - package: 'intl_phone_field', - width: 32, + ClipRRect( + borderRadius: BorderRadius.circular(4), + child: Image.asset( + 'assets/flags/${_selectedCountry.code.toLowerCase()}.png', + package: 'intl_phone_field', + width: 30, + ), ), // kIsWeb // ? Image.asset( diff --git a/pubspec.lock b/pubspec.lock index 2d9cbe52..55228c00 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -175,26 +175,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.0" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" lints: dependency: transitive description: @@ -223,18 +223,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.15.0" mime: dependency: transitive description: @@ -380,26 +380,26 @@ packages: dependency: "direct dev" description: name: test - sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f + sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" url: "https://pub.dev" source: hosted - version: "1.24.9" + version: "1.25.7" test_api: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.2" test_core: dependency: transitive description: name: test_core - sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a + sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" url: "https://pub.dev" source: hosted - version: "0.5.9" + version: "0.6.4" typed_data: dependency: transitive description: @@ -420,10 +420,10 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "14.2.5" watcher: dependency: transitive description: @@ -457,4 +457,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0-0 <4.0.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" From 2054cfc8817ca8b0e56ac7f661af5c8ebb19117f Mon Sep 17 00:00:00 2001 From: Ibrahem Sayed <is1394@fayoum.edu.eg> Date: Mon, 20 Jan 2025 15:49:01 +0200 Subject: [PATCH 8/8] Counter text - flag radius --- lib/intl_phone_field.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/intl_phone_field.dart b/lib/intl_phone_field.dart index 5d634e6a..2856c7cf 100644 --- a/lib/intl_phone_field.dart +++ b/lib/intl_phone_field.dart @@ -404,7 +404,7 @@ class _IntlPhoneFieldState extends State<IntlPhoneField> { magnifierConfiguration: widget.magnifierConfiguration, decoration: widget.decoration.copyWith( prefixIcon: _buildFlagsButton(), - counterText: widget.showCounter?(!widget.enabled ? '' : null): null, + counterText: !widget.enabled ||!widget.showCounter? '' : null, ), style: widget.style, onSaved: (value) { @@ -475,11 +475,11 @@ class _IntlPhoneFieldState extends State<IntlPhoneField> { ], if (widget.showCountryFlag) ...[ ClipRRect( - borderRadius: BorderRadius.circular(4), + borderRadius: BorderRadius.circular(2), child: Image.asset( 'assets/flags/${_selectedCountry.code.toLowerCase()}.png', package: 'intl_phone_field', - width: 30, + width: 32, ), ), // kIsWeb