larryaasen / upgrader

A Flutter package for prompting users to upgrade when there is a newer version of the app in the store.
MIT License
531 stars 262 forks source link

UpgradeCard does not show and scroll release notes properly #299

Closed janmiderback closed 8 months ago

janmiderback commented 1 year ago

Problem

I have added upgrader to two different apps. In one app I use UpgradeAlert and in another app I'm using UpgradeCard since that app has a different upgrade flow.

I had earlier problems in getting release notes to show properly and be scrollable, but when upgrading to 7.1.0 I noticed that scrolling of release notes works properly when using UpgradeAlert.

However, UpgradeCard does not seem to work correctly.

Code

I'm using an UpgraderMessages implementation, that looks something like this:

class _CustomUpgraderMessages extends UpgraderMessages {
  @override
  String get title => '<...>';

  @override
  String get body => '<...>';

  @override
  String get buttonTitleUpdate => '<...>';

  ...

  @override
  String get releaseNotes => '<...>';
}

and it is passed something like this:

Upgrader(
      countryCode: '***',
      messages: _CustomUpgraderMessages(),
      debugLogging: kDebugMode,
      durationUntilAlertAgain: Duration.zero,
      showIgnore: false,
      showLater: false,
    )

--EDIT--

Our single Upgrader instance is passed to UpgraderCard like this:

UpgradeCard(margin: EdgeInsets.zero, upgrader: upgrader)

so it should not be a problem of UpgraderCard using any other instance.

Expected behavior

Actual behavior

Log

I/flutter ( 7167): UpgradeCard: build UpgradeCard
I/flutter ( 7167): upgrader: initialize called
I/flutter ( 7167): upgrader: blocked: false
I/flutter ( 7167): upgrader: debugDisplayAlways: true
I/flutter ( 7167): upgrader: debugDisplayOnce: false
I/flutter ( 7167): upgrader: hasAlerted: false
I/flutter ( 7167): upgrader: shouldDisplayUpgrade: true
I/flutter ( 7167): UpgradeCard: will display
I/flutter ( 7167): UpgradeCard: showDialog title: Uppdatera
I/flutter ( 7167): UpgradeCard: showDialog message: Version *** av *** är tillgänglig.
I/flutter ( 7167): UpgradeCard: shouldDisplayReleaseNotes: true
I/flutter ( 7167): UpgradeCard: showDialog releaseNotes: aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfjhaksjfhaksjdfghalskjgaslkjdfhaslkjdfhaslkjdfhaslkjdfhaslkf
I/flutter ( 7167):       aksfj
I/flutter ( 7167): upgrader: initialize called
I/flutter ( 7167): upgrader: appStoreVersion: ***
I/flutter ( 7167): upgrader: installedVersion: ***
I/flutter ( 7167): upgrader: minAppVersion: null
I/flutter ( 7167): upgrader: isUpdateAvailable: false

NOTE: The garbage release note string was forced to a long value in order to simulate a long release note.

pubspec.lock

  upgrader:
    dependency: "direct main"
    description:
      name: upgrader
      sha256: "71cb887dbaec121b63950d4e5d368a4b9e2079f6d8fef6f358728eb7a63d9f29"
      url: "https://pub.dev"
    source: hosted
    version: "7.1.0"
larryaasen commented 8 months ago

I updated UpgradeCard to allow scrolling of release notes. This should be available in the next release.