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

Update Flutter, target android SDK 34 #160

Merged
merged 36 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4bcfe0a
Restore project to manifests
IanVS Aug 28, 2024
610fc0e
Update go.mod and go.sum
IanVS Aug 28, 2024
cd83bea
Update Gradle
IanVS Aug 28, 2024
b598aa3
Flutter: remove deprecated / removed theme definitions
IanVS Aug 28, 2024
35fbf86
Format code
IanVS Aug 28, 2024
428ecbd
Remove dead/unused code
IanVS Aug 28, 2024
097199c
Replace deprecated canLaunch and launch
IanVS Aug 28, 2024
f25d637
Update flutter to 3.7.12
IanVS Aug 28, 2024
cec7351
Replace deprecated theme properties
IanVS Aug 28, 2024
188a8f8
Update to flutter 3.10.7
IanVS Aug 28, 2024
98a0818
Avoid deprecated window property
IanVS Aug 28, 2024
0e329ff
Remove unused method
IanVS Aug 28, 2024
70d5a0f
Use supported version of flutter_platform_widgets
IanVS Aug 28, 2024
1bf62b8
Update flutter to 3.13.9
IanVS Aug 28, 2024
b0e1ed4
Update to flutter 3.16.8
IanVS Aug 29, 2024
8e5deb9
Handle nullable vs nonnullable mismatch
IanVS Aug 29, 2024
4eea96e
Disable material 13 for now
IanVS Aug 29, 2024
8721123
Remove package attribute from manifests
IanVS Aug 29, 2024
47e005b
Avoid deprecated imperative apply of gradle plugins
IanVS Aug 29, 2024
afd655f
Support predictive back
IanVS Aug 29, 2024
eae5b31
Update to flutter 3.19.0
IanVS Aug 29, 2024
f6a31cd
Target/compile for SDK 34
IanVS Sep 3, 2024
89dea3d
Build iOS app
IanVS Sep 3, 2024
7fa98ca
Move thin binary creation to end
IanVS Sep 3, 2024
7d11658
Wrap PlatformProvider in MaterialApp and Scaffold
IanVS Sep 3, 2024
e2259ba
Update flutter and dependencies to latest
IanVS Sep 3, 2024
78a2ca8
Replace deprecated `onPopInvoked` with `onPopInvokedWithResult`
IanVS Sep 3, 2024
85a2c08
Update flutter-version in a few more spots
IanVS Sep 3, 2024
8c20397
Remove NDK version pin
IanVS Sep 6, 2024
28a49f8
Use constant to specify java version
IanVS Sep 10, 2024
51fe0a5
Replace deprecated flutter package_info dep
IanVS Sep 10, 2024
2dfbd23
Update dart sdk version
IanVS Sep 11, 2024
1b8449f
Run flutter clean / pub get
IanVS Sep 20, 2024
8d40bd7
Default text field enabled to true
IanVS Sep 20, 2024
7875edd
Restore _getString helper
IanVS Sep 20, 2024
d4e2130
go mod tidy
IanVS Sep 20, 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: 1 addition & 1 deletion .github/workflows/flutterfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.3.5'
flutter-version: '3.24.1'

- name: Check out code
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.3.5'
flutter-version: '3.24.1'

- uses: nttld/setup-ndk@v1
id: setup-ndk
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Install all of the following things:

- [`xcode`](https://apps.apple.com/us/app/xcode/)
- [`android-studio`](https://developer.android.com/studio)
- [`flutter` 3.3.5](https://docs.flutter.dev/get-started/install)
- [`flutter` 3.24.1](https://docs.flutter.dev/get-started/install)
- [`gomobile`](https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile)
- [Flutter Android Studio Extension](https://docs.flutter.dev/get-started/editor?tab=androidstudio)

Expand Down
20 changes: 9 additions & 11 deletions 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,10 +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) {
Expand All @@ -21,14 +23,10 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

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

android {
namespace "net.defined.mobile_nebula"

compileSdkVersion 33
compileSdkVersion 34
ndkVersion flutter.ndkVersion

compileOptions {
Expand All @@ -47,7 +45,7 @@ android {
defaultConfig {
applicationId "net.defined.mobile_nebula"
minSdkVersion 26 //flutter.minSdkVersion
targetSdkVersion 33 //flutter.targetSdkVersion
targetSdkVersion 34 //flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down Expand Up @@ -80,7 +78,7 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
def workVersion = "2.7.1"
implementation "androidx.security:security-crypto:1.0.0"
implementation "androidx.work:work-runtime-ktx:$workVersion"
implementation 'com.google.code.gson:gson:2.8.9'
Expand Down
17 changes: 0 additions & 17 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
buildscript {
ext {
workVersion = "2.7.1"
kotlinVersion = '1.7.20'
}

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}

allprojects {
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app', ':mobileNebula'
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
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.4.2" apply false
id "org.jetbrains.kotlin.android" version "1.7.20" apply false
}

include ':app', ':mobileNebula'
2 changes: 1 addition & 1 deletion 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>11.0</string>
<string>12.0</string>
</dict>
</plist>
21 changes: 11 additions & 10 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ PODS:
- Flutter
- package_info (0.0.1):
- Flutter
- path_provider_ios (0.0.1):
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- SDWebImage (5.15.5):
- SDWebImage/Core (= 5.15.5)
- SDWebImage/Core (5.15.5)
Expand All @@ -55,7 +56,7 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_barcode_scanner (from `.symlinks/plugins/flutter_barcode_scanner/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- SwiftyJSON (~> 5.0)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
Expand All @@ -77,8 +78,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_barcode_scanner/ios"
package_info:
:path: ".symlinks/plugins/package_info/ios"
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
url_launcher_ios:
Expand All @@ -87,17 +88,17 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_barcode_scanner: 7a1144744c28dc0c57a8de7218ffe5ec59a9e4bf
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider_ios: 7d7ce634493af4477d156294792024ec3485acd5
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
SDWebImage: fd7e1a22f00303e058058278639bf6196ee431fe
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
SwiftyJSON: 2f33a42c6fbc52764d96f13368585094bfd8aa5e
url_launcher_ios: 02f1989d4e14e998335b02b67a7590fa34f971af
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe

PODFILE CHECKSUM: b4b37a776e1b487bf31fc5e5014fa5a74f5a022a

COCOAPODS: 1.11.3
COCOAPODS: 1.15.2
13 changes: 8 additions & 5 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -266,9 +266,9 @@
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
43AA89612444DA6500EDC39C /* Embed App Extensions */,
00C7A79AE88792090BDAC68B /* [CP] Embed Pods Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
);
Expand All @@ -287,7 +287,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1140;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
43AA89532444DA6500EDC39C = {
Expand Down Expand Up @@ -358,7 +358,7 @@
"${BUILT_PRODUCTS_DIR}/file_picker/file_picker.framework",
"${BUILT_PRODUCTS_DIR}/flutter_barcode_scanner/flutter_barcode_scanner.framework",
"${BUILT_PRODUCTS_DIR}/package_info/package_info.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework",
"${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework",
"${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
);
Expand All @@ -372,7 +372,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_picker.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_barcode_scanner.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
);
Expand Down Expand Up @@ -405,10 +405,12 @@
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand All @@ -419,6 +421,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func MissingArgumentError(message: String, details: Any?) -> FlutterError {
return FlutterError(code: "missing_argument", message: message, details: details)
}

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
private let dnUpdater = DNUpdater()
private let apiClient = APIClient()
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
18 changes: 7 additions & 11 deletions lib/components/FormPage.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:async';

import 'package:flutter/cupertino.dart';
import 'package:flutter/widgets.dart';
import 'package:mobile_nebula/components/SimplePage.dart';
Expand Down Expand Up @@ -40,19 +38,17 @@ class _FormPageState extends State<FormPage> {
Widget build(BuildContext context) {
changed = widget.changed || changed;

return WillPopScope(
onWillPop: () {
if (!changed) {
return Future.value(true);
return PopScope<Object?>(
canPop: false,
onPopInvokedWithResult: (bool didPop, Object? result) async {
if (didPop) {
return;
}

var completer = Completer<bool>();
final NavigatorState navigator = Navigator.of(context);

Utils.confirmDelete(context, 'Discard changes?', () {
completer.complete(true);
navigator.pop();
}, deleteLabel: 'Yes', cancelLabel: 'No');

return completer.future;
},
child: SimplePage(
leadingAction: _buildLeader(context),
Expand Down
9 changes: 5 additions & 4 deletions lib/components/SiteItem.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class SiteItem extends StatelessWidget {

Widget _buildContent(BuildContext context) {
final border = BorderSide(color: Utils.configSectionBorder(context));
final dnIcon = Theme.of(context).brightness == Brightness.dark ? 'images/dn-logo-dark.svg' : 'images/dn-logo-light.svg';
final dnIcon =
Theme.of(context).brightness == Brightness.dark ? 'images/dn-logo-dark.svg' : 'images/dn-logo-light.svg';

return SpecialButton(
decoration:
Expand All @@ -39,9 +40,9 @@ class SiteItem extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
site.managed ?
Padding(padding: EdgeInsets.only(right: 10), child: SvgPicture.asset(dnIcon, width: 12)) :
Container(),
site.managed
? Padding(padding: EdgeInsets.only(right: 10), child: SvgPicture.asset(dnIcon, width: 12))
: Container(),
Expanded(child: Text(site.name, style: TextStyle(fontWeight: FontWeight.bold))),
Padding(padding: EdgeInsets.only(right: 10)),
Icon(CupertinoIcons.forward, color: CupertinoColors.placeholderText.resolveFrom(context), size: 18)
Expand Down
2 changes: 1 addition & 1 deletion lib/components/SpecialButton.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _SpecialButtonState extends State<SpecialButton> with SingleTickerProvider
Widget _buildAndroid() {
var textStyle;
if (widget.useButtonTheme) {
textStyle = Theme.of(context).textTheme.button;
textStyle = Theme.of(context).textTheme.labelLarge;
}

return Material(
Expand Down
2 changes: 1 addition & 1 deletion lib/components/SpecialTextField.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class _SpecialTextFieldState extends State<SpecialTextField> {
autofocus: widget.autofocus,
focusNode: widget.focusNode,
onChanged: widget.onChanged,
enabled: widget.enabled,
enabled: widget.enabled ?? false, // TODO: maybe there's a better way to do this? widget.enabled is nullable, should it be?
onSubmitted: (_) {
if (widget.nextFocusNode != null) {
FocusScope.of(context).requestFocus(widget.nextFocusNode);
Expand Down
2 changes: 1 addition & 1 deletion lib/components/config/ConfigHeader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

TextStyle basicTextStyle(BuildContext context) =>
Platform.isIOS ? CupertinoTheme.of(context).textTheme.textStyle : Theme.of(context).textTheme.subtitle1!;
Platform.isIOS ? CupertinoTheme.of(context).textTheme.textStyle : Theme.of(context).textTheme.titleMedium!;

const double _headerFontSize = 13.0;

Expand Down
Loading
Loading