larryaasen / upgrader

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

Prompt and Release Notes are not centered in cupertino style AlertDialog. #356

Closed tadinh98 closed 7 months ago

tadinh98 commented 7 months ago

When using the cupertino style AlertDialog the "Would you like to update it now" and "Release Notes" texts are not centered unlike the title and message above it.

Screenshot:

image

Potential cause of problem: In the _alertDialog method prompt and notes are wrapped inside columns with "crossAxisAlignment: CrossAxisAlignment.start".

      notes = Padding(
          padding: const EdgeInsets.only(top: 15.0),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Text(messages.message(UpgraderMessage.releaseNotes) ?? '',
                  style: const TextStyle(fontWeight: FontWeight.bold)),
              Text(releaseNotes),
            ],
          ));
final content = Container(
        constraints: const BoxConstraints(maxHeight: 400),
        child: SingleChildScrollView(
            child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Text(message),
            Padding(
                padding: const EdgeInsets.only(top: 15.0),
                child: Text(messages.message(UpgraderMessage.prompt) ?? '')),
            if (notes != null) notes,
          ],
        )));
larryaasen commented 7 months ago

@tadinh98 Thanks for this bug report. I fixed the centering issue with the Cupertino style UpgradeAlert dialog and it will be in the next release.