From a9a4e1b3f400b614e59e33215251d0609ec606f6 Mon Sep 17 00:00:00 2001 From: Madhav Gupta Date: Sat, 1 Jun 2024 01:24:43 +0530 Subject: [PATCH] fix: Dart suggested fixes --- lib/presentation/atoms/check_box_atom.dart | 3 - .../molecules/energy_selection_molecule.dart | 3 - .../organisms/intro/tips_organism.dart | 2 +- .../pages/tip_information_page.dart | 63 ++++++++++--------- 4 files changed, 34 insertions(+), 37 deletions(-) diff --git a/lib/presentation/atoms/check_box_atom.dart b/lib/presentation/atoms/check_box_atom.dart index a110373..90a1bb1 100644 --- a/lib/presentation/atoms/check_box_atom.dart +++ b/lib/presentation/atoms/check_box_atom.dart @@ -39,9 +39,6 @@ class _CheckBoxAtomState extends State { @override Widget build(BuildContext context) { - final ThemeData themeData = Theme.of(context); - final ColorScheme colorScheme = themeData.colorScheme; - return CardAtom( child: Row( children: [ diff --git a/lib/presentation/molecules/energy_selection_molecule.dart b/lib/presentation/molecules/energy_selection_molecule.dart index ae6f60f..d687595 100644 --- a/lib/presentation/molecules/energy_selection_molecule.dart +++ b/lib/presentation/molecules/energy_selection_molecule.dart @@ -55,9 +55,6 @@ class _EnergySelectionMoleculeState extends State { @override Widget build(BuildContext context) { - final ThemeData themeData = Theme.of(context); - final ColorScheme colorScheme = themeData.colorScheme; - return MarginedExpandedAtom( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/presentation/organisms/intro/tips_organism.dart b/lib/presentation/organisms/intro/tips_organism.dart index fd408fb..408bdd6 100644 --- a/lib/presentation/organisms/intro/tips_organism.dart +++ b/lib/presentation/organisms/intro/tips_organism.dart @@ -63,7 +63,7 @@ class TipsOrganism extends StatelessWidget { initialValue: tip.selected, onIconPressed: () => Navigator.of(context).push( MaterialPageRoute( - builder: (context) => TipInformationPage(tip), + builder: (context) => TipInformationPage(tip: tip), ), ), ), diff --git a/lib/presentation/pages/tip_information_page.dart b/lib/presentation/pages/tip_information_page.dart index 9e29057..c2f3a54 100644 --- a/lib/presentation/pages/tip_information_page.dart +++ b/lib/presentation/pages/tip_information_page.dart @@ -87,43 +87,46 @@ class TipInformationPage extends StatelessWidget { final Uri? link = r.link; return ExpansionPanelRadio( - value: r.title, - canTapOnHeader: true, - headerBuilder: - (BuildContext context, bool isExpanded) { - return TextAtom(r.title); - }, - body: InkWell( - onTap: () { - if (link == null) { - return; - } - launchUrl(link); - }, - child: Row( - children: [ - Expanded( - child: - TextAtom(r.resourceExplanation), - ), - IconButton( - onPressed: () { + value: r.title, + canTapOnHeader: true, + headerBuilder: (BuildContext context, + bool isExpanded,) { + return TextAtom(r.title); + }, + body: InkWell( + onTap: () { if (link == null) { return; } launchUrl(link); }, - icon: const Icon(Icons.link), + child: Row( + children: [ + Expanded( + child: TextAtom( + r.resourceExplanation,), + ), + IconButton( + onPressed: () { + if (link == null) { + return; + } + launchUrl(link); + }, + icon: const Icon(Icons.link), + ), + ], + ), ), - ], - ), - ), - ); - }, - ).toList(), - ), + ); + }, + ).toList(), + ), + ], + ), ], ), + ), ], ), ), @@ -133,4 +136,4 @@ class TipInformationPage extends StatelessWidget { ), ); } -} \ No newline at end of file +}