How can I change the shape of the flutter showAboutDialog?

Viewed 125

I'm calling the showAboutDialog as following:

onTap: () {
    showAboutDialog(
            context: context,
            applicationName: SettingsScreen.nameToDisplay,
            applicationLegalese: formatDateAppLegalese.format(DateTime.now()),
            applicationVersion: SettingsScreen.versionToDisplay,
            children: aboutBoxChildren,
        );
},

How can I change the shape of that dialog? I know how to style and alert dialog and add for example rounded corners but this is not transferable to the case of the showAboutDialog in flutter.

Adding corners to the children attribute does not have the right effect.

Is there a way to change the shape of that dialog and if how?

1 Answers

Check out this code:

onTap: () {
 showDialog(
  context: context,
  builder: (context) {
      return AboutDialog(
        applicationVersion: "1.0.2",
        applicationName: "Flutter app",
      );
    },
  );
},

After that, you should modify your app theme to change the shape of your AboutDialog like this:

dialogBackgroundColor: Colors.grey,
dialogTheme: DialogTheme(
  shape: RoundedRectangleBorder(
    borderRadius: BorderRadius.circular(15),
  ),
  elevation: 5,
),
Related