How to add about dialog in flutter

How to display about dialog in flutter application using showAboutDialog function.

How to add about dialog in flutter
How to add about dialog in flutter - mobilelabs.in

Nowadays it's mandatory for the store approval to display application version number, legalese, licence information.

How we can display this inside the application, we can create our custom view with these details but flutter has inbuilt widget that makes your life easier.

Flutter AboutDialog

You can call the showAboutDialog() anywhere like click event and pass the required parameters that's it.

You will see a beautiful about widget with the store compliance covered.

showAboutDialog(
  context: context,
  applicationIcon: Icon(
    Icons.local_play,
    size: 65,
    color: Theme.of(context).accentColor,
  ),
  applicationName: 'mobilelabs.in',
  applicationVersion: '1.0.25',
  applicationLegalese: '© 2019 Company',
  children: [
    SizedBox(
      height: 20,
    ),
    Text('App information'),
    Text('App Privacy Policy'),
    Text('App Terms of Service'),
    RichText(
      text: TextSpan(
        children: <TextSpan>[
          TextSpan(
              style: TextStyle(
                  color: Theme.of(context).accentColor),
              text: 'Site URL'),
        ],
      ),
    )
  ],
);

You will see

Flutter AboutDialog Example
PC - mobilelabs.in

Flutter providers "View Licenses" button, it automatically generates the all the licenses from the used packages in app and displays.

We can also use LicenseRegistry class to control this.

LicenseRegistry.addLicense(() async* {
    yield LicenseEntryWithLineBreaks(
        ['firebase_core'],
    );
});

Conclusion

We have seen how to use AboutDialog flutter widget with an example. You can find more in flutter below.

Flutter Tutorial for Beginners #1 - AppBar Widget
In this tutorial we will take a look at how to use Flutter AppBar Widget and Implement AppBar widget with a simple Flutter Application.
How to create gradient effect in Flutter
In this tutorial we will learn about gradient and how to create beautiful gradient effects using Flutter with example.