Skip to content

Commit

Permalink
feat: flutter 3.27 (#1328)
Browse files Browse the repository at this point in the history
* chore: update deps

* chore: update firebase config

* chore: upgrade android config

* chore: upgrade flutter version in ci/cd pipelines

* fix: update deprecated functions

* chore: update flutter version in codemagic

* fix: update deprecated functions
  • Loading branch information
Nirajn2311 authored Feb 10, 2025
1 parent 42c8530 commit 3a0cec3
Show file tree
Hide file tree
Showing 32 changed files with 104 additions and 92 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/flutter-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ jobs:
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Setup Flutter 3.24.x
- name: Setup Flutter 3.27.x
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # v2
with:
flutter-version: "3.24.x"
flutter-version: "3.27.x"
channel: "stable"
cache: true
cache-key: flutter-3.24.x
cache-key: flutter-3.27.x
cache-path: ${{ runner.tool_cache }}/flutter

- name: Create .env file
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/flutter-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ jobs:
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Setup Flutter 3.24.x
- name: Setup Flutter 3.27.x
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # v2
with:
flutter-version: "3.24.x"
flutter-version: "3.27.x"
channel: "stable"
cache: true
cache-key: flutter-3.24.x
cache-key: flutter-3.27.x
cache-path: ${{ runner.tool_cache }}/flutter

- name: Create .env file
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/mobile-curriculum-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Setup Flutter 3.24.x
- name: Setup Flutter 3.27.x
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # v2
with:
flutter-version: "3.24.x"
flutter-version: "3.27.x"
channel: "stable"
cache: true
cache-key: flutter-3.24.x
cache-key: flutter-3.27.x
cache-path: ${{ runner.tool_cache }}/flutter

- name: Set freeCodeCamp Environment Variables
Expand Down
4 changes: 2 additions & 2 deletions codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ workflows:
cancel_previous_builds: true

environment:
flutter: 3.24.4
flutter: 3.27.4
xcode: latest
cocoapods: default
groups:
Expand Down Expand Up @@ -86,7 +86,7 @@ workflows:
cancel_previous_builds: true

environment:
flutter: 3.24.4
flutter: 3.27.4
xcode: latest
cocoapods: default
ios_signing:
Expand Down
10 changes: 10 additions & 0 deletions mobile-app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,23 @@ if (keystorePropertiesFile.exists()) {
}

android {
namespace 'org.freecodecamp'
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "org.freecodecamp"
minSdkVersion 22
Expand Down
2 changes: 1 addition & 1 deletion mobile-app/android/app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"project_info": {
"project_number": "363152234407",
"project_id": "mobile-4ee8a",
"storage_bucket": "mobile-4ee8a.appspot.com"
"storage_bucket": "mobile-4ee8a.firebasestorage.app"
},
"client": [
{
Expand Down
3 changes: 1 addition & 2 deletions mobile-app/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.freecodecamp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
3 changes: 1 addition & 2 deletions mobile-app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.freecodecamp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
Expand Down
3 changes: 1 addition & 2 deletions mobile-app/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.freecodecamp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
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-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
2 changes: 1 addition & 1 deletion mobile-app/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.1" apply false
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.10" apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
Expand Down
2 changes: 1 addition & 1 deletion mobile-app/firebase.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"mobile-4ee8a","appId":"1:363152234407:android:6293f9873ae6df8a738882","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"mobile-4ee8a","appId":"1:363152234407:ios:17273b86fa3ff2e4738882","uploadDebugSymbols":true,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"mobile-4ee8a","configurations":{"android":"1:363152234407:android:6293f9873ae6df8a738882","ios":"1:363152234407:ios:17273b86fa3ff2e4738882"}}}}}}
{"flutter":{"platforms":{"android":{"default":{"projectId":"mobile-4ee8a","appId":"1:363152234407:android:6293f9873ae6df8a738882","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"mobile-4ee8a","appId":"1:363152234407:ios:17273b86fa3ff2e4738882","uploadDebugSymbols":true,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"mobile-4ee8a","configurations":{"android":"1:363152234407:android:6293f9873ae6df8a738882","ios":"1:363152234407:ios:17273b86fa3ff2e4738882"}}}}}}
24 changes: 12 additions & 12 deletions mobile-app/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
1C597F686835D36FC3A68074 /* [CP] Embed Pods Frameworks */,
EE24453AE42173152314E05C /* FlutterFire: "flutterfire upload-crashlytics-symbols" */,
8D9BD886D819A552432EB427 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */,
);
buildRules = (
);
Expand Down Expand Up @@ -259,38 +259,38 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
8D9BD886D819A552432EB427 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Run Script";
name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\"";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
shellScript = "\n#!/bin/bash\nPATH=\"${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\"\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=\"$PODS_ROOT/FirebaseCrashlytics/upload-symbols\" --platform=ios --apple-project-path=\"${SRCROOT}\" --env-platform-name=\"${PLATFORM_NAME}\" --env-configuration=\"${CONFIGURATION}\" --env-project-dir=\"${PROJECT_DIR}\" --env-built-products-dir=\"${BUILT_PRODUCTS_DIR}\" --env-dwarf-dsym-folder-path=\"${DWARF_DSYM_FOLDER_PATH}\" --env-dwarf-dsym-file-name=\"${DWARF_DSYM_FILE_NAME}\" --env-infoplist-path=\"${INFOPLIST_PATH}\" --default-config=default\n";
};
EE24453AE42173152314E05C /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = {
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\"";
outputFileListPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=ios --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default\n";
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
2 changes: 1 addition & 1 deletion mobile-app/ios/Runner/GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>PROJECT_ID</key>
<string>mobile-4ee8a</string>
<key>STORAGE_BUCKET</key>
<string>mobile-4ee8a.appspot.com</string>
<string>mobile-4ee8a.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
Expand Down
7 changes: 4 additions & 3 deletions mobile-app/lib/firebase_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@ class DefaultFirebaseOptions {
appId: '1:363152234407:android:6293f9873ae6df8a738882',
messagingSenderId: '363152234407',
projectId: 'mobile-4ee8a',
storageBucket: 'mobile-4ee8a.appspot.com',
storageBucket: 'mobile-4ee8a.firebasestorage.app',
);

static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyCFcTnIuxW7AeskmoNwbrEZX_ZvYz-aAdw',
appId: '1:363152234407:ios:17273b86fa3ff2e4738882',
messagingSenderId: '363152234407',
projectId: 'mobile-4ee8a',
storageBucket: 'mobile-4ee8a.appspot.com',
storageBucket: 'mobile-4ee8a.firebasestorage.app',
iosClientId: '363152234407-qb25f7aak3egr8iod13bhsltjgf8viuq.apps.googleusercontent.com',
iosBundleId: 'org.freecodecamp.ios',
);
}

}
4 changes: 2 additions & 2 deletions mobile-app/lib/ui/views/learn/block/block_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class BlockView extends StatelessWidget {
fontWeight: FontWeight.w600,
height: 1.2,
fontFamily: 'Lato',
color: Colors.white.withOpacity(0.87),
color: Colors.white.withValues(alpha: 0.87),
),
),
),
Expand Down Expand Up @@ -367,7 +367,7 @@ class ChallengeTile extends StatelessWidget {
border: Border.all(
color: isDowloaded && model.isDownloading && isCompleted
? Colors.green
: Colors.white.withOpacity(0.01),
: Colors.white.withValues(alpha: 0.01),
width: isDowloaded && model.isDownloading && isCompleted ? 5 : 1,
),
color: isCompleted
Expand Down
6 changes: 3 additions & 3 deletions mobile-app/lib/ui/views/learn/challenge/challenge_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,9 @@ class SymbolBar extends StatelessWidget {
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Colors.white.withOpacity(0.13),
Colors.white.withOpacity(0.23),
Colors.white.withOpacity(0.33),
Colors.white.withValues(alpha: 0.13),
Colors.white.withValues(alpha: 0.23),
Colors.white.withValues(alpha: 0.33),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ class JavaScriptConsoleViewModel extends BaseViewModel {
Color getConsoleTextColor(ConsoleMessageLevel messageLevel) {
switch (messageLevel.toString()) {
case 'ConsoleMessageLevel.DEBUG':
return Colors.white.withOpacity(0.87);
return Colors.white.withValues(alpha: 0.87);
case 'ConsoleMessageLevel.ERROR':
return Colors.red.withOpacity(0.87);
return Colors.red.withValues(alpha: 0.87);
case 'ConsoleMessageLevel.LOG':
return Colors.white.withOpacity(0.87);
return Colors.white.withValues(alpha: 0.87);
case 'ConsoleMessageLevel.TIP':
return Colors.blue.withOpacity(0.87);
return Colors.blue.withValues(alpha: 0.87);
case 'ConsoleMessageLevel.WARNING':
return Colors.yellow.withOpacity(0.87);
return Colors.yellow.withValues(alpha: 0.87);
default:
return Colors.white.withOpacity(0.87);
return Colors.white.withValues(alpha: 0.87);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class HintWidgetView extends StatelessWidget {
fontSize: 28,
fontWeight: FontWeight.bold,
fontFamily: 'Inter',
color: Colors.white.withOpacity(0.87),
color: Colors.white.withValues(alpha: 0.87),
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:stacked/stacked.dart';
class PassWidgetModel extends BaseViewModel {
final AuthenticationService auth = locator<AuthenticationService>();

// TODO: Investigate why this keeps getting thrown as not been initialized - LateInitializationError
late FccUserModel? _user;

void init() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PassWidgetView extends StatelessWidget {
fontSize: 28,
fontFamily: 'Inter',
fontWeight: FontWeight.bold,
color: Colors.white.withOpacity(0.87),
color: Colors.white.withValues(alpha: 0.87),
),
),
),
Expand Down Expand Up @@ -66,7 +66,7 @@ class PassWidgetView extends StatelessWidget {
child: Text(
'"${quote.quote}"',
style: TextStyle(
color: Colors.white.withOpacity(0.87),
color: Colors.white.withValues(alpha: 0.87),
fontSize: 20,
fontFamily: 'Inter',
),
Expand Down
10 changes: 6 additions & 4 deletions mobile-app/lib/ui/views/login/native_login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,9 @@ class NativeLoginView extends StatelessWidget {
child: Text(
context.t.login_data_message,
textAlign: TextAlign.center,
style:
TextStyle(color: Colors.white.withOpacity(0.87)),
style: TextStyle(
color: Colors.white.withValues(alpha: 0.87),
),
),
),
)
Expand All @@ -259,8 +260,9 @@ class NativeLoginView extends StatelessWidget {
child: Text(
context.t.login_age_message,
textAlign: TextAlign.center,
style:
TextStyle(color: Colors.white.withOpacity(0.87)),
style: TextStyle(
color: Colors.white.withValues(alpha: 0.87),
),
),
),
)
Expand Down
4 changes: 2 additions & 2 deletions mobile-app/lib/ui/views/news/html_handler/html_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class HTMLParser {
),
'*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': Style(
fontSize: FontSize.xLarge,
color: fontColor ?? Colors.white.withOpacity(0.87),
color: fontColor ?? Colors.white.withValues(alpha: 0.87),
fontWeight:
fontFamily == 'Inter' ? FontWeight.w400 : FontWeight.normal,
),
Expand Down Expand Up @@ -147,7 +147,7 @@ class HTMLParser {
'code': Style(
backgroundColor: const Color.fromRGBO(0x3b, 0x3b, 0x4f, 0.5),
padding: HtmlPaddings.symmetric(vertical: 2, horizontal: 4),
color: Colors.white.withOpacity(0.87),
color: Colors.white.withValues(alpha: 0.87),
fontSize: FontSize.xLarge,
fontFamily: 'Roboto Mono',
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ class NewsSearchView extends StatelessWidget {
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white.withOpacity(0.87),
color:
Colors.white.withValues(alpha: 0.87),
),
),
onTap: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class NewsTutorialViewModel extends BaseViewModel {
margin: const EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Colors.black.withOpacity(0.5),
color: Colors.black.withValues(alpha: 0.5),
),
child: const Icon(Icons.arrow_back),
),
Expand Down
Loading

0 comments on commit 3a0cec3

Please sign in to comment.