Skip to content

Commit 0f20ba2

Browse files
committed
Upgraded
1 parent 9a595df commit 0f20ba2

File tree

293 files changed

+43997
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+43997
-128
lines changed

.flutter-plugins

Lines changed: 0 additions & 8 deletions
This file was deleted.

.flutter-plugins-dependencies

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,62 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.0.0] - 2025-05-15
6+
7+
### Major Upgrade
8+
9+
- Migrated Android plugin to v2 embedding and modern APIs.
10+
- Updated Android build to use AGP 8.2.2, Kotlin 1.8.22, compileSdk 35, and minSdk 26.
11+
- Improved compatibility with latest Flutter and Android versions.
12+
- Fixed platform channel and plugin registration issues.
13+
14+
515
## [0.0.7] - 2025-01-04
616

717
### Fix and Improve Documentation
18+
819
- Fix some deprecated dependency and update documentaiton.
920

1021
## [0.0.6] - 2025-01-04
1122

1223
### Improvement
24+
1325
- Downgrade platform version from 3.1.6 to 3.1.0 to remove conflict dependecies.
1426

1527
## [0.0.5] - 2024-11-19
28+
1629
### Added
30+
1731
- Improved documentation for better clarity on package usage.
1832

1933
### Fixed
34+
2035
- Minor typos and formatting issues in the README file.
2136

2237
## [0.0.4] - 2024-11-19
38+
2339
### Updated
40+
2441
- Enhanced documentation with additional examples.
2542

2643
## [0.0.3] - 2024-11-19
44+
2745
### Changed
46+
2847
- Updated README with clearer instructions and added Key Features section.
2948

3049
### Fixed
50+
3151
- Resolved minor inconsistencies in the example code.
3252

3353
## [0.0.2] - 2024-11-19
54+
3455
### Updated
56+
3557
- Improved documentation with better usage guidelines.
3658

3759
## [0.0.1] - 2024-11-19
60+
3861
### Initial Release
39-
- First release of `open_mail`, providing basic functionality to open mail applications on supported platforms.
62+
63+
- First release of `open_mail`, providing basic functionality to open mail applications on supported platforms.

android/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
2626

2727
android {
2828
namespace 'com.cuboid.open_mail'
29-
compileSdkVersion 34
29+
compileSdkVersion 35
3030

3131
compileOptions {
3232
sourceCompatibility JavaVersion.VERSION_1_8
@@ -37,12 +37,11 @@ android {
3737
jvmTarget = '1.8'
3838
}
3939

40-
4140
sourceSets {
4241
main.java.srcDirs += 'src/main/kotlin'
4342
}
4443
defaultConfig {
45-
minSdkVersion 21
44+
minSdkVersion 26
4645
}
4746
lintOptions {
4847
disable 'InvalidPackage'

android/src/main/kotlin/com/cuboid/open_mail/OpenMailAppPlugin.kt

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,20 @@ import io.flutter.plugin.common.MethodCall
1313
import io.flutter.plugin.common.MethodChannel
1414
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
1515
import io.flutter.plugin.common.MethodChannel.Result
16-
import io.flutter.plugin.common.PluginRegistry.Registrar
1716

1817
class OpenMailAppPlugin : FlutterPlugin, MethodCallHandler {
1918
private lateinit var channel: MethodChannel
2019
private lateinit var applicationContext: Context
2120

2221
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
23-
// Although getFlutterEngine is deprecated we still need to use it for
24-
// apps not updated to Flutter Android v2 embedding
25-
channel = MethodChannel(flutterPluginBinding.flutterEngine.dartExecutor, "open_mail")
22+
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "open_mail")
2623
channel.setMethodCallHandler(this)
2724
init(flutterPluginBinding.applicationContext)
2825
}
2926

30-
// This static function is optional and equivalent to onAttachedToEngine. It supports the old
31-
// pre-Flutter-1.12 Android projects. You are encouraged to continue supporting
32-
// plugin registration via this function while apps migrate to use the new Android APIs
33-
// post-flutter-1.12 via https://flutter.dev/go/android-project-migration.
34-
//
35-
// It is encouraged to share logic between onAttachedToEngine and registerWith to keep
36-
// them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called
37-
// depending on the user's project. onAttachedToEngine or registerWith must both be defined
38-
// in the same class.
39-
companion object {
40-
@JvmStatic
41-
fun registerWith(registrar: Registrar) {
42-
val channel = MethodChannel(registrar.messenger(), "open_mail")
43-
val plugin = OpenMailAppPlugin()
44-
channel.setMethodCallHandler(plugin)
45-
plugin.init(registrar.context())
46-
}
47-
}
27+
// The companion object with the static registerWith method has been removed
28+
// as it was using outdated Flutter plugin APIs and causing compilation errors.
29+
// Modern Flutter plugins rely on the FlutterPlugin interface implementation.
4830

4931
fun init(context: Context) {
5032
applicationContext = context

example/android/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
gradle-wrapper.jar
22
/.gradle
3+
/.cxx
34
/captures/
45
/gradlew
56
/gradlew.bat

example/android/app/.cxx/Debug/2u12572h/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2

Whitespace-only changes.

example/android/app/.cxx/Debug/2u12572h/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1

Whitespace-only changes.

example/android/app/.cxx/Debug/2u12572h/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2

Whitespace-only changes.

0 commit comments

Comments
 (0)