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

showAboutDialog Allow for additional buttons #116896

Open
esDotDev opened this issue Dec 12, 2022 · 2 comments
Open

showAboutDialog Allow for additional buttons #116896

esDotDev opened this issue Dec 12, 2022 · 2 comments
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@esDotDev
Copy link

When showing the AboutDialog, we would like to add a 3rd button "PRIVACY", there is currently no method to do this. It would be nice if it acception some list of extra btns, like TabBar does.

@esDotDev esDotDev changed the title showAboutDialog Allow for custom buttons showAboutDialog Allow for additional buttons Dec 12, 2022
@danagbemava-nc danagbemava-nc added in triage Presently being triaged by the triage team c: new feature Nothing broken; request for a new capability framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. c: proposal A detailed proposal for a change to Flutter and removed in triage Presently being triaged by the triage team labels Dec 13, 2022
@HansMuller
Copy link
Contributor

This sounds like a reasonable tweak to the API. Would you be willing to submit a PR for it?

@hasnentai
Copy link
Contributor

hasnentai commented Jan 17, 2023

Hello, @HansMuller I would like to work on this issue.
cc: @Piinks @shihaohong

Proposal for API

1. Allowing devs to pass the list of widgets as an action parameter

For an instance

    return showAboutDialog(
      context: context,
      applicationVersion: "v0.1.0",
      applicationLegalese: "Lorem Ipsum is simply ... ",
      applicationName: "Flutter App ",
      actions: [
        TextButton(onPressed: () => {}, child: const Text("PRIVACY POLICY"))  /// Newly added API
      ],
    );
Image Preview

2. Hard code a TextButton same as the existing action button in AboutDialog,

 actions: <Widget>[
/// Privacy Button Newly Added
        TextButton(
          child: Text("PRIVACY POLICY"), // THIS WILL BE COMING FROM MaterialLocalizations.of(context).viewLicensesButtonLabel
          onPressed: () {
          // Perform an action here

          },
        ),
        TextButton(
          child:
              Text(MaterialLocalizations.of(context).viewLicensesButtonLabel),
          onPressed: () {
            showLicensePage(
              context: context,
              applicationName: applicationName,
              applicationVersion: applicationVersion,
              applicationIcon: applicationIcon,
              applicationLegalese: applicationLegalese,
            );
          },
        ),
        TextButton(
          child: Text(MaterialLocalizations.of(context).closeButtonLabel),
          onPressed: () {
            Navigator.pop(context);
          },
        ),
      ],

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-design Owned by Design Languages team triaged-design Triaged by Design Languages team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
Development

No branches or pull requests

5 participants