From c5c2da9a4bc5657458ff961776133f9f5b8bc600 Mon Sep 17 00:00:00 2001 From: Ayush Bherwani Date: Wed, 5 Aug 2020 11:08:20 +0530 Subject: [PATCH] [federated_plugin] adds web implementation of federated_plugin (#507) --- .../federated_plugin/example/pubspec.lock | 39 +-- .../federated_plugin/example/web/favicon.png | Bin 0 -> 917 bytes .../example/web/icons/Icon-192.png | Bin 0 -> 5292 bytes .../example/web/icons/Icon-512.png | Bin 0 -> 8252 bytes .../federated_plugin/example/web/index.html | 33 ++ .../example/web/manifest.json | 23 ++ .../federated_plugin/pubspec.lock | 39 +-- .../federated_plugin/pubspec.yaml | 4 + .../pubspec.lock | 27 +- .../pubspec.yaml | 2 +- .../federated_plugin_web/.gitignore | 75 +++++ .../federated_plugin_web/.metadata | 10 + .../federated_plugin_web/README.md | 11 + .../analysis_options.yaml | 31 ++ .../lib/federated_plugin_web.dart | 45 +++ .../federated_plugin_web/pubspec.lock | 288 ++++++++++++++++++ .../federated_plugin_web/pubspec.yaml | 31 ++ .../test_driver/federated_plugin_web_e2e.dart | 53 ++++ .../federated_plugin_web_e2e_test.dart | 9 + .../federated_plugin_web/web/index.html | 10 + 20 files changed, 678 insertions(+), 52 deletions(-) create mode 100644 experimental/federated_plugin/federated_plugin/example/web/favicon.png create mode 100644 experimental/federated_plugin/federated_plugin/example/web/icons/Icon-192.png create mode 100644 experimental/federated_plugin/federated_plugin/example/web/icons/Icon-512.png create mode 100644 experimental/federated_plugin/federated_plugin/example/web/index.html create mode 100644 experimental/federated_plugin/federated_plugin/example/web/manifest.json create mode 100644 experimental/federated_plugin/federated_plugin_web/.gitignore create mode 100644 experimental/federated_plugin/federated_plugin_web/.metadata create mode 100644 experimental/federated_plugin/federated_plugin_web/README.md create mode 100644 experimental/federated_plugin/federated_plugin_web/analysis_options.yaml create mode 100644 experimental/federated_plugin/federated_plugin_web/lib/federated_plugin_web.dart create mode 100644 experimental/federated_plugin/federated_plugin_web/pubspec.lock create mode 100644 experimental/federated_plugin/federated_plugin_web/pubspec.yaml create mode 100644 experimental/federated_plugin/federated_plugin_web/test_driver/federated_plugin_web_e2e.dart create mode 100644 experimental/federated_plugin/federated_plugin_web/test_driver/federated_plugin_web_e2e_test.dart create mode 100644 experimental/federated_plugin/federated_plugin_web/web/index.html diff --git a/experimental/federated_plugin/federated_plugin/example/pubspec.lock b/experimental/federated_plugin/federated_plugin/example/pubspec.lock index fb964ea38..d79c6d316 100644 --- a/experimental/federated_plugin/federated_plugin/example/pubspec.lock +++ b/experimental/federated_plugin/federated_plugin/example/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.2" + version: "2.4.1" boolean_selector: dependency: transitive description: @@ -15,13 +15,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety" charcode: dependency: transitive description: @@ -42,7 +35,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety" + version: "1.14.12" cupertino_icons: dependency: "direct main" description: @@ -71,6 +64,13 @@ packages: relative: true source: path version: "0.0.1" + federated_plugin_web: + dependency: transitive + description: + path: "../../federated_plugin_web" + relative: true + source: path + version: "0.0.1" flutter: dependency: "direct main" description: flutter @@ -81,20 +81,25 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.8" + version: "0.12.6" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety" + version: "1.1.8" path: dependency: transitive description: @@ -108,7 +113,7 @@ packages: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.9.0" plugin_platform_interface: dependency: transitive description: @@ -134,7 +139,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.5" + version: "1.9.3" stream_channel: dependency: transitive description: @@ -162,21 +167,21 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.17" + version: "0.2.16" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety" + version: "1.1.6" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety" + version: "2.0.8" sdks: - dart: ">=2.9.0-18.0 <2.9.0" + dart: ">=2.7.0 <3.0.0" flutter: ">=1.17.0 <2.0.0" diff --git a/experimental/federated_plugin/federated_plugin/example/web/favicon.png b/experimental/federated_plugin/federated_plugin/example/web/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..8aaa46ac1ae21512746f852a42ba87e4165dfdd1 GIT binary patch literal 917 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0X7 zltGxWVyS%@P(fs7NJL45ua8x7ey(0(N`6wRUPW#JP&EUCO@$SZnVVXYs8ErclUHn2 zVXFjIVFhG^g!Ppaz)DK8ZIvQ?0~DO|i&7O#^-S~(l1AfjnEK zjFOT9D}DX)@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7USFmqf|i<65o z3raHc^AtelCMM;Vme?vOfh>Xph&xL%(-1c06+^uR^q@XSM&D4+Kp$>4P^%3{)XKjo zGZknv$b36P8?Z_gF{nK@`XI}Z90TzwSQO}0J1!f2c(B=V`5aP@1P1a|PZ!4!3&Gl8 zTYqUsf!gYFyJnXpu0!n&N*SYAX-%d(5gVjrHJWqXQshj@!Zm{!01WsQrH~9=kTxW#6SvuapgMqt>$=j#%eyGrQzr zP{L-3gsMA^$I1&gsBAEL+vxi1*Igl=8#8`5?A-T5=z-sk46WA1IUT)AIZHx1rdUrf zVJrJn<74DDw`j)Ki#gt}mIT-Q`XRa2-jQXQoI%w`nb|XblvzK${ZzlV)m-XcwC(od z71_OEC5Bt9GEXosOXaPTYOia#R4ID2TiU~`zVMl08TV_C%DnU4^+HE>9(CE4D6?Fz oujB08i7adh9xk7*FX66dWH6F5TM;?E2b5PlUHx3vIVCg!0Dx9vYXATM literal 0 HcmV?d00001 diff --git a/experimental/federated_plugin/federated_plugin/example/web/icons/Icon-192.png b/experimental/federated_plugin/federated_plugin/example/web/icons/Icon-192.png new file mode 100644 index 0000000000000000000000000000000000000000..b749bfef07473333cf1dd31e9eed89862a5d52aa GIT binary patch literal 5292 zcmZ`-2T+sGz6~)*FVZ`aW+(v>MIm&M-g^@e2u-B-DoB?qO+b1Tq<5uCCv>ESfRum& zp%X;f!~1{tzL__3=gjVJ=j=J>+nMj%ncXj1Q(b|Ckbw{Y0FWpt%4y%$uD=Z*c-x~o zE;IoE;xa#7Ll5nj-e4CuXB&G*IM~D21rCP$*xLXAK8rIMCSHuSu%bL&S3)8YI~vyp@KBu9Ph7R_pvKQ@xv>NQ`dZp(u{Z8K3yOB zn7-AR+d2JkW)KiGx0hosml;+eCXp6+w%@STjFY*CJ?udJ64&{BCbuebcuH;}(($@@ znNlgBA@ZXB)mcl9nbX#F!f_5Z=W>0kh|UVWnf!At4V*LQP%*gPdCXd6P@J4Td;!Ur z<2ZLmwr(NG`u#gDEMP19UcSzRTL@HsK+PnIXbVBT@oHm53DZr?~V(0{rsalAfwgo zEh=GviaqkF;}F_5-yA!1u3!gxaR&Mj)hLuj5Q-N-@Lra{%<4ONja8pycD90&>yMB` zchhd>0CsH`^|&TstH-8+R`CfoWqmTTF_0?zDOY`E`b)cVi!$4xA@oO;SyOjJyP^_j zx^@Gdf+w|FW@DMdOi8=4+LJl$#@R&&=UM`)G!y%6ZzQLoSL%*KE8IO0~&5XYR9 z&N)?goEiWA(YoRfT{06&D6Yuu@Qt&XVbuW@COb;>SP9~aRc+z`m`80pB2o%`#{xD@ zI3RAlukL5L>px6b?QW1Ac_0>ew%NM!XB2(H+1Y3AJC?C?O`GGs`331Nd4ZvG~bMo{lh~GeL z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AOw+v)yc`qM)03qyyrqhX?ub`Cjwx2PrR! z)_z>5*!*$x1=Qa-0uE7jy0z`>|Ni#X+uV|%_81F7)b+nf%iz=`fF4g5UfHS_?PHbr zB;0$bK@=di?f`dS(j{l3-tSCfp~zUuva+=EWxJcRfp(<$@vd(GigM&~vaYZ0c#BTs z3ijkxMl=vw5AS&DcXQ%eeKt!uKvh2l3W?&3=dBHU=Gz?O!40S&&~ei2vg**c$o;i89~6DVns zG>9a*`k5)NI9|?W!@9>rzJ;9EJ=YlJTx1r1BA?H`LWijk(rTax9(OAu;q4_wTj-yj z1%W4GW&K4T=uEGb+E!>W0SD_C0RR91 literal 0 HcmV?d00001 diff --git a/experimental/federated_plugin/federated_plugin/example/web/icons/Icon-512.png b/experimental/federated_plugin/federated_plugin/example/web/icons/Icon-512.png new file mode 100644 index 0000000000000000000000000000000000000000..88cfd48dff1169879ba46840804b412fe02fefd6 GIT binary patch literal 8252 zcmd5=2T+s!lYZ%-(h(2@5fr2dC?F^$C=i-}R6$UX8af(!je;W5yC_|HmujSgN*6?W z3knF*TL1$|?oD*=zPbBVex*RUIKsL<(&Rj9%^UD2IK3W?2j>D?eWQgvS-HLymHo9%~|N2Q{~j za?*X-{b9JRowv_*Mh|;*-kPFn>PI;r<#kFaxFqbn?aq|PduQg=2Q;~Qc}#z)_T%x9 zE|0!a70`58wjREmAH38H1)#gof)U3g9FZ^ zF7&-0^Hy{4XHWLoC*hOG(dg~2g6&?-wqcpf{ z&3=o8vw7lMi22jCG9RQbv8H}`+}9^zSk`nlR8?Z&G2dlDy$4#+WOlg;VHqzuE=fM@ z?OI6HEJH4&tA?FVG}9>jAnq_^tlw8NbjNhfqk2rQr?h(F&WiKy03Sn=-;ZJRh~JrD zbt)zLbnabttEZ>zUiu`N*u4sfQaLE8-WDn@tHp50uD(^r-}UsUUu)`!Rl1PozAc!a z?uj|2QDQ%oV-jxUJmJycySBINSKdX{kDYRS=+`HgR2GO19fg&lZKyBFbbXhQV~v~L za^U944F1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JtkAn6F(O{z@b76OIqMC$&oJ_&S|YbFJ*)3qVX_uNf5b8(!vGX19hsG z(OP>RmZp29KH9Ge2kKjKigUmOe^K_!UXP`von)PR8Qz$%=EmOB9xS(ZxE_tnyzo}7 z=6~$~9k0M~v}`w={AeqF?_)9q{m8K#6M{a&(;u;O41j)I$^T?lx5(zlebpY@NT&#N zR+1bB)-1-xj}R8uwqwf=iP1GbxBjneCC%UrSdSxK1vM^i9;bUkS#iRZw2H>rS<2<$ zNT3|sDH>{tXb=zq7XZi*K?#Zsa1h1{h5!Tq_YbKFm_*=A5-<~j63he;4`77!|LBlo zR^~tR3yxcU=gDFbshyF6>o0bdp$qmHS7D}m3;^QZq9kBBU|9$N-~oU?G5;jyFR7>z hN`IR97YZXIo@y!QgFWddJ3|0`sjFx!m))><{BI=FK%f8s literal 0 HcmV?d00001 diff --git a/experimental/federated_plugin/federated_plugin/example/web/index.html b/experimental/federated_plugin/federated_plugin/example/web/index.html new file mode 100644 index 000000000..9b7a438f8 --- /dev/null +++ b/experimental/federated_plugin/federated_plugin/example/web/index.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + example + + + + + + + + diff --git a/experimental/federated_plugin/federated_plugin/example/web/manifest.json b/experimental/federated_plugin/federated_plugin/example/web/manifest.json new file mode 100644 index 000000000..8c012917d --- /dev/null +++ b/experimental/federated_plugin/federated_plugin/example/web/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/experimental/federated_plugin/federated_plugin/pubspec.lock b/experimental/federated_plugin/federated_plugin/pubspec.lock index 4b3f803f2..91bb00350 100644 --- a/experimental/federated_plugin/federated_plugin/pubspec.lock +++ b/experimental/federated_plugin/federated_plugin/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.2" + version: "2.4.1" boolean_selector: dependency: transitive description: @@ -15,13 +15,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety" charcode: dependency: transitive description: @@ -42,7 +35,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety" + version: "1.14.12" fake_async: dependency: transitive description: @@ -57,6 +50,13 @@ packages: relative: true source: path version: "0.0.1" + federated_plugin_web: + dependency: "direct main" + description: + path: "../federated_plugin_web" + relative: true + source: path + version: "0.0.1" flutter: dependency: "direct main" description: flutter @@ -67,20 +67,25 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.8" + version: "0.12.6" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety" + version: "1.1.8" path: dependency: transitive description: @@ -94,7 +99,7 @@ packages: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.9.0" plugin_platform_interface: dependency: transitive description: @@ -120,7 +125,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.5" + version: "1.9.3" stream_channel: dependency: transitive description: @@ -148,21 +153,21 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.17" + version: "0.2.16" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety" + version: "1.1.6" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety" + version: "2.0.8" sdks: - dart: ">=2.9.0-18.0 <2.9.0" + dart: ">=2.7.0 <3.0.0" flutter: ">=1.17.0 <2.0.0" diff --git a/experimental/federated_plugin/federated_plugin/pubspec.yaml b/experimental/federated_plugin/federated_plugin/pubspec.yaml index 5a57d4a0a..2cb10ccb2 100644 --- a/experimental/federated_plugin/federated_plugin/pubspec.yaml +++ b/experimental/federated_plugin/federated_plugin/pubspec.yaml @@ -14,6 +14,8 @@ dependencies: sdk: flutter federated_plugin_platform_interface: path: ../federated_plugin_platform_interface + federated_plugin_web: + path: ../federated_plugin_web dev_dependencies: flutter_test: @@ -26,3 +28,5 @@ flutter: android: pluginClass: FederatedPlugin package: dev.flutter.federated_plugin + web: + default_package: federated_plugin_web diff --git a/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.lock b/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.lock index 9232a970b..3b35a0d54 100644 --- a/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.lock +++ b/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.2" + version: "2.4.1" boolean_selector: dependency: transitive description: @@ -15,13 +15,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety" charcode: dependency: transitive description: @@ -42,7 +35,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety" + version: "1.14.12" fake_async: dependency: transitive description: @@ -66,14 +59,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.8" + version: "0.12.6" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety" + version: "1.1.8" path: dependency: transitive description: @@ -87,7 +80,7 @@ packages: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.9.0" plugin_platform_interface: dependency: "direct main" description: @@ -113,7 +106,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.5" + version: "1.9.3" stream_channel: dependency: transitive description: @@ -141,21 +134,21 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.17" + version: "0.2.16" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety" + version: "1.1.6" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety" + version: "2.0.8" sdks: - dart: ">=2.9.0-18.0 <2.9.0" + dart: ">=2.7.0 <3.0.0" flutter: ">=1.17.0 <2.0.0" diff --git a/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.yaml b/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.yaml index e825f60da..6bf7cb129 100644 --- a/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.yaml +++ b/experimental/federated_plugin/federated_plugin_platform_interface/pubspec.yaml @@ -1,5 +1,5 @@ name: federated_plugin_platform_interface -description: A new Flutter package project. +description: A platform interface for federated_plugin. version: 0.0.1 author: homepage: diff --git a/experimental/federated_plugin/federated_plugin_web/.gitignore b/experimental/federated_plugin/federated_plugin_web/.gitignore new file mode 100644 index 000000000..bb431f0d5 --- /dev/null +++ b/experimental/federated_plugin/federated_plugin_web/.gitignore @@ -0,0 +1,75 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/experimental/federated_plugin/federated_plugin_web/.metadata b/experimental/federated_plugin/federated_plugin_web/.metadata new file mode 100644 index 000000000..8d52aa40e --- /dev/null +++ b/experimental/federated_plugin/federated_plugin_web/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 8c5c720ce60b1761ec2963053e0d415df60a29e1 + channel: master + +project_type: package diff --git a/experimental/federated_plugin/federated_plugin_web/README.md b/experimental/federated_plugin/federated_plugin_web/README.md new file mode 100644 index 000000000..71f60d980 --- /dev/null +++ b/experimental/federated_plugin/federated_plugin_web/README.md @@ -0,0 +1,11 @@ +# federated_plugin_web + +A flutter plugin to provide location support for web. The web implementation +of `federated_plugin` is tested using [e2e](https://pub.dev/packages/e2e) package. + +### Steps to run e2e test on browser + +- Download and install the ChromeDriver from [here](https://chromedriver.chromium.org/downloads) +for the version of Chrome you are using. +- Start the driver using `chromedrive --port=4444` +- Run the test using `flutter drive -d web-server --release --browser-name=chrome --target=test_driver/federated_plugin_web_e2e.dart` diff --git a/experimental/federated_plugin/federated_plugin_web/analysis_options.yaml b/experimental/federated_plugin/federated_plugin_web/analysis_options.yaml new file mode 100644 index 000000000..f5c207c72 --- /dev/null +++ b/experimental/federated_plugin/federated_plugin_web/analysis_options.yaml @@ -0,0 +1,31 @@ +include: package:pedantic/analysis_options.yaml + +analyzer: + strong-mode: + implicit-casts: false + implicit-dynamic: false + +linter: + rules: + - avoid_types_on_closure_parameters + - avoid_void_async + - await_only_futures + - camel_case_types + - cancel_subscriptions + - close_sinks + - constant_identifier_names + - control_flow_in_finally + - directives_ordering + - empty_statements + - hash_and_equals + - implementation_imports + - non_constant_identifier_names + - package_api_docs + - package_names + - package_prefixed_library_names + - test_types_in_equals + - throw_in_finally + - unnecessary_brace_in_string_interps + - unnecessary_getters_setters + - unnecessary_new + - unnecessary_statements diff --git a/experimental/federated_plugin/federated_plugin_web/lib/federated_plugin_web.dart b/experimental/federated_plugin/federated_plugin_web/lib/federated_plugin_web.dart new file mode 100644 index 000000000..611ffa740 --- /dev/null +++ b/experimental/federated_plugin/federated_plugin_web/lib/federated_plugin_web.dart @@ -0,0 +1,45 @@ +// Copyright 2020 The Flutter team. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:html' as html; + +import 'package:federated_plugin_platform_interface/federated_plugin_platform_interface.dart'; +import 'package:federated_plugin_platform_interface/location_model.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_web_plugins/flutter_web_plugins.dart'; + +/// Web Implementation of [FederatedPluginInterface] to provide location. +class FederatedPlugin extends FederatedPluginInterface { + final html.Geolocation _geolocation; + + /// Constructor to override the geolocation object for testing purpose. + FederatedPlugin({html.Geolocation geolocation}) + : _geolocation = geolocation ?? html.window.navigator.geolocation; + + /// Method to register the plugin which sets [FederatedPlugin] to be the default + /// instance of [FederatedPluginInterface]. + static void registerWith(Registrar registrar) { + FederatedPluginInterface.instance = FederatedPlugin(); + } + + /// Returns [Location] to provide latitude and longitude. + /// + /// If any error, it's assume that user has denied the permission forever. + @override + Future getLocation() async { + try { + final geoPosition = await _geolocation.getCurrentPosition(); + return Location( + longitude: geoPosition.coords.longitude.toDouble(), + latitude: geoPosition.coords.latitude.toDouble(), + ); + } catch (error) { + throw PlatformException( + code: 'PERMISSION_DENIED', + message: 'Permission denied from User', + details: null, + ); + } + } +} diff --git a/experimental/federated_plugin/federated_plugin_web/pubspec.lock b/experimental/federated_plugin/federated_plugin_web/pubspec.lock new file mode 100644 index 000000000..f779018d8 --- /dev/null +++ b/experimental/federated_plugin/federated_plugin_web/pubspec.lock @@ -0,0 +1,288 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.3" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.14.12" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + e2e: + dependency: "direct dev" + description: + name: e2e + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.1" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + federated_plugin_platform_interface: + dependency: "direct main" + description: + path: "../federated_plugin_platform_interface" + relative: true + source: path + version: "0.0.1" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_driver: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + intl: + dependency: transitive + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" + json_rpc_2: + dependency: transitive + description: + name: json_rpc_2 + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.6" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.8" + mockito: + dependency: "direct dev" + description: + name: mockito + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.1" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + pedantic: + dependency: "direct dev" + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.13" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.4" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + sync_http: + dependency: transitive + description: + name: sync_http + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.16" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.8" + vm_service_client: + dependency: transitive + description: + name: vm_service_client + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.6+2" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + webdriver: + dependency: transitive + description: + name: webdriver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" +sdks: + dart: ">=2.7.0 <3.0.0" + flutter: ">=1.17.0 <2.0.0" diff --git a/experimental/federated_plugin/federated_plugin_web/pubspec.yaml b/experimental/federated_plugin/federated_plugin_web/pubspec.yaml new file mode 100644 index 000000000..188d32a50 --- /dev/null +++ b/experimental/federated_plugin/federated_plugin_web/pubspec.yaml @@ -0,0 +1,31 @@ +name: federated_plugin_web +description: Web implementation of federated_plugin to provide location. +version: 0.0.1 +homepage: +publish_to: none + +environment: + sdk: ">=2.7.0 <3.0.0" + flutter: ">=1.17.0 <2.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_web_plugins: + sdk: flutter + federated_plugin_platform_interface: + path: ../federated_plugin_platform_interface + +dev_dependencies: + flutter_test: + sdk: flutter + pedantic: ^1.9.0 + e2e: ^0.6.1 + mockito: ^4.1.1 + +flutter: + plugin: + platforms: + web: + pluginClass: FederatedPlugin + fileName: federated_plugin_web.dart diff --git a/experimental/federated_plugin/federated_plugin_web/test_driver/federated_plugin_web_e2e.dart b/experimental/federated_plugin/federated_plugin_web/test_driver/federated_plugin_web_e2e.dart new file mode 100644 index 000000000..ed856b6d0 --- /dev/null +++ b/experimental/federated_plugin/federated_plugin_web/test_driver/federated_plugin_web_e2e.dart @@ -0,0 +1,53 @@ +// Copyright 2020 The Flutter team. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:html'; + +import 'package:e2e/e2e.dart'; +import 'package:federated_plugin_web/federated_plugin_web.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; + +const kLatitude = 4; +const kLongitude = 3; + +class GeoLocationMock extends Mock implements Geolocation {} + +class GeoPositionMock extends Mock implements Geoposition { + @override + Coordinates get coords => MockCoordinates(); +} + +class MockCoordinates extends Mock implements Coordinates { + @override + num get latitude => kLatitude; + + @override + num get longitude => kLongitude; +} + +void main() { + E2EWidgetsFlutterBinding.ensureInitialized(); + + group('FederatedPlugin test', () { + final geoLocationMock = GeoLocationMock(); + + setUp(() { + when(geoLocationMock.getCurrentPosition()) + .thenAnswer((realInvocation) async => GeoPositionMock()); + }); + + testWidgets('getLocation Method', (tester) async { + final federatedPlugin = FederatedPlugin(geolocation: geoLocationMock); + final location = await federatedPlugin.getLocation(); + + // Verify that getCurrentPosition was called. + verify(geoLocationMock.getCurrentPosition()); + + // Verify the values of Location.longitude and Location.latitude. + expect(location.longitude, kLongitude); + expect(location.latitude, kLatitude); + }); + }); +} diff --git a/experimental/federated_plugin/federated_plugin_web/test_driver/federated_plugin_web_e2e_test.dart b/experimental/federated_plugin/federated_plugin_web/test_driver/federated_plugin_web_e2e_test.dart new file mode 100644 index 000000000..6afbe42a7 --- /dev/null +++ b/experimental/federated_plugin/federated_plugin_web/test_driver/federated_plugin_web_e2e_test.dart @@ -0,0 +1,9 @@ +// Copyright 2020 The Flutter team. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:e2e/e2e_driver.dart' as e2e; + +Future main() async => e2e.main(); diff --git a/experimental/federated_plugin/federated_plugin_web/web/index.html b/experimental/federated_plugin/federated_plugin_web/web/index.html new file mode 100644 index 000000000..2cf1b6a25 --- /dev/null +++ b/experimental/federated_plugin/federated_plugin_web/web/index.html @@ -0,0 +1,10 @@ + + + + + Browser Tests + + + + +