Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 8 additions & 11 deletions .github/workflows/flutter_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ jobs:
build_ios:
name: (iOS)
runs-on: macos-latest
timeout-minutes: 15
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "16.4" # Set to a specific recent stable Xcode version
xcode-version: "16.4"

- uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17" # Use JDK 17 for better compatibility
java-version: "21"

- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.38.3" # Latest stable Flutter version as of Dec 05 2025
flutter-version: "3.44.0"

- run: flutter clean
- run: flutter --version
Expand All @@ -39,21 +39,20 @@ jobs:
name: (Android)
runs-on: ubuntu-latest
timeout-minutes: 20
# Removed the 'strategy' block with 'api-level' and 'target' matrix
steps:
- uses: actions/checkout@v4

- name: Set up Java Development Kit
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "21" # Keeping Java 21 as per your current setup
java-version: "21"

- name: Set up Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.38.3" # Latest stable Flutter version as of Dec 05 2025
flutter-version: "3.44.0"

- name: Clean Flutter project
run: flutter clean
Expand All @@ -70,7 +69,6 @@ jobs:
- name: Generate localization files
run: flutter gen-l10n

# Cache Gradle dependencies for faster subsequent builds
- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
Expand All @@ -81,6 +79,5 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-

# Build the Android APK (Debug)
- name: Build Android APK (Debug)
run: flutter build apk -t "lib/mains/main_netknights.dart" --debug --flavor netknights
13 changes: 5 additions & 8 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,19 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17" # Using JDK 17 for broader compatibility
java-version: "21"

- name: Set up Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.38.3" # Use the latest stable Flutter version as of Dec 05 2025
cache: true # Enable caching for Flutter SDK itself
# cache-key and cache-path are automatically handled by subosito/flutter-action when cache: true
flutter-version: "3.44.0"
cache: true

- name: Cache Flutter Pub dependencies
uses: actions/cache@v4
with:
path: |
${{ runner.tool_cache }}/flutter_plugin_cache # This is often included in ~/.pub-cache, but good to be explicit
~/.pub-cache
path: ~/.pub-cache
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-flutter-
Expand All @@ -53,4 +50,4 @@ jobs:
run: flutter gen-l10n

- name: Run Flutter tests
run: flutter test --no-pub # Use --no-pub since pub get was already run/cached
run: flutter test --no-pub
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
.buildlog/
.history
.svn/
*.local.*

# IntelliJ related
*.iml
Expand All @@ -30,6 +31,7 @@ build/
# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/.kotlin/
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
Expand Down
11 changes: 6 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
// END: FlutterFire Configuration
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

Expand Down Expand Up @@ -62,10 +61,6 @@ android {
targetCompatibility = JavaVersion.VERSION_21
}

kotlinOptions {
jvmTarget = '21'
}

defaultConfig {
applicationId "it.netknights.piauthenticator"
minSdkVersion flutter.minSdkVersion
Expand Down Expand Up @@ -140,3 +135,9 @@ android {
flutter {
source '../..'
}

kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21
}
}
3 changes: 0 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
android:icon="@mipmap/ic_launcher"
android:enableOnBackInvokedCallback="true"
android:requestLegacyExternalStorage="true">
<meta-data
android:name="io.flutter.embedding.android.EnableImpeller"
android:value="false" />
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
6 changes: 5 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ org.gradle.parallel=true
org.gradle.caching=true

android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=true
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
2 changes: 1 addition & 1 deletion 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.11.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
4 changes: 2 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.9.1" apply false // Android Gradle Plugin
id "com.android.application" version "8.11.1" apply false // Android Gradle Plugin
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
// END: FlutterFire Configuration
id 'org.jetbrains.kotlin.android' version '2.1.0' apply false
id 'org.jetbrains.kotlin.android' version '2.2.20' apply false
}

include ":app"
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ post_install do |installer|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.6'
# You can remove unused permissions here
# for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h
# e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
Expand Down
43 changes: 23 additions & 20 deletions lib/model/pi_server_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ sealed class PiServerResponse<
const PiServerResponse._();
factory PiServerResponse.success({
required int statusCode,
required int id,
required String jsonrpc,
@Default(null) int? id,
@Default(null) String? jsonrpc,
required PiServerResult<V> result,
required double time,
required String version,
required String versionNumber,
@Default(null) double? time,
@Default(null) String? version,
@Default(null) String? versionNumber,
@Default(null) String? signature,
@Default(null) D? detail,
}) = PiSuccessResponse;
Expand All @@ -64,15 +64,15 @@ sealed class PiServerResponse<

factory PiServerResponse.error({
required int statusCode,
required int id,
required String jsonrpc,
@Default(null) int? id,
@Default(null) String? jsonrpc,
@Default(null) D? detail,

/// This is a throwable error
required PiServerResultError piServerResultError,
required double time,
required String version,
required String versionNumber,
@Default(null) double? time,
@Default(null) String? version,
@Default(null) String? versionNumber,
@Default(null) String? signature,
}) = PiErrorResponse;
bool get isError => this is PiErrorResponse;
Expand All @@ -87,12 +87,15 @@ sealed class PiServerResponse<
final map = validateMap(
map: json,
validators: <String, BaseValidator>{
ID: Validators.intType,
JSONRPC: Validators.string,
ID: Validators.intOptional,
JSONRPC: Validators.stringOptional,
RESULT: RequiredObjectValidator<Map<String, dynamic>>(),
TIME: RequiredObjectValidator<double>(),
VERSION: RequiredObjectValidator<String>(
allowedValues: (v) => v.contains(' '),
TIME: OptionalObjectValidator<double>(),
VERSION: OptionalObjectValidator<String>(
transformer: (v) {
final s = v as String;
return s.contains(' ') ? s : null;
},
),
VERSION_NUMBER: Validators.stringOptional,
DETAIL: OptionalObjectValidator<Object>(),
Expand All @@ -102,16 +105,16 @@ sealed class PiServerResponse<
);
return PiServerResponse<V, D>.success(
statusCode: statusCode,
id: map[ID] as int,
jsonrpc: map[JSONRPC] as String,
id: map[ID] as int?,
jsonrpc: map[JSONRPC] as String?,
result: PiServerResult<V>.fromResultMap(
map[RESULT] as Map<String, dynamic>,
),
time: map[TIME] as double,
version: map[VERSION] as String,
time: map[TIME] as double?,
version: map[VERSION] as String?,
versionNumber:
map[VERSION_NUMBER] as String? ??
(map[VERSION] as String).split(' ')[1],
(map[VERSION] as String?)?.split(' ')[1],
detail: PiServerResultDetail.fromResultDetail<D>(map[DETAIL]),
signature: map[SIGNATURE] as String?,
);
Expand Down
32 changes: 16 additions & 16 deletions lib/model/pi_server_response.freezed.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import 'package:flutter/material.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';

import '../../../../l10n/app_localizations.dart';
import '../../../../model/token_container.dart';
Expand Down Expand Up @@ -56,7 +55,7 @@ class TransferContainerAction extends ConsumerSlideableAction {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(MdiIcons.transfer),
Icon(Icons.compare_arrows),
Text(
AppLocalizations.of(context)!.transferButton,
overflow: TextOverflow.fade,
Expand Down
Loading
Loading