Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full package nullsafety and Flutter 3 fixes #178

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6448391
migrate by command
Sep 24, 2021
7dfb049
update null-safety
Sep 24, 2021
00a58ef
update
Sep 24, 2021
cba181e
update
Sep 24, 2021
86d2ed0
update
Sep 24, 2021
ed937e7
update
Sep 24, 2021
114db84
update
Sep 24, 2021
7ecc529
migrate command examples
Sep 24, 2021
25d8256
update example
Sep 24, 2021
3d3493c
update
Sep 25, 2021
ee37715
update gitignore
Sep 25, 2021
4449760
update
Sep 28, 2021
b81461c
fix OptimizedGestureDetector
Sep 28, 2021
e3dd529
Merge pull request Null safety
absar Nov 1, 2021
d034d79
Null safety updates.
absar Feb 6, 2022
895bc49
* Flutter 3 fixes.
absar May 15, 2022
ae78cdc
Flutter 3.3 fixes
absar Oct 16, 2022
f392a8b
Upgrade dependencies path_provider, screenshot, url_launcher, permiss…
absar Mar 13, 2023
703ab48
Disable image saver(image_gallery_saver) for now, as it's using a ver…
absar Mar 13, 2023
6f3f86f
* Flutter 3.7 updates
absar Mar 17, 2023
3fa7dce
BarLineChartBasePainter getData, getAxisRange getter improvements
absar Mar 17, 2023
6ff54a7
Bump sdk constraints to >=2.18.0
absar Mar 20, 2023
6544e29
Upgrade dependencies path_provider, url_launcher
absar Jun 3, 2023
385d9c4
Flutter 3.10 updates
absar Jun 11, 2023
4e5915b
Update sdk constraints to >=3.0.0 <4.0.0
absar Oct 27, 2023
73483e1
Rename Easing to MpEasing to not conflict with Flutter Easing
absar Dec 21, 2023
50f99da
* Flutter 3.22 updates
absar Aug 31, 2024
5740833
* Update example Gradle to 8.2 DSL
absar Sep 19, 2024
36b3ab1
Example app: Upgrade kotlin plugin from 1.7.20 to 1.8.22 and Gradle f…
absar Oct 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ pubspec.lock
**/ios/Flutter/flutter_assets/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
**/ios/Flutter/Flutter.podspec

# 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
mp_chart/.flutter-plugins-dependencies
49 changes: 49 additions & 0 deletions mp_chart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
## 1.7.1 2024-10-08
* Example app: Upgrade kotlin plugin from 1.7.20 to 1.8.22 and Gradle from 8.2 to 8.3, to sync it with Flutter 3.24
## 1.7.0 2024-09-20
* Update example Gradle to 8.2 DSL
* BREAKING: Update minimum supported Flutter to 3.22, Dart to 3.3
## 1.6.0 2024-08-31
* Flutter 3.22 updates
* Upgrade dependencies path_provider, screenshot
* Upgrade example app dependencies url_launcher , permission_handler, cupertino_icons
## 1.5.0 2023-12-21
* Rename Easing to MpEasing to not conflict with Flutter Easing
* Export most classes in mp_chart so that users only import mp_chart instead of individual classes
* Flutter 3.16 updates
* Upgrade dependencies intl
* Upgrade example app dependencies url_launcher, permission_handler, intl
## 1.4.0 2023-10-27
* Update sdk constraints to >=3.0.0 <4.0.0
* Upgrade dependencies intl, path_provider
* Upgrade example app dependencies url_launcher, permission_handler, cupertino_icons, intl
## 1.3.0 2023-06-11
* Flutter 3.10 updates
* Upgrade dependencies intl, screenshot, permission_handler
## 1.2.2 2023-06-03
* Upgrade dependencies path_provider, url_launcher
## 1.2.1 2023-03-17
* Flutter 3.7 updates
* Null safety cleanups
* BarLineChartBasePainter getData, getAxisRange getter improvements
* Upgrade dependency vector_math
* Bump sdk constraints to >=2.18.0
## 1.2.0 2023-03-13
* Disable image saver(image_gallery_saver) for now, as it's using a very old kotlin-gradle-plugin
## 1.1.0 2023-03-13
* Upgrade dependencies path_provider, screenshot, url_launcher, permission_handler
## 1.0.0 2022-10-16
* Flutter 3.3 fixes
* Upgrade dependencies path_provider, path_drawing, optimized_gesture_detector
* bump sdk from >=2.12.0 to >=2.17.0
* Example app:
** Upgrade dependencies, url_launcher, permission_handler, cupertino_icons
## 0.3.3 2022-05-16
* Flutter 3 fixes.
* Upgrade dependencies path_provider, vector_math.
* Example app:
** Use Uri instead of deprecated String in launchUrl
** Upgrade dependencies, url_launcher, permission_handler
## 0.3.2 2022-02-06
* Null safety updates.
* Upgrade dependencies.
## 0.3.1 2020-10-30
* Updated for Flutter 1.22.0 to use updated Dart intl package 0.17.0-nullsafety.1.
## 0.3.0 2020-09-18
Expand Down
34 changes: 21 additions & 13 deletions mp_chart/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
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()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,21 +22,28 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28
namespace "com.lqy.example"
compileSdkVersion flutter.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '11'
}

lintOptions {
disable 'InvalidPackage'
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.lqy.example"
minSdkVersion 16
targetSdkVersion 28
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
3 changes: 2 additions & 1 deletion mp_chart/example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
Expand Down
15 changes: 2 additions & 13 deletions mp_chart/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand All @@ -24,6 +13,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
31 changes: 21 additions & 10 deletions mp_chart/example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
include ':app'
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
}
settings.ext.flutterSdkPath = flutterSdkPath()

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.2.2' apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

include ":app"
2 changes: 1 addition & 1 deletion mp_chart/example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>
67 changes: 18 additions & 49 deletions mp_chart/example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,32 @@ project 'Runner', {
'Release' => :release,
}

def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

target 'Runner' do
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
end
generated_xcode_build_settings.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.symlinks', 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
end
}
flutter_ios_podfile_setup

# Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
}
end
target 'Runner' do
use_frameworks!
use_modular_headers!

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
flutter_additional_ios_build_settings(target)
end
end
22 changes: 11 additions & 11 deletions mp_chart/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
PODS:
- Flutter (1.0.0)
- image_gallery_saver (0.0.1):
- image_gallery_saver (1.5.0):
- Flutter
- path_provider (0.0.1):
- Flutter
- permission_handler (3.3.0):
- "permission_handler (5.1.0+2)":
- Flutter
- url_launcher (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios`)
- Flutter (from `Flutter`)
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)

EXTERNAL SOURCES:
Flutter:
:path: ".symlinks/flutter/ios"
:path: Flutter
image_gallery_saver:
:path: ".symlinks/plugins/image_gallery_saver/ios"
path_provider:
Expand All @@ -29,12 +29,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher/ios"

SPEC CHECKSUMS:
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
image_gallery_saver: 73b3cd8ad9c950c739878af9c311744d1bf5405d
path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d
permission_handler: 67637977b227d62d46bfbf524f335f8568de5a73
url_launcher: a1c0cc845906122c4784c542523d8cacbded5626
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
image_gallery_saver: 259eab68fb271cfd57d599904f7acdc7832e7ef2
path_provider: d1e9807085df1f9cc9318206cd649dc0b76be3de
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
url_launcher: b6e016d912f04be9f5bf6e8e82dc599b7ba59649

PODFILE CHECKSUM: 7fb83752f59ead6285236625b82473f90b1cb932
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

COCOAPODS: 1.7.3
COCOAPODS: 1.10.1
Loading