ePrivacy and GPDR Cookie Consent by CookieConsent.com
menu

AboutListTile widget in flutter | how to use AboutListTile in flutter


 

AboutListTile is a material widget that is used for showing Licenses of the software. It is very similar to AboutDialog but this widget is used as a ListTile. On clicking that ListTile the about dialog opens.

AboutListTile is often used in Drawer as a list element and we don't have to call the onPressed property to show the dialog. You can see here


On pressing the ListTile a dialog box will open like this



Actually, this widget is a rebuild ListTile with an Icon and a Title. We will discuss all its properties below. Many of its properties are the same as the AboutDialog widget so you should check out the AboutDialog Widget first.


Properties of  AboutListTile

  • icon
  • applicationIcon
  • applicationName
  • applicationLegalese
  • applicationVersion
  • child
  • dense
  • aboutBoxChildren


icon Property

icon property is used for setting the icon of the ListTile.

drawer: Drawer(
            child: SafeArea(
            child: AboutListTile(
            icon: Icon(Icons.info),     // Icon property
          ),
        )



applicationIcon Property

applicationIcon property is used for adding Icon to the DialogBox 

      drawer: Drawer(  
                  child: SafeArea(    
                  child: AboutListTile(        
                  icon: Icon(Icons.info),    
                  applicationIcon: FlutterLogo(),   // applicationIcon Propery    
          ),
        )
    ),



applicationName Property

applicationName property is used for the title of the ListTile and the DialogBox. 

      drawer: Drawer(
                  child: SafeArea(
                  child: AboutListTile(
                  icon: Icon(Icons.info),
                  applicationIcon: FlutterLogo(),
                  applicationName: "Demo App",
          ),
        )
    ),

 




You can see applicationName property in both places (ListTile and AboutDialogBox). In the ListTile you can see "About Demo App"  instead of "Demo App" as I have written in the code.
In ListTile the "About" keyword" automatically adds before the applicationName. 

 

applicationVersion and applicationLegalese

applicationVersion property is used for displaying the version of the application as String and appicationLegalese is used for displaying copyright Notice ( or any Notice or text) on the DialogBox.

      drawer: Drawer(
                  child: SafeArea(
                    child: AboutListTile(
                      icon: Icon(Icons.info),
                      applicationIcon: FlutterLogo(),
                      applicationName: "Demo App",
                      applicationVersion: "10.9.8",
                      applicationLegalese: "THis is some legal notice",
          ),
        )
    )


child Property:

child property is used for adding widgets to the listTile

      drawer: Drawer(
                  child: SafeArea(
                    child: AboutListTile(
                      icon: Icon(Icons.info),
                      applicationIcon: FlutterLogo(),
                      applicationName: "Demo App",
                      applicationVersion: "10.9.8",
                      applicationLegalese: "THis is some legal notice",
                      child: Text("This is an About List item"),
          ),
        )
    )


The child property adds widgets in ListTile only.
Note: If you use child property then the applicationName property will be shown at DialogBox only, Not at ListTile. Here we used applicationName also but not displaying in the listTile because of child property.


aboutBoxChildren Property

aboutBoxChildren property is used for displaying widgets to the DialogBox. Here I am using FlutterLogo( ) widget.

      drawer: Drawer(
                  child: SafeArea(
                    child: AboutListTile(
                      icon: Icon(Icons.info),
                      applicationIcon: FlutterLogo(),
                      applicationName: "Demo App",
                      applicationVersion: "10.9.8",
                      applicationLegalese: "THis is some legal notice",
                       child: Text("This is an About List item"),
                       aboutBoxChildren: <Widget>[
                            FlutterLogo(),
                            FlutterLogo(),
                            FlutterLogo(),
                            FlutterLogo(),
                            FlutterLogo(),
                  ],
          ),
        )
    )






Thank You :)





Comments