content: import 'package:flutter/material.dart';
  
  import '../../constants/app_data.dart';
  
  /// An about icon button used on the example's app app bar.
  class AboutIconButton extends StatelessWidget {
    const AboutIconButton({super.key, this.color});
  
    /// The color used on the icon button.
    ///
    /// If null, default to Icon() class default color.
    final Color? color;
  
    @override
    Widget build(BuildContext context) {
      return IconButton(
        icon: Icon(Icons.info_outline, color: color),
        onPressed: () {
          showAppAboutDialog(context);
        },
        tooltip: 'Show About dialog',
      );
    }
  }
  
  // This [showAppAboutDialog] function is based on the [AboutDialog] example
  // that exist(ed) in the Flutter Gallery App.
  void showAppAboutDialog(BuildContext context) {
    final ThemeData theme = Theme.of(context);
    final TextStyle aboutTextStyle = theme.textTheme.bodyLarge!;
    final TextStyle footerStyle = theme.textTheme.bodySmall!;
  
    final MediaQueryData media = MediaQuery.of(context);
    final double width = media.size.width;
    final double height = media.size.height;
  
    showAboutDialog(
      context: context,
      applicationName: AppData.title(context),
      applicationVersion: AppData.version,
      applicationIcon: const CircleAvatar(child: Text(AppData.shortAppName)),
      applicationLegalese: '${AppData.copyright}\n${AppData.author}\n${AppData.license}',
      children: <Widget>[
        Padding(
          padding: const EdgeInsets.only(top: 24),
          child: RichText(
            text: TextSpan(
              children: <TextSpan>[
                TextSpan(
                  style: aboutTextStyle,
                  text:
                      'This ${AppData.title(context)} application is used to '
                      'compare different Squircle implementations in '
                      'Flutter.\n\n',
                ),
                TextSpan(
                  style: footerStyle,
                  text:
                      'Built with Flutter ${AppData.flutterVersion}.\n'
                      'Media size (w:${width.toStringAsFixed(0)}, '
                      'h:${height.toStringAsFixed(0)})\n',
                ),
              ],
            ),
          ),
        ),
      ],
    );
  }
  