Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrader doesn't seem to work with CupertinoApp #482

Open
gaieges opened this issue Jan 13, 2025 · 1 comment
Open

Upgrader doesn't seem to work with CupertinoApp #482

gaieges opened this issue Jan 13, 2025 · 1 comment

Comments

@gaieges
Copy link

gaieges commented Jan 13, 2025

I have a pretty simple app who's root is using CupertinoApp, and when I use the upgrader like so, it seems to get instantiated and throws some logs, but doesn't present the popup. Any ideas as to how to work around this?

With CupertinoApp

    return CupertinoApp(
      home: UpgradeAlert(
        dialogStyle: UpgradeDialogStyle.cupertino,
        upgrader: Upgrader(
          debugDisplayAlways: true,
        ),
        child: const Center(
          child: Text('Hello'),
        ),
      ),
    );

Logs:

flutter: upgrader: instantiated
flutter: upgrader: build UpgradeAlert
flutter: upgrader: need to evaluate version

Using MaterialApp

Code:

    return MaterialApp(
      home: UpgradeChecker(
        child: const Center(
          child: Text('Hello'),
        ),
      ),
    );

Logs (a little more extensive):

flutter: upgrader: instantiated
flutter: upgrader: initialize called
flutter: upgrader: build UpgradeAlert
flutter: upgrader: initializing
flutter: upgrader: operatingSystem: ios, version: Version 18.2 (Build 22C150)
flutter: upgrader: packageInfo packageName: io.custompod.app
flutter: upgrader: packageInfo appName: CustomPod.io
flutter: upgrader: packageInfo version: 2.0.0
flutter: upgrader: current locale: en_US
flutter: upgrader: countryCode: US
flutter: upgrader: languageCode: en
flutter: upgrader: download: https://itunes.apple.com/lookup?bundleId=io.custompod.app&country=US&lang=en&_cb=1736789092080513
flutter: upgrader: response statusCode: 200
flutter: upgrader: UpgraderAppStore: version info: appStoreListingURL: https://apps.apple.com/us/app/custompod/id6736601107?uo=4, appStoreVersion: 3.1.0, installedVersion: 2.0.0, isCriticalUpdate: null, minAppVersion: null, releaseNotes: - Ability to change voices
- Update to high quality voices and audio
- Ability to schedule generation of briefings at any time in the day
- Minor UI tweaks
flutter: upgrader: need to evaluate version
flutter: upgrader: blocked: false
flutter: upgrader: debugDisplayAlways: true
flutter: upgrader: debugDisplayOnce: false
flutter: upgrader: hasAlerted: false
flutter: upgrader: shouldDisplayUpgrade: true
flutter: upgrader: shouldDisplayReleaseNotes: true
flutter: upgrader: current locale: en_US
flutter: upgrader: languageCode: en
flutter: upgrader: showTheDialog title: Update App?
flutter: upgrader: showTheDialog message: A new version of CustomPod.io is available! Version 3.1.0 is now available-you have 2.0.0.
flutter: upgrader: showTheDialog releaseNotes: - Ability to change voices
- Update to high quality voices and audio
- Ability to schedule generation of briefings at any time in the day
- Minor UI tweaks
flutter: upgrader: onCanPop called

Version

  upgrader:
    dependency: "direct main"
    description:
      name: upgrader
      sha256: eb5a4888873d7998605306c4212491efdff8e59ee609d946dbcd6df83598d004
      url: "https://pub.dev"
    source: hosted
    version: "11.3.1"

@rosebm
Copy link

rosebm commented Feb 6, 2025

Similar issue for me, I'm using CupertinoApp.router and when running I get this error:

flutter: No MaterialLocalizations found.
StreamBuilder widgets require MaterialLocalizations to be provided by a Localizations widget ancestor.
The material library uses Localizations to generate messages, labels, and abbreviations.
To introduce a MaterialLocalizations, either use a MaterialApp at the root of your application to include them automatically, or add a Localization widget with a MaterialLocalizations delegate.
The specific widget that could not find a MaterialLocalizations ancestor was:
StreamBuilder
The ancestors of this widget were:
UpgradeAlert
Builder
DefaultTextStyle
ValueListenableBuilder
Title
Directionality
_LocalizationsScope-[GlobalKey#1e83a]
Semantics
Localizations
Semantics
_FocusInheritedScope
Focus
Shortcuts
_ShortcutRegistrarScope
ShortcutRegistrar
TapRegionSurface
_FocusInheritedScope
Focus
FocusTraversalGroup
_ActionsScope
Actions
Semantics
_FocusInheritedScope
Focus
Shortcuts
<…>
flutter:
#0 debugCheckHasMaterialLocalizations. (package:flutter/src/material/debug.dart:93:7)
#1 debugCheckHasMaterialLocalizations (package:flutter/src/material/debug.dart:113:4)
#2 showDialog (package:flutter/src/material/dialog.dart:1421:10)
#3 UpgradeAlertState.showTheDialog (package:upgrader/src/upgrade_alert.dart:234:5)
#4 UpgradeAlertState.checkVersion. (package:upgrader/src/upgrade_alert.dart:144:9)
#5 new Future.delayed. (dart:async/future.dart:431:42)
#6 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
#7 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#8 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#9 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
flutter: ----------------------------------------------------

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

No branches or pull requests

2 participants