fix: resolve startup crash and CrashScreen button crashes (#127)
Two bugs caused the crash-at-startup report: 1. CrashScreen used the widget's build context (above its own MaterialApp) for ScaffoldMessenger.of() in button callbacks. When the screen is the root widget — the runApp() path after a startup crash — there is no ScaffoldMessenger above it, so both 'Copy to Clipboard' and 'Report Issue on Codeberg' crashed with a null check error. Fix: wrap Scaffold.body in Builder to obtain a context that is a descendant of the Scaffold. 2. path_provider_android 2.2.21 updated to Pigeon 26, which causes a channel-error on startup for some Android devices. Pin to <2.2.21 (resolves to 2.2.20, which uses the stable pre-Pigeon-26 implementation). Additionally, make initDatabasePath() catch PlatformException so a channel error at the very start of main() no longer hard-crashes the app; _openConnection()'s lazy fallback retries after runApp() completes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
c4e7042430
commit
23cbe4611c
+2
-2
@@ -731,10 +731,10 @@ packages:
|
||||
dependency: "direct overridden"
|
||||
description:
|
||||
name: path_provider_android
|
||||
sha256: "149441ca6e4f38193b2e004c0ca6376a3d11f51fa5a77552d8bd4d2b0c0912ba"
|
||||
sha256: e122c5ea805bb6773bb12ce667611265980940145be920cd09a4b0ec0285cb16
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.23"
|
||||
version: "2.2.20"
|
||||
path_provider_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user