Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make entire tip resource area clickable #89

Merged
merged 10 commits into from
Jun 3, 2024
2 changes: 1 addition & 1 deletion lib/presentation/pages/all_tips_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AllTipsPage extends StatelessWidget {
trailing: const Icon(Icons.arrow_forward),
onTap: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => TipInformationPage(tip),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason for change

builder: (context) => TipInformationPage(tip: tip),
),
),
);
Expand Down
46 changes: 29 additions & 17 deletions lib/presentation/pages/tip_information_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import 'package:infinite_horizons/presentation/molecules/molecules.dart';
import 'package:url_launcher/url_launcher.dart';

class TipInformationPage extends StatelessWidget {
const TipInformationPage(this.tip);

const TipInformationPage({
required this.tip,
super.key,
});
final Tip tip;

@override
Expand Down Expand Up @@ -77,25 +79,35 @@ class TipInformationPage extends StatelessWidget {

return ExpansionPanelRadio(
value: r.title,
canTapOnHeader: true,
headerBuilder:
(BuildContext context, bool isExpanded) {
return TextAtom(r.title);
},
body: Row(
children: [
Expanded(
child: TextAtom(r.resourceExplanation),
),
IconButton(
onPressed: () {
if (link == null) {
return;
}
launchUrl(link);
},
icon: const Icon(Icons.link),
),
],
body: InkWell(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The body should open and close when clicked, not open the link

onTap: () {
if (link == null) {
return;
}
launchUrl(link);
},
child: Row(
children: [
Expanded(
child:
TextAtom(r.resourceExplanation),
),
IconButton(
onPressed: () {
if (link == null) {
return;
}
launchUrl(link);
},
icon: const Icon(Icons.link),
),
],
),
),
);
},
Expand Down
Loading