Skip to content

Flutter upgrade to 3.41#8517

Open
jigar-f wants to merge 5 commits intomainfrom
jigar/flutter-3.41
Open

Flutter upgrade to 3.41#8517
jigar-f wants to merge 5 commits intomainfrom
jigar/flutter-3.41

Conversation

@jigar-f
Copy link
Contributor

@jigar-f jigar-f commented Mar 10, 2026

This pull request includes several important updates across the iOS and Dart/Flutter codebases. The main themes are: migration to the new Flutter iOS engine lifecycle (with corresponding changes in AppDelegate.swift and Info.plist), updates to provider and notifier code generation for Riverpod, improvements to ObjectBox database model code, and corrections to notification service method signatures.

iOS Flutter Engine Lifecycle & Scene Support:

  • Refactored AppDelegate.swift to support the new Flutter 3.41+ iOS engine lifecycle by implementing FlutterImplicitEngineDelegate, moving plugin registration and method channel setup to didInitializeImplicitFlutterEngine, and updating event handler registration to be scene lifecycle-compatible. This prepares the app for multi-window and future Flutter iOS changes.
  • Updated Info.plist to include a UIApplicationSceneManifest with FlutterSceneDelegate, enabling scene-based lifecycle and removing the deprecated UIMainStoryboardFile key.
  • Removed the MinimumOSVersion key from AppFrameworkInfo.plist for iOS, possibly to inherit the default or set elsewhere.

Riverpod Provider/Notifier Code Generation:

  • Changed generated providers from const to final and updated provider class constructors to non-const in several files (e.g., account_notifier.g.dart, auth_notifier.g.dart, developer_mode_notifier.g.dart, app_event_notifier.g.dart, path_notifier.g.dart). This aligns with recent Riverpod codegen changes and supports hot-reload and improved provider behavior. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

ObjectBox Database Model Improvements:

  • Added relationField names to relation properties in the generated ObjectBox model, improving clarity and compatibility with the latest ObjectBox generator. [1] [2] [3]
  • Added a generatorVersion field to the ObjectBox model definition to ensure compatibility and prompt regeneration if outdated.

Notification Service API Corrections:

  • Updated method signatures in NotificationService to use named parameters as required by the latest flutter_local_notifications API, fixing initialization, scheduling, and showing notifications. [1] [2] [3]

Miscellaneous:

  • Fixed import path for auth.pb.dart in user_mapper.dart for consistency and correctness.
  • Minor documentation and formatting improvements in iOS code for clarity and maintainability. [1] [2] [3]

These changes collectively modernize the app's iOS integration, ensure compatibility with updated dependencies, and improve maintainability across both native and Dart/Flutter codebases.

@jigar-f jigar-f self-assigned this Mar 10, 2026
@jigar-f jigar-f marked this pull request as ready for review March 11, 2026 08:55
@jigar-f jigar-f requested review from atavism and Copilot and removed request for Copilot March 11, 2026 08:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the project to Flutter 3.41+, updating dependency versions and aligning iOS/macOS/Android native scaffolding plus generated Dart code with new tooling outputs (Riverpod/ObjectBox/Protobuf/AutoRoute) and updated plugin APIs.

Changes:

  • Bumps Flutter/Dart constraints and updates a broad set of Dart/Flutter dependencies (plus regenerated lockfiles).
  • Migrates iOS to the Flutter 3.41+ implicit engine lifecycle and adds scene manifest support; updates Android Gradle/NDK versions.
  • Regenerates Riverpod providers, protobuf outputs, AutoRoute routes, and ObjectBox model code; adjusts notification plugin API usage.

Reviewed changes

Copilot reviewed 48 out of 53 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/radiance-macos.sh Adds macOS helper script for setting/unsetting Radiance env vars and launching the app with env overrides.
pubspec.yaml Updates Flutter/Dart SDK constraints and bumps package versions.
pubspec.lock Refreshes resolved dependency graph for new SDK/package versions.
macos/Podfile.lock Updates macOS CocoaPods lockfile for new plugin/pod versions.
macos/Podfile Raises macOS deployment target.
macos/Flutter/GeneratedPluginRegistrant.swift Regenerated macOS plugin registrant (plugin list changed).
lib/lantern/protos/protos/auth.pbserver.dart Removes generated pbserver export shim.
lib/lantern/protos/protos/auth.pbjson.dart Regenerates protobuf JSON descriptors with updated formatting/ignores.
lib/lantern/protos/protos/auth.pbenum.dart Regenerates protobuf enums header/ignores.
lib/lantern/protos/protos/auth.pb.dart Regenerates protobuf message code (formatting/API updates).
lib/lantern/lantern_service_notifier.g.dart Riverpod codegen update (providers now final, constructor non-const).
lib/features/window/provider/window_notifier.g.dart Riverpod codegen update (creation handling updated).
lib/features/vpn/provider/vpn_status_notifier.g.dart Riverpod codegen update.
lib/features/vpn/provider/vpn_notifier.g.dart Riverpod codegen update.
lib/features/vpn/provider/server_location_notifier.g.dart Riverpod codegen update.
lib/features/vpn/provider/available_servers_notifier.g.dart Riverpod codegen update.
lib/features/system_tray/provider/system_tray_notifier.g.dart Riverpod codegen update.
lib/features/split_tunneling/provider/website_notifier.g.dart Riverpod codegen update.
lib/features/split_tunneling/provider/search_query.g.dart Riverpod codegen update.
lib/features/split_tunneling/provider/apps_notifier.g.dart Riverpod codegen update.
lib/features/split_tunneling/provider/apps_data_provider.g.dart Riverpod codegen update + formatting changes for functional provider.
lib/features/split_tunneling/provider/app_list_provider.g.dart Riverpod codegen update + formatting changes for functional provider.
lib/features/split_tunneling/provider/app_icon_provider.g.dart Riverpod codegen update + family/provider formatting updates.
lib/features/private_server/provider/private_server_notifier.g.dart Riverpod codegen update.
lib/features/private_server/provider/manage_server_notifier.g.dart Riverpod codegen update.
lib/features/plans/provider/referral_notifier.g.dart Riverpod codegen update.
lib/features/plans/provider/plans_notifier.g.dart Riverpod codegen update.
lib/features/plans/provider/payment_notifier.g.dart Riverpod codegen update.
lib/features/macos_extension/provider/macos_extension_notifier.g.dart Riverpod codegen update.
lib/features/logs/provider/diagnostic_log_provider.g.dart Riverpod codegen update + functional provider formatting changes.
lib/features/home/provider/local_storage_notifier.g.dart Riverpod codegen update.
lib/features/home/provider/home_notifier.g.dart Riverpod codegen update.
lib/features/home/provider/home_notifier.dart Updates imports/formatting; switches proto import target.
lib/features/home/provider/feature_flag_notifier.g.dart Riverpod codegen update.
lib/features/home/provider/data_cap_info_provider.g.dart Riverpod codegen update.
lib/features/home/provider/app_setting_notifier.g.dart Riverpod codegen update.
lib/features/home/provider/app_event_notifier.g.dart Riverpod codegen update.
lib/features/developer/notifier/developer_mode_notifier.g.dart Riverpod codegen update.
lib/features/auth/provider/auth_notifier.g.dart Riverpod codegen update.
lib/features/account/provider/account_notifier.g.dart Riverpod codegen update.
lib/core/services/notification_service.dart Updates flutter_local_notifications calls to new named-parameter API.
lib/core/services/db/objectbox.g.dart ObjectBox model regen (adds relationField + generatorVersion).
lib/core/router/router.gr.dart AutoRoute codegen formatting changes.
lib/core/paths/path_notifier.g.dart Riverpod codegen update.
lib/core/models/mapper/user_mapper.dart Fixes proto import path (now points at auth.pb.dart).
ios/Runner/Info.plist Adds scene manifest and removes deprecated main storyboard key.
ios/Runner/AppDelegate.swift Migrates to implicit engine delegate lifecycle and scene-compatible registration.
ios/Podfile.lock Updates iOS CocoaPods lockfile for new plugin/pod versions.
ios/Flutter/AppFrameworkInfo.plist Removes MinimumOSVersion key.
android/settings.gradle Bumps Android Gradle Plugin version.
android/gradle/wrapper/gradle-wrapper.properties Bumps Gradle wrapper version.
android/app/build.gradle Updates NDK version.
Makefile Removes a build echo line.
Comments suppressed due to low confidence (2)

macos/Flutter/GeneratedPluginRegistrant.swift:23

  • path_provider_foundation is no longer imported/registered in the generated macOS plugin registrant. Since the Dart codebase uses package:path_provider/path_provider.dart on macOS (e.g. getLibraryDirectory()), this will lead to MissingPluginException at runtime for those calls. Ensure the macOS path_provider implementation is included in the plugin list and that the registrant imports/registers it (regenerate plugins if needed).
    macos/Flutter/GeneratedPluginRegistrant.swift:43
  • PathProviderPlugin.register(...) was removed from the generated macOS plugin registration list. If path_provider APIs are used on macOS (they are in PathNotifier), those method-channel calls will fail without registration. Ensure the correct macOS path_provider plugin is wired into the build and regenerate GeneratedPluginRegistrant.swift so it registers the plugin again.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import 'package:lantern/lantern/protos/protos/auth.pbserver.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

import '../../../lantern/protos/protos/auth.pb.dart';
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file now imports auth.pb.dart via a relative URI (../../../lantern/...) while other parts of the app import the same generated protos via package:lantern/.... Mixing import URIs for the same file can cause duplicate-library/type identity issues (e.g., UserResponse from one import not assignable to the other). Prefer a single canonical import style (typically package:lantern/lantern/protos/protos/auth.pb.dart) and update any other relative imports accordingly.

Suggested change
import '../../../lantern/protos/protos/auth.pb.dart';
import 'package:lantern/lantern/protos/protos/auth.pb.dart';

Copilot uses AI. Check for mistakes.
import 'package:lantern/core/models/entity/user_entity.dart';
import 'package:lantern/lantern/protos/protos/auth.pbserver.dart';

import '../../../lantern/protos/protos/auth.pb.dart';
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auth.pb.dart is imported via a relative URI here, while other files import it via package:lantern/.... Importing the same generated library under different URIs can create distinct types at compile time (e.g., two different UserResponse classes), leading to hard-to-diagnose build errors. Use a single canonical import (typically the package: URI) consistently across the codebase.

Suggested change
import '../../../lantern/protos/protos/auth.pb.dart';
import 'package:lantern/protos/protos/auth.pb.dart';

Copilot uses AI. Check for mistakes.
GeneratedPluginRegistrant.register(with: registry)

// Configure Flutter local notifications background isolate.
// notificationSetup()
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notificationSetup() is no longer invoked (it’s commented out in didInitializeImplicitFlutterEngine, and not called in didFinishLaunchingWithOptions). This will prevent FlutterLocalNotificationsPlugin.setPluginRegistrantCallback from being set, breaking background notification handling (and potentially foreground delegate setup) on iOS. Call notificationSetup() during engine initialization (or otherwise ensure the callback and UNUserNotificationCenter delegate are set exactly once).

Suggested change
// notificationSetup()
notificationSetup()

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants