From a83c4ee8b7807f826138f1e47005185ef24a5f83 Mon Sep 17 00:00:00 2001 From: Erick Zanardo Date: Thu, 25 Apr 2024 14:02:14 -0300 Subject: [PATCH 1/2] feat: adding multi dimensional flavors example --- multi_dimensional_flavors/.gitignore | 44 ++++++ multi_dimensional_flavors/.metadata | 30 +++++ multi_dimensional_flavors/README.md | 3 + .../analysis_options.yaml | 1 + multi_dimensional_flavors/android/.gitignore | 13 ++ .../android/app/build.gradle | 97 ++++++++++++++ .../android/app/src/debug/AndroidManifest.xml | 7 + .../android/app/src/main/AndroidManifest.xml | 19 +++ .../com/example/flavors/MainActivity.kt | 6 + .../res/drawable-v21/launch_background.xml | 12 ++ .../main/res/drawable/launch_background.xml | 12 ++ .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 544 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 442 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 721 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1031 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1443 bytes .../app/src/main/res/values-night/styles.xml | 18 +++ .../app/src/main/res/values/styles.xml | 18 +++ .../app/src/profile/AndroidManifest.xml | 7 + .../android/build.gradle | 18 +++ .../android/gradle.properties | 3 + .../gradle/wrapper/gradle-wrapper.properties | 5 + .../android/settings.gradle | 25 ++++ multi_dimensional_flavors/lib/main.dart | 125 ++++++++++++++++++ multi_dimensional_flavors/pubspec.lock | 71 ++++++++++ multi_dimensional_flavors/pubspec.yaml | 20 +++ multi_dimensional_flavors/shorebird.yaml | 23 ++++ 27 files changed, 577 insertions(+) create mode 100644 multi_dimensional_flavors/.gitignore create mode 100644 multi_dimensional_flavors/.metadata create mode 100644 multi_dimensional_flavors/README.md create mode 100644 multi_dimensional_flavors/analysis_options.yaml create mode 100644 multi_dimensional_flavors/android/.gitignore create mode 100644 multi_dimensional_flavors/android/app/build.gradle create mode 100644 multi_dimensional_flavors/android/app/src/debug/AndroidManifest.xml create mode 100644 multi_dimensional_flavors/android/app/src/main/AndroidManifest.xml create mode 100644 multi_dimensional_flavors/android/app/src/main/kotlin/com/example/flavors/MainActivity.kt create mode 100644 multi_dimensional_flavors/android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 multi_dimensional_flavors/android/app/src/main/res/drawable/launch_background.xml create mode 100644 multi_dimensional_flavors/android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 multi_dimensional_flavors/android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 multi_dimensional_flavors/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 multi_dimensional_flavors/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 multi_dimensional_flavors/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 multi_dimensional_flavors/android/app/src/main/res/values-night/styles.xml create mode 100644 multi_dimensional_flavors/android/app/src/main/res/values/styles.xml create mode 100644 multi_dimensional_flavors/android/app/src/profile/AndroidManifest.xml create mode 100644 multi_dimensional_flavors/android/build.gradle create mode 100644 multi_dimensional_flavors/android/gradle.properties create mode 100644 multi_dimensional_flavors/android/gradle/wrapper/gradle-wrapper.properties create mode 100644 multi_dimensional_flavors/android/settings.gradle create mode 100644 multi_dimensional_flavors/lib/main.dart create mode 100644 multi_dimensional_flavors/pubspec.lock create mode 100644 multi_dimensional_flavors/pubspec.yaml create mode 100644 multi_dimensional_flavors/shorebird.yaml diff --git a/multi_dimensional_flavors/.gitignore b/multi_dimensional_flavors/.gitignore new file mode 100644 index 0000000..24476c5 --- /dev/null +++ b/multi_dimensional_flavors/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# 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/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/multi_dimensional_flavors/.metadata b/multi_dimensional_flavors/.metadata new file mode 100644 index 0000000..bf1faef --- /dev/null +++ b/multi_dimensional_flavors/.metadata @@ -0,0 +1,30 @@ +# 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. + +version: + revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + channel: stable + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + - platform: ios + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/multi_dimensional_flavors/README.md b/multi_dimensional_flavors/README.md new file mode 100644 index 0000000..995f9fc --- /dev/null +++ b/multi_dimensional_flavors/README.md @@ -0,0 +1,3 @@ +# multi dimensional flavors + +A similar sample as the [flavors](../flavors), but which includes multiple dimensional flavors on android. diff --git a/multi_dimensional_flavors/analysis_options.yaml b/multi_dimensional_flavors/analysis_options.yaml new file mode 100644 index 0000000..f9b3034 --- /dev/null +++ b/multi_dimensional_flavors/analysis_options.yaml @@ -0,0 +1 @@ +include: package:flutter_lints/flutter.yaml diff --git a/multi_dimensional_flavors/android/.gitignore b/multi_dimensional_flavors/android/.gitignore new file mode 100644 index 0000000..6f56801 --- /dev/null +++ b/multi_dimensional_flavors/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/multi_dimensional_flavors/android/app/build.gradle b/multi_dimensional_flavors/android/app/build.gradle new file mode 100644 index 0000000..f027994 --- /dev/null +++ b/multi_dimensional_flavors/android/app/build.gradle @@ -0,0 +1,97 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +android { + namespace "com.example.flavors" + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.flavors" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + flavorDimensions "track", "country" + productFlavors { + internal { + dimension "track" + applicationIdSuffix ".internal" + manifestPlaceholders = [applicationLabel: "[Internal] Shorebird Example"] + } + stable { + dimension "track" + manifestPlaceholders = [applicationLabel: "Shorebird Example"] + } + global { + applicationIdSuffix ".gl" + dimension "country" + manifestPlaceholders = [applicationLabel: "Shorebird Example"] + } + playStore { + applicationIdSuffix ".pl" + dimension "country" + manifestPlaceholders = [applicationLabel: "Shorebird Example"] + } + local { + applicationIdSuffix ".lcl" + dimension "country" + manifestPlaceholders = [applicationLabel: "Shorebird Example"] + } + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10" +} diff --git a/multi_dimensional_flavors/android/app/src/debug/AndroidManifest.xml b/multi_dimensional_flavors/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/multi_dimensional_flavors/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/multi_dimensional_flavors/android/app/src/main/AndroidManifest.xml b/multi_dimensional_flavors/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..17ebfc2 --- /dev/null +++ b/multi_dimensional_flavors/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/multi_dimensional_flavors/android/app/src/main/kotlin/com/example/flavors/MainActivity.kt b/multi_dimensional_flavors/android/app/src/main/kotlin/com/example/flavors/MainActivity.kt new file mode 100644 index 0000000..8bcb912 --- /dev/null +++ b/multi_dimensional_flavors/android/app/src/main/kotlin/com/example/flavors/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.flavors + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/multi_dimensional_flavors/android/app/src/main/res/drawable-v21/launch_background.xml b/multi_dimensional_flavors/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/multi_dimensional_flavors/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/multi_dimensional_flavors/android/app/src/main/res/drawable/launch_background.xml b/multi_dimensional_flavors/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/multi_dimensional_flavors/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/multi_dimensional_flavors/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/multi_dimensional_flavors/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..db77bb4b7b0906d62b1847e87f15cdcacf6a4f29 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ literal 0 HcmV?d00001 diff --git a/multi_dimensional_flavors/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/multi_dimensional_flavors/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..17987b79bb8a35cc66c3c1fd44f5a5526c1b78be GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ literal 0 HcmV?d00001 diff --git a/multi_dimensional_flavors/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/multi_dimensional_flavors/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..d5f1c8d34e7a88e3f88bea192c3a370d44689c3c GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof literal 0 HcmV?d00001 diff --git a/multi_dimensional_flavors/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/multi_dimensional_flavors/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..4d6372eebdb28e45604e46eeda8dd24651419bc0 GIT binary patch literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` literal 0 HcmV?d00001 diff --git a/multi_dimensional_flavors/android/app/src/main/res/values-night/styles.xml b/multi_dimensional_flavors/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/multi_dimensional_flavors/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/multi_dimensional_flavors/android/app/src/main/res/values/styles.xml b/multi_dimensional_flavors/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/multi_dimensional_flavors/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/multi_dimensional_flavors/android/app/src/profile/AndroidManifest.xml b/multi_dimensional_flavors/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/multi_dimensional_flavors/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/multi_dimensional_flavors/android/build.gradle b/multi_dimensional_flavors/android/build.gradle new file mode 100644 index 0000000..bc157bd --- /dev/null +++ b/multi_dimensional_flavors/android/build.gradle @@ -0,0 +1,18 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/multi_dimensional_flavors/android/gradle.properties b/multi_dimensional_flavors/android/gradle.properties new file mode 100644 index 0000000..94adc3a --- /dev/null +++ b/multi_dimensional_flavors/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/multi_dimensional_flavors/android/gradle/wrapper/gradle-wrapper.properties b/multi_dimensional_flavors/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..3c472b9 --- /dev/null +++ b/multi_dimensional_flavors/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/multi_dimensional_flavors/android/settings.gradle b/multi_dimensional_flavors/android/settings.gradle new file mode 100644 index 0000000..536165d --- /dev/null +++ b/multi_dimensional_flavors/android/settings.gradle @@ -0,0 +1,25 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false +} + +include ":app" diff --git a/multi_dimensional_flavors/lib/main.dart b/multi_dimensional_flavors/lib/main.dart new file mode 100644 index 0000000..dda5554 --- /dev/null +++ b/multi_dimensional_flavors/lib/main.dart @@ -0,0 +1,125 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + // This is the theme of your application. + // + // TRY THIS: Try running your application with "flutter run". You'll see + // the application has a blue toolbar. Then, without quitting the app, + // try changing the seedColor in the colorScheme below to Colors.green + // and then invoke "hot reload" (save your changes or press the "hot + // reload" button in a Flutter-supported IDE, or press "r" if you used + // the command line to start the app). + // + // Notice that the counter didn't reset back to zero; the application + // state is not lost during the reload. To reset the state, use hot + // restart instead. + // + // This works for code too, not just values: Most code changes can be + // tested with just a hot reload. + colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), + useMaterial3: true, + ), + home: const MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key, required this.title}); + + // This widget is the home page of your application. It is stateful, meaning + // that it has a State object (defined below) that contains fields that affect + // how it looks. + + // This class is the configuration for the state. It holds the values (in this + // case the title) provided by the parent (in this case the App widget) and + // used by the build method of the State. Fields in a Widget subclass are + // always marked "final". + + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + // This call to setState tells the Flutter framework that something has + // changed in this State, which causes it to rerun the build method below + // so that the display can reflect the updated values. If we changed + // _counter without calling setState(), then the build method would not be + // called again, and so nothing would appear to happen. + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + // This method is rerun every time setState is called, for instance as done + // by the _incrementCounter method above. + // + // The Flutter framework has been optimized to make rerunning build methods + // fast, so that you can just rebuild anything that needs updating rather + // than having to individually change instances of widgets. + return Scaffold( + appBar: AppBar( + // TRY THIS: Try changing the color here to a specific color (to + // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar + // change color while the other colors stay the same. + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + // Here we take the value from the MyHomePage object that was created by + // the App.build method, and use it to set our appbar title. + title: Text(widget.title), + ), + body: Center( + // Center is a layout widget. It takes a single child and positions it + // in the middle of the parent. + child: Column( + // Column is also a layout widget. It takes a list of children and + // arranges them vertically. By default, it sizes itself to fit its + // children horizontally, and tries to be as tall as its parent. + // + // Column has various properties to control how it sizes itself and + // how it positions its children. Here we use mainAxisAlignment to + // center the children vertically; the main axis here is the vertical + // axis because Columns are vertical (the cross axis would be + // horizontal). + // + // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" + // action in the IDE, or press "p" in the console), to see the + // wireframe for each widget. + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headlineMedium, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), // This trailing comma makes auto-formatting nicer for build methods. + ); + } +} diff --git a/multi_dimensional_flavors/pubspec.lock b/multi_dimensional_flavors/pubspec.lock new file mode 100644 index 0000000..3882800 --- /dev/null +++ b/multi_dimensional_flavors/pubspec.lock @@ -0,0 +1,71 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" + source: hosted + version: "2.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" + source: hosted + version: "0.8.0" + meta: + dependency: transitive + description: + name: meta + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" +sdks: + dart: ">=3.2.0-0 <4.0.0" diff --git a/multi_dimensional_flavors/pubspec.yaml b/multi_dimensional_flavors/pubspec.yaml new file mode 100644 index 0000000..7b80881 --- /dev/null +++ b/multi_dimensional_flavors/pubspec.yaml @@ -0,0 +1,20 @@ +name: multi_dimensioanl_flavors +description: A Shorebird app which contains multiple, multi dimensional flavors on Android. +publish_to: "none" + +version: 1.0.0+1 + +environment: + sdk: ">=3.0.1 <4.0.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + flutter_lints: ^2.0.0 + +flutter: + assets: + - shorebird.yaml + uses-material-design: true diff --git a/multi_dimensional_flavors/shorebird.yaml b/multi_dimensional_flavors/shorebird.yaml new file mode 100644 index 0000000..a99d032 --- /dev/null +++ b/multi_dimensional_flavors/shorebird.yaml @@ -0,0 +1,23 @@ +# This file is used to configure the Shorebird updater used by your app. +# Learn more at https://docs.shorebird.dev +# This file should be checked into version control. + +# This is the unique identifier assigned to your app. +# Your app_id is not a secret and is just used to identify your app +# when requesting patches from Shorebird's servers. +app_id: 5171ee3d-1a4d-4bdd-91c3-64cef78fe41c +flavors: + internal: 5171ee3d-1a4d-4bdd-91c3-64cef78fe41c + internalGlobal: 5487a0d3-8c5a-4178-86ef-5295588e89bd + internalLocal: acb850fb-a9e3-45fb-86c0-705bb265d1e4 + internalPlayStore: c8cfaff9-d94e-4767-9055-50c4f0b25ddd + stable: 666541bc-0eda-477d-8ad5-ec97760435e6 + stableGlobal: 6ceb59f3-8d0e-45c2-965d-6bf554f331d0 + stableLocal: d9f3396e-f503-45f9-bb05-7ac5d4b060b0 + stablePlayStore: ca70dd3f-7357-4a04-bb77-4d6fe38a15b1 + +# auto_update controls if Shorebird should automatically update in the background on launch. +# If auto_update: false, you will need to use package:shorebird_code_push to trigger updates. +# https://pub.dev/packages/shorebird_code_push +# Uncomment the following line to disable automatic updates. +# auto_update: false From 58ab772cba3646cdd154c86317a123b69877d583 Mon Sep 17 00:00:00 2001 From: Erick Zanardo Date: Thu, 25 Apr 2024 14:16:23 -0300 Subject: [PATCH 2/2] PR suggestions --- multi_dimensional_flavors/shorebird.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/multi_dimensional_flavors/shorebird.yaml b/multi_dimensional_flavors/shorebird.yaml index a99d032..587b745 100644 --- a/multi_dimensional_flavors/shorebird.yaml +++ b/multi_dimensional_flavors/shorebird.yaml @@ -7,11 +7,9 @@ # when requesting patches from Shorebird's servers. app_id: 5171ee3d-1a4d-4bdd-91c3-64cef78fe41c flavors: - internal: 5171ee3d-1a4d-4bdd-91c3-64cef78fe41c internalGlobal: 5487a0d3-8c5a-4178-86ef-5295588e89bd internalLocal: acb850fb-a9e3-45fb-86c0-705bb265d1e4 internalPlayStore: c8cfaff9-d94e-4767-9055-50c4f0b25ddd - stable: 666541bc-0eda-477d-8ad5-ec97760435e6 stableGlobal: 6ceb59f3-8d0e-45c2-965d-6bf554f331d0 stableLocal: d9f3396e-f503-45f9-bb05-7ac5d4b060b0 stablePlayStore: ca70dd3f-7357-4a04-bb77-4d6fe38a15b1