From 14e4496de4138c317791030215803e7d57ec85bc Mon Sep 17 00:00:00 2001 From: davidpkj Date: Sun, 5 Mar 2023 13:05:25 +0100 Subject: Refactored according to flutter lint --- lib/views/info_view.dart | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lib/views/info_view.dart') diff --git a/lib/views/info_view.dart b/lib/views/info_view.dart index bda2d14..0d0897d 100644 --- a/lib/views/info_view.dart +++ b/lib/views/info_view.dart @@ -10,10 +10,10 @@ class InfoView extends StatefulWidget { const InfoView({Key? key}) : super(key: key); @override - _InfoViewState createState() => _InfoViewState(); + InfoViewState createState() => InfoViewState(); } -class _InfoViewState extends State { +class InfoViewState extends State { String name = "David Penkowoj"; String websiteURL = "https://davidpenkowoj.de"; String sourceCodeURL = "https://git.davidpenkowoj.de/kulinar_app.git"; @@ -23,7 +23,7 @@ class _InfoViewState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text(AppLocalizations.of(context)!.category9)), - drawer: CustomDrawer(initalIndex: 6), + drawer: const CustomDrawer(initialIndex: 6), body: ListView( children: [ Padding( @@ -32,7 +32,7 @@ class _InfoViewState extends State { ), ListTile( title: Text(AppLocalizations.of(context)!.info1, style: cDefaultTextStyle), - subtitle: Text(cVersion, style: cDetailsTextStyle), + subtitle: const Text(cVersion, style: cDetailsTextStyle), ), ListTile( title: Text(AppLocalizations.of(context)!.info2, style: cDefaultTextStyle), @@ -42,7 +42,7 @@ class _InfoViewState extends State { title: Text(AppLocalizations.of(context)!.info3, style: cDefaultTextStyle), subtitle: Text(websiteURL, style: cDetailsTextStyle, overflow: TextOverflow.ellipsis), trailing: IconButton( - icon: Icon(Icons.north_east_rounded), + icon: const Icon(Icons.north_east_rounded), onPressed: () { _launchURL(Uri.parse(websiteURL)); }, @@ -52,7 +52,7 @@ class _InfoViewState extends State { title: Text(AppLocalizations.of(context)!.info4, style: cDefaultTextStyle), subtitle: Text(sourceCodeURL, style: cDetailsTextStyle, overflow: TextOverflow.ellipsis), trailing: IconButton( - icon: Icon(Icons.north_east_rounded), + icon: const Icon(Icons.north_east_rounded), onPressed: () { _launchURL(Uri.parse(sourceCodeURL)); }, @@ -62,7 +62,7 @@ class _InfoViewState extends State { title: Text(AppLocalizations.of(context)!.info5, style: cDefaultTextStyle), subtitle: Text(privacyNoticeURL, style: cDetailsTextStyle, overflow: TextOverflow.ellipsis), trailing: IconButton( - icon: Icon(Icons.north_east_rounded), + icon: const Icon(Icons.north_east_rounded), onPressed: () { _launchURL(Uri.parse(privacyNoticeURL)); }, @@ -71,7 +71,7 @@ class _InfoViewState extends State { ListTile( title: Text(AppLocalizations.of(context)!.info6, style: cDefaultTextStyle), trailing: IconButton( - icon: Icon(Icons.launch_rounded), + icon: const Icon(Icons.launch_rounded), onPressed: () { _showDialog(); }, @@ -95,7 +95,8 @@ class _InfoViewState extends State { if (await canLaunchUrl(url)) { await launchUrl(url, mode: LaunchMode.externalApplication); } else { - print('Could not launch $url'); + debugPrint("Could not launch $url"); + // TODO: maybe add toastbar } } } -- cgit v1.2.3