Skip to content

Commit

Permalink
Bump Flutter to 3.22 (#1242)
Browse files Browse the repository at this point in the history
  • Loading branch information
limwa authored Jun 24, 2024
2 parents 94410bf + 786b863 commit 3ab886a
Show file tree
Hide file tree
Showing 19 changed files with 99 additions and 51 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
environment:
name: ${{ github.ref_name }}
env:
PROPERTIES_PATH: "android/key.properties"
JAVA_VERSION: "17.x"
APP_VERSION_PATH: "app_version.txt"
PUBSPEC_PATH: "pubspec.yaml"
PROPERTIES_PATH: android/key.properties
JAVA_VERSION: 21.x
APP_VERSION_PATH: app_version.txt
PUBSPEC_PATH: pubspec.yaml
defaults:
run:
working-directory: ./uni
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/format_lint_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches: [master, develop]

env:
JAVA_VERSION: 17.x
JAVA_VERSION: 21.x

jobs:
format:
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
run: flutter test --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
23 changes: 16 additions & 7 deletions uni/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "com.android.application"
id "dev.flutter.flutter-gradle-plugin"
id "org.jetbrains.kotlin.android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
Expand Down Expand Up @@ -32,16 +32,20 @@ android {
namespace "pt.up.fe.ni.uni"

compileSdkVersion 34
ndkVersion flutter.ndkVersion
ndkVersion "25.1.8937393"

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_11

// This is required by flutter_local_notifications. See its README.
coreLibraryDesugaringEnabled true
}

kotlinOptions {
jvmTarget = "11"
}

sourceSets {
main.java.srcDirs += "src/main/kotlin"
}
Expand All @@ -66,6 +70,11 @@ android {
buildTypes {
release {
signingConfig signingConfigs.release

proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
}
Expand All @@ -77,7 +86,7 @@ flutter {
dependencies {
// The following 3 lines are a workaround for the Flutter issue.
// Learn more: https://github.com/flutter/flutter/issues/110658
implementation "androidx.window:window:1.0.0"
implementation "androidx.window:window-java:1.0.0"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.2.2"
implementation "androidx.window:window:1.3.0"
implementation "androidx.window:window-java:1.3.0"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4"
}
29 changes: 29 additions & 0 deletions uni/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# The 6 lines below are added to fix #1243
-dontwarn com.google.errorprone.annotations.CanIgnoreReturnValue
-dontwarn com.google.errorprone.annotations.CheckReturnValue
-dontwarn com.google.errorprone.annotations.Immutable
-dontwarn com.google.errorprone.annotations.RestrictedApi
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.concurrent.GuardedBy
2 changes: 1 addition & 1 deletion uni/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
1 change: 1 addition & 0 deletions uni/lib/view/common_widgets/generic_expansion_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ abstract class GenericExpansionCard extends StatelessWidget {
?.apply(color: Theme.of(context).primaryColor),
),
elevation: 0,
baseColor: Theme.of(context).colorScheme.surface,
children: <Widget>[
Container(
padding: const EdgeInsets.fromLTRB(12, 0, 12, 12),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ abstract class GeneralPageViewState<T extends StatefulWidget> extends State<T> {

Widget getScaffold(BuildContext context, Widget body) {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
bottomNavigationBar: const AppBottomNavbar(),
appBar: getTopNavbar(context),
body: RefreshState(onRefresh: onRefresh, child: body),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class AppBottomNavbar extends StatelessWidget {
highlightColor: Colors.transparent,
),
child: BottomNavigationBar(
backgroundColor: Theme.of(context).colorScheme.surface,
items: navbarItems,
onTap: (index) => _onItemTapped(context, index),
currentIndex: currentIndex == -1 ? 0 : currentIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class AppTopNavbar extends StatelessWidget implements PreferredSizeWidget {
automaticallyImplyLeading: false,
elevation: 0,
iconTheme: Theme.of(context).iconTheme,
backgroundColor: Theme.of(context).colorScheme.background,
backgroundColor: Theme.of(context).colorScheme.surface,
shadowColor: Theme.of(context).dividerColor,
surfaceTintColor: Theme.of(context).colorScheme.onSecondary,
titleSpacing: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ abstract class SecondaryPageViewState<T extends StatefulWidget>
@override
Scaffold getScaffold(BuildContext context, Widget body) {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
appBar: getTopNavbar(context),
bottomNavigationBar: const AppBottomNavbar(),
body: RefreshState(onRefresh: onRefresh, child: body),
Expand Down
1 change: 1 addition & 0 deletions uni/lib/view/home/widgets/main_cards_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class MainCardsListState extends State<MainCardsList> {
return true;
},
child: Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
body: BackButtonExitWrapper(
child: SizedBox(
height: MediaQuery.of(context).size.height,
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/view/home/widgets/remaining_exams_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RemainingExamsWidget extends StatelessWidget {
return Container(
margin: const EdgeInsets.only(top: 8),
child: RowContainer(
color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.surface,
child: Container(
padding: const EdgeInsets.all(11),
child: Row(
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/view/locations/widgets/floorless_marker_popup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class FloorlessLocationMarkerPopup extends StatelessWidget {
Widget build(BuildContext context) {
final locations = locationGroup.floors.values.expand((x) => x).toList();
return Card(
color: Theme.of(context).colorScheme.background.withOpacity(0.8),
color: Theme.of(context).colorScheme.surface.withOpacity(0.8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/view/locations/widgets/marker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LocationMarker extends Marker {
point: latlng,
builder: (context) => DecoratedBox(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.surface,
border: Border.all(
color: Theme.of(context).colorScheme.primary,
),
Expand Down
2 changes: 1 addition & 1 deletion uni/lib/view/locations/widgets/marker_popup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class LocationMarkerPopup extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Card(
color: Theme.of(context).colorScheme.background.withOpacity(0.8),
color: Theme.of(context).colorScheme.surface.withOpacity(0.8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
Expand Down
7 changes: 5 additions & 2 deletions uni/lib/view/profile/widgets/create_print_mb_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,11 @@ Future<void> addMoneyDialog(BuildContext context) async {
);
}

final CurrencyTextInputFormatter formatter =
CurrencyTextInputFormatter(locale: 'pt', decimalDigits: 2, symbol: '€ ');
final formatter = CurrencyTextInputFormatter.currency(
locale: 'pt',
decimalDigits: 2,
symbol: '€ ',
);

double valueTextToNumber(String value) =>
double.parse(value.substring(0, value.length - 2).replaceAll(',', '.'));
Expand Down
6 changes: 4 additions & 2 deletions uni/lib/view/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ ThemeData applicationLightTheme = ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(
seedColor: darkRed,
background: _mildWhite,
surface: _mildWhite,
surfaceContainer: _mildWhite,
primary: darkRed,
onPrimary: Colors.white,
secondary: darkRed,
Expand All @@ -55,7 +56,8 @@ ThemeData applicationDarkTheme = ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: lightRed,
brightness: Brightness.dark,
background: _darkBlack,
surface: _darkBlack,
surfaceContainer: _darkBlack,
primary: _lightGrey,
onPrimary: _darkishBlack,
secondary: _lightBlue,
Expand Down
48 changes: 24 additions & 24 deletions uni/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ packages:
dependency: "direct main"
description:
name: currency_text_input_formatter
sha256: b60c298fec9f0e96dfad88d25d026a6bf43f4e2bb9c59218afd8de1e09f54a60
sha256: d2eed8c7d40520729ac38252368954aba430a7ee510e5d5357e45cde1f6417a6
url: "https://pub.dev"
source: hosted
version: "2.1.11"
version: "2.2.3"
custom_lint:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -649,10 +649,10 @@ packages:
dependency: "direct main"
description:
name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.18.1"
version: "0.19.0"
io:
dependency: transitive
description:
Expand Down Expand Up @@ -689,34 +689,34 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.1"
leancode_lint:
dependency: "direct dev"
description:
name: leancode_lint
sha256: a0130e0dbe5d5ea2f03f7ba7fa097f0fd44be9dc43d3d7badd6d09cc50015384
sha256: "85b7c09c806400083faa37304c701fd1bd5dbcb826882438dd50f0e465f30fd8"
url: "https://pub.dev"
source: hosted
version: "11.0.0"
version: "13.0.0"
lists:
dependency: transitive
description:
Expand Down Expand Up @@ -777,10 +777,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.12.0"
mgrs_dart:
dependency: transitive
description:
Expand Down Expand Up @@ -1279,26 +1279,26 @@ packages:
dependency: "direct dev"
description:
name: test
sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f
sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073"
url: "https://pub.dev"
source: hosted
version: "1.24.9"
version: "1.25.2"
test_api:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.0"
test_core:
dependency: transitive
description:
name: test_core
sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a
sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4"
url: "https://pub.dev"
source: hosted
version: "0.5.9"
version: "0.6.0"
timelines:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1479,10 +1479,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "14.2.1"
watcher:
dependency: transitive
description:
Expand Down Expand Up @@ -1564,5 +1564,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.22.0"
Loading

0 comments on commit 3ab886a

Please sign in to comment.