From b6de52ae6992a7ae6dd6549a2c8edc0976d836b9 Mon Sep 17 00:00:00 2001 From: Alex Talebi <31685655+SalehTZ@users.noreply.github.com> Date: Wed, 21 May 2025 11:47:43 +0330 Subject: [PATCH 1/8] Update gradle to be compatible with flutter version. - Gradle to `8.10.2` - `ext.kotlin_version` to `1.8.22` - `com.android.tools.build:gradle` to `8.7.0` - `JavaVersion` to `JavaVersion.VERSION_11` --- android/build.gradle | 66 +++++++++---------- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 2 +- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 0e3f06e..32223bb 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,10 +1,14 @@ +group "ir.cafebazaar.flutter_poolakey" +version "2.2.0-1.0.0-alpha01" + buildscript { - ext.kotlin_version = "1.7.10" + ext.kotlin_version = "1.8.22" ext.poolakey_version = "2.2.0" repositories { - jcenter() - maven { url "https://jitpack.io" } google() + mavenCentral() + jcenter() + maven { url = uri("https://jitpack.io") } maven { url "https://plugins.gradle.org/m2/" } maven { url "https://maven.google.com/" @@ -13,69 +17,65 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath("com.android.tools.build:gradle:8.7.0") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") } } -plugins { - id "com.android.library" - id "kotlin-android" -} - -group 'ir.cafebazaar.flutter_poolakey' -version '2.2.0-1.0.0-alpha01' - allprojects { repositories { - jcenter() - maven { url "https://jitpack.io" } google() - maven { url "https://plugins.gradle.org/m2/" } + mavenCentral() + jcenter() + maven { url = uri("https://jitpack.io") } + maven { url = uri("https://plugins.gradle.org/m2/") } maven { - url "https://maven.google.com/" - name "Google" + url = uri("https://maven.google.com/") + name = "Google" } } } +apply plugin: "com.android.library" +apply plugin: "kotlin-android" + android { - namespace 'ir.cafebazaar.flutter_poolakey' - compileSdkVersion 34 + namespace = "ir.cafebazaar.flutter_poolakey" + compileSdk = 35 compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } buildFeatures { - buildConfig true + buildConfig = true } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_11.toString() } - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } + // sourceSets { + // main.java.srcDirs += "src/main/kotlin" + // } defaultConfig { - minSdkVersion 16 - versionCode 2002001001 - versionName "2.2.0-1.0.0-alpha01" + minSdk = 16 + versionCode = 2002001001 + versionName = "2.2.0-1.0.0-alpha01" } buildTypes { debug { - buildConfigField "String", "POOLAKEY_VERSION", '"' + poolakey_version + '"' + buildConfigField("String", "POOLAKEY_VERSION", '"' + poolakey_version + '"') } release { - buildConfigField "String", "POOLAKEY_VERSION", '"' + poolakey_version + '"' + buildConfigField("String", "POOLAKEY_VERSION", '"' + poolakey_version + '"') } } dependencies { - implementation "com.github.cafebazaar.Poolakey:poolakey:$poolakey_version" + implementation("com.github.cafebazaar.Poolakey:poolakey:$poolakey_version") } } \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..afa1e8e 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ 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 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index c7b5d26..a1c350f 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1 +1 @@ -rootProject.name = 'flutter_poolakey' +rootProject.name = "flutter_poolakey" From 26b84f5d9c5404e2af0edbce25c147fc9eb8e3c0 Mon Sep 17 00:00:00 2001 From: Alex Talebi <31685655+SalehTZ@users.noreply.github.com> Date: Wed, 21 May 2025 11:49:38 +0330 Subject: [PATCH 2/8] Migrate example app's gradle files to Kotlin DSL This commit migrates the example application's Gradle build scripts from Groovy to Kotlin DSL. This includes updating `build.gradle`, `app/build.gradle`, and `settings.gradle` to their Kotlin equivalents (`.kts`). The Kotlin DSL offers improved type safety, better IDE support, and a more concise syntax. Key changes: - Renamed `.gradle` files to `.gradle.kts`. - Updated syntax for plugin application, dependencies, and configurations. - Adjusted Java and Kotlin compilation options (e.g., `JavaVersion.VERSION_1_11`). - Ensured compatibility with existing project structure and Flutter integration. - Updated `com.android.application` plugin version to `8.7.0` and `org.jetbrains.kotlin.android` to `1.8.22`. --- example/android/.gitignore | 48 +++++++++++++++++++ .../app/{build.gradle => build.gradle.kts} | 26 +++++----- example/android/build.gradle | 20 -------- example/android/build.gradle.kts | 23 +++++++++ example/android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 27 ----------- example/android/settings.gradle.kts | 26 ++++++++++ 8 files changed, 111 insertions(+), 63 deletions(-) rename example/android/app/{build.gradle => build.gradle.kts} (53%) delete mode 100644 example/android/build.gradle create mode 100644 example/android/build.gradle.kts delete mode 100644 example/android/settings.gradle create mode 100644 example/android/settings.gradle.kts diff --git a/example/android/.gitignore b/example/android/.gitignore index 0a741cb..cb17670 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -9,3 +9,51 @@ GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app key.properties + +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +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 +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/.cxx +/android/app/debug +/android/app/profile +/android/app/release + diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle.kts similarity index 53% rename from example/android/app/build.gradle rename to example/android/app/build.gradle.kts index daba143..c88721b 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle.kts @@ -1,30 +1,28 @@ plugins { - id "com.android.application" - id "kotlin-android" - id "dev.flutter.flutter-gradle-plugin" + id("com.android.application") + id("kotlin-android") + id("dev.flutter.flutter-gradle-plugin") } android { namespace = "com.sample.android.trivialdrivesample" - compileSdkVersion = 34 - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } + compileSdk = flutter.compileSdkVersion + compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 + jvmTarget = JavaVersion.VERSION_11.toString() } defaultConfig { - applicationId "ir.cafebazaar.poolakeysample" + applicationId = "ir.cafebazaar.poolakeysample" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. - minSdkVersion = flutter.minSdkVersion - targetSdkVersion = flutter.targetSdkVersion + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion versionCode = 1 versionName = "1.0" } @@ -33,7 +31,7 @@ android { 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 + signingConfig = signingConfigs.getByName("debug") } } } diff --git a/example/android/build.gradle b/example/android/build.gradle deleted file mode 100644 index 9f73bca..0000000 --- a/example/android/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -allprojects { - repositories { - jcenter() - maven { url "https://jitpack.io" } - 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/example/android/build.gradle.kts b/example/android/build.gradle.kts new file mode 100644 index 0000000..a167424 --- /dev/null +++ b/example/android/build.gradle.kts @@ -0,0 +1,23 @@ +allprojects { + repositories { + jcenter() + maven { url = uri("https://jitpack.io") } + google() + mavenCentral() + } +} + +val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 94adc3a..f018a61 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..afa1e8e 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ 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 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle deleted file mode 100644 index 6a238f3..0000000 --- a/example/android/settings.gradle +++ /dev/null @@ -1,27 +0,0 @@ -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() - maven { url "https://jitpack.io" } - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.4.0" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false -} - -rootProject.name = 'flutter_poolakey' -include ":app" \ No newline at end of file diff --git a/example/android/settings.gradle.kts b/example/android/settings.gradle.kts new file mode 100644 index 0000000..bf49c13 --- /dev/null +++ b/example/android/settings.gradle.kts @@ -0,0 +1,26 @@ +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + maven { url = uri("https://jitpack.io") } + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.7.0" apply false + id("org.jetbrains.kotlin.android") version "1.8.22" apply false +} + +include(":app") \ No newline at end of file From b8e3f3dc6fc28adba13829742a44fe8cb1262acd Mon Sep 17 00:00:00 2001 From: Alex Talebi <31685655+SalehTZ@users.noreply.github.com> Date: Wed, 21 May 2025 11:50:23 +0330 Subject: [PATCH 3/8] Refactor example app This commit refactors the example application for `flutter_poolakey`: - **UI Simplification:** Removed the `title` property from `MyHomePage` and simplified the UI by removing unnecessary comments and whitespace. - **Connection Status:** Updated the connection status messages to be more concise (e.g., "Service: Connected" to "Connected"). - **Widget Structure:** Minor adjustments to widget nesting and spacing for better readability. - **Snackbar Messages:** Added a snackbar message for the `subscribeProduct` success case. --- example/lib/main.dart | 153 +++++++++++++++++++++--------------------- 1 file changed, 76 insertions(+), 77 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 537ca28..8311863 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -8,42 +8,21 @@ void main() { class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); - // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Trivial Example for Flutter-Poolakey', theme: ThemeData( - // This is the theme of your application. - // - // Try running your application with "flutter run". You'll see the - // application has a blue toolbar. Then, without quitting the app, try - // changing the primarySwatch below to Colors.green and then invoke - // "hot reload" (press "r" in the console where you ran "flutter run", - // or simply save your changes to "hot reload" in a Flutter IDE). - // Notice that the counter didn't reset back to zero; the application - // is not restarted. primarySwatch: Colors.green, brightness: Brightness.dark, ), - home: const MyHomePage(title: 'Trivial Example for Flutter-Poolakey'), + home: const MyHomePage(), ); } } class MyHomePage extends StatefulWidget { - const MyHomePage({Key? key, required this.title}) : super(key: key); - - // 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; + const MyHomePage({super.key}); @override State createState() => _MyHomePageState(); @@ -58,8 +37,8 @@ class _MyHomePageState extends State { @override void initState() { - _initShop(); super.initState(); + _initShop(); } Future _initShop() async { @@ -70,20 +49,20 @@ class _MyHomePageState extends State { rsaKey, onSucceed: () { connected = true; - _updateState("Service: Connected"); + _updateState("Connected"); }, onFailed: () { connected = false; - _updateState("Service: Not Connected"); + _updateState("Not Connected"); }, onDisconnected: () { connected = false; - _updateState("Service: Not Connected"); + _updateState("Not Connected"); }, ); } on Exception catch (e) { showSnackBar(e.toString()); - _updateState("Service: Failed to Connect"); + _updateState("Failed to Connect"); } } @@ -103,7 +82,7 @@ class _MyHomePageState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - Text(status), + Text('Service: $status'), const SizedBox(height: 8), TextField( controller: productIdController, @@ -125,51 +104,59 @@ class _MyHomePageState extends State { Text('Consume Purchase'), Spacer(), Switch( - value: consume, - onChanged: (checked) { - setState(() { - consume = checked; - }); - }), + value: consume, + onChanged: (checked) { + setState(() { + consume = checked; + }); + }, + ), ], ), FilledButton( - onPressed: () { - purchaseProduct( - productIdController.text, - "purchasePayload", - dynamicPriceTokenController.text, - ); - }, - child: Text('Purchase')), + onPressed: () { + purchaseProduct( + productIdController.text, + "purchasePayload", + dynamicPriceTokenController.text, + ); + }, + child: Text('Purchase'), + ), FilledButton( - onPressed: () { - subscribeProduct( - productIdController.text, - "subscribePayload", - dynamicPriceTokenController.text, - ); - }, - child: Text('Subscribe')), + onPressed: () { + subscribeProduct( + productIdController.text, + "subscribePayload", + dynamicPriceTokenController.text, + ); + }, + child: Text('Subscribe'), + ), FilledButton( - onPressed: checkUserPurchasedItem, - child: Text('Check if user purchased this item')), + onPressed: checkUserPurchasedItem, + child: Text('Check if user purchased this item'), + ), FilledButton( - onPressed: checkUserSubscribedItem, - child: Text('Check if user subscribed this item')), + onPressed: checkUserSubscribedItem, + child: Text('Check if user subscribed this item'), + ), FilledButton( - onPressed: () { - getSkuDetailOfInAppItem(productIdController.text); - }, - child: Text('Get Sku detail of in-app item')), + onPressed: () { + getSkuDetailOfInAppItem(productIdController.text); + }, + child: Text('Get Sku detail of in-app item'), + ), FilledButton( - onPressed: () { - getSkuDetailOfSubscriptionItem(productIdController.text); - }, - child: Text('Get Sku detail of subscription item')), + onPressed: () { + getSkuDetailOfSubscriptionItem(productIdController.text); + }, + child: Text('Get Sku detail of subscription item'), + ), FilledButton( - onPressed: checkTrialSubscription, - child: Text('Check Trial subscription')) + onPressed: checkTrialSubscription, + child: Text('Check Trial subscription'), + ), ], ), ), @@ -188,8 +175,13 @@ class _MyHomePageState extends State { } try { - PurchaseInfo? response = await FlutterPoolakey.subscribe(productId, - payload: payload, dynamicPriceToken: dynamicPriceToken ?? ""); + PurchaseInfo? response = await FlutterPoolakey.subscribe( + productId, + payload: payload, + dynamicPriceToken: dynamicPriceToken ?? "", + ); + + showSnackBar("subscribeProduct $response"); } catch (e) { showSnackBar("subscribeProduct ${e.toString()}"); return; @@ -206,8 +198,11 @@ class _MyHomePageState extends State { return; } try { - PurchaseInfo? response = await FlutterPoolakey.purchase(productId, - payload: payload, dynamicPriceToken: dynamicPriceToken ?? ""); + PurchaseInfo? response = await FlutterPoolakey.purchase( + productId, + payload: payload, + dynamicPriceToken: dynamicPriceToken ?? "", + ); if (consume) { consumePurchasedItem(response.purchaseToken); } @@ -226,8 +221,9 @@ class _MyHomePageState extends State { try { List? response = await FlutterPoolakey.getAllSubscribedProducts(); - bool result = response - .any((element) => element.productId == productIdController.text); + bool result = response.any( + (element) => element.productId == productIdController.text, + ); if (result) { showSnackBar("User has bought this item"); } else { @@ -248,8 +244,9 @@ class _MyHomePageState extends State { try { List? response = await FlutterPoolakey.getAllPurchasedProducts(); - bool result = response - .any((element) => element.productId == productIdController.text); + bool result = response.any( + (element) => element.productId == productIdController.text, + ); if (result) { showSnackBar("User has bought this item"); } else { @@ -284,8 +281,9 @@ class _MyHomePageState extends State { } try { - List? response = - await FlutterPoolakey.getInAppSkuDetails([skuValueInput]); + List? response = await FlutterPoolakey.getInAppSkuDetails([ + skuValueInput, + ]); showSnackBar("Detail Of InApp Item ${response.toString()}"); } catch (e) { showSnackBar("getSkuDetailOfInAppItem ${e.toString()}"); @@ -324,8 +322,9 @@ class _MyHomePageState extends State { } void showSnackBar(String message) { - ScaffoldMessenger.of(context) - .showSnackBar(SnackBar(content: Text(message))); + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(message))); } @override From d670db8141ea595449c5f82d5d9668a8689ece2a Mon Sep 17 00:00:00 2001 From: Alex Talebi <31685655+SalehTZ@users.noreply.github.com> Date: Wed, 21 May 2025 11:50:51 +0330 Subject: [PATCH 4/8] Enable default flutter test The default flutter test was disabled in the example app. This commit re-enables it. --- example/test/widget_test.dart | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index b4754da..0cde830 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -1,12 +1,27 @@ // This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll +// utility in the flutter_test package. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. +import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import '../lib/main.dart'; + void main() { - testWidgets('Verify Platform version', (WidgetTester tester) async {}); + testWidgets('Verify App Load', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that platform version is retrieved. + expect( + find.byWidgetPredicate( + (Widget widget) => + widget is Text && widget.data!.startsWith('Service:'), + ), + findsOneWidget, + ); + }); } From 80558bfd19cb17fa315749b9d5ade895450b7f3b Mon Sep 17 00:00:00 2001 From: Alex Talebi <31685655+SalehTZ@users.noreply.github.com> Date: Wed, 21 May 2025 11:51:06 +0330 Subject: [PATCH 5/8] Update dependencies in example app Updated the SDK constraint to ^3.7.2, cupertino_icons to ^1.0.8, and added flutter_lints ^5.0.0 in the example app's pubspec.yaml. --- example/pubspec.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/example/pubspec.yaml b/example/pubspec.yaml index d219194..e899b0f 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -6,7 +6,7 @@ description: Demonstrates how to use the flutter_poolakey plugin. # publish_to: 'none' # Remove this line if you wish to publish to pub.dev environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ^3.7.2 dependencies: flutter: @@ -22,18 +22,19 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 + cupertino_icons: ^1.0.8 dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^5.0.0 + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. From 1718187104895db3b31424ea82bc40cb54d34db1 Mon Sep 17 00:00:00 2001 From: Alex Talebi <31685655+SalehTZ@users.noreply.github.com> Date: Wed, 21 May 2025 11:51:51 +0330 Subject: [PATCH 6/8] Update sdk constraint and ignore .cxx folder This commit updates the SDK constraint in `pubspec.yaml` to `^3.7.2` and adds `flutter_lints` as a dev dependency. Additionally, it updates the `.gitignore` file to ignore the `example/android/app/.cxx/` directory. --- .gitignore | 3 ++- pubspec.yaml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2bead7e..46e8a12 100644 --- a/.gitignore +++ b/.gitignore @@ -115,4 +115,5 @@ app.*.symbols !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages -!/dev/ci/**/Gemfile.lock \ No newline at end of file +!/dev/ci/**/Gemfile.lock +example/android/app/.cxx/ \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 3cb5752..cfb831b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 2.2.0-1.0.0-alpha01 homepage: https://github.com/cafebazaar/flutter_poolakey environment: - sdk: '>=3.0.6 <4.0.0' + sdk: ^3.7.2 flutter: ">=3.3.0" dependencies: @@ -15,10 +15,11 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^5.0.0 flutter: plugin: platforms: android: package: ir.cafebazaar.flutter_poolakey - pluginClass: FlutterPoolakeyPlugin \ No newline at end of file + pluginClass: FlutterPoolakeyPlugin From a82f95f2ed2341f5b7e339a67f7beb3f78ef433b Mon Sep 17 00:00:00 2001 From: Alex Talebi <31685655+SalehTZ@users.noreply.github.com> Date: Wed, 21 May 2025 11:52:04 +0330 Subject: [PATCH 7/8] Add Important Configuration Notes and Troubleshooting section to README --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/README.md b/README.md index d2a999a..81ee4e1 100644 --- a/README.md +++ b/README.md @@ -56,3 +56,55 @@ the [app](https://github.com/cafebazaar/flutter_poolakey/tree/master/example) mo > [Poolakey](https://github.com/cafebazaar/Poolakey) is an Android In-App Billing SDK > for [Cafe Bazaar](https://cafebazaar.ir/?l=en) App Store. + + +## Important Configuration Notes + +1. **JitPack Repository** + Use the following syntax for JitPack repository in your `build.gradle`: + ```gradle + allprojects { + repositories { + maven { url = uri("https://jitpack.io") } + } + } + ``` + +2. **Java Version Configuration** + If you face Java-related issues, update your `android/app/build.gradle`: + ```gradle + android { + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + } + ``` + +3. **Gradle Plugin Version** + Ensure you're using a compatible Gradle plugin version in your project's `build.gradle`: + ```gradle + buildscript { + dependencies { + classpath("com.android.tools.build:gradle:8.7.0") + } + } + ``` + +4. **Kotlin Version** + Update the Kotlin version in your project's `build.gradle`: + ```gradle + buildscript { + ext.kotlin_version = "1.8.22" + // ... + } + ``` + +## Troubleshooting + +If you encounter build issues, please verify: +- All the above configurations are correctly set +- Your project's Gradle version is compatible with the Android Gradle Plugin +- You have Java 11 or later installed and properly configured in your environment + +For additional help, please refer to the [wiki](https://github.com/cafebazaar/flutter_poolakey/wiki) or file an issue on GitHub. From 1fd1522bb2f05eb47c77be49f7d74e369ed6a448 Mon Sep 17 00:00:00 2001 From: Alex Talebi Date: Wed, 21 May 2025 11:58:02 +0330 Subject: [PATCH 8/8] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 81ee4e1..e17eada 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,13 @@ the [app](https://github.com/cafebazaar/flutter_poolakey/tree/master/example) mo #### flutter_poolakey is a wrapper around [Poolakey](https://github.com/cafebazaar/Poolakey) to use in Flutter. +For additional help, please refer to the [wiki](https://github.com/cafebazaar/flutter_poolakey/wiki) or file an issue on GitHub. > [Poolakey](https://github.com/cafebazaar/Poolakey) is an Android In-App Billing SDK > for [Cafe Bazaar](https://cafebazaar.ir/?l=en) App Store. ## Important Configuration Notes +If you face any issues consider doing these: 1. **JitPack Repository** Use the following syntax for JitPack repository in your `build.gradle`: @@ -107,4 +109,3 @@ If you encounter build issues, please verify: - Your project's Gradle version is compatible with the Android Gradle Plugin - You have Java 11 or later installed and properly configured in your environment -For additional help, please refer to the [wiki](https://github.com/cafebazaar/flutter_poolakey/wiki) or file an issue on GitHub.