diff --git a/lib/presentation/atoms/check_box_atom.dart b/lib/presentation/atoms/check_box_atom.dart index 2e68284..ec517c8 100644 --- a/lib/presentation/atoms/check_box_atom.dart +++ b/lib/presentation/atoms/check_box_atom.dart @@ -2,16 +2,19 @@ import 'package:flutter/material.dart'; import 'package:infinite_horizons/domain/vibration_controller.dart'; import 'package:infinite_horizons/presentation/atoms/atoms.dart'; + class CheckBoxAtom extends StatefulWidget { const CheckBoxAtom( this.text, { required this.callback, this.initialValue = false, + this.onIconPressed, }); final String text; final bool initialValue; final Function(bool) callback; + final VoidCallback? onIconPressed; @override State createState() => _CheckBoxAtomState(); @@ -37,12 +40,20 @@ class _CheckBoxAtomState extends State { @override Widget build(BuildContext context) { - return CheckboxListTile( + return ListTile( contentPadding: EdgeInsets.zero, - title: TextAtom(widget.text), - controlAffinity: ListTileControlAffinity.leading, - value: isChecked, - onChanged: onChange, + title: CheckboxListTile( + contentPadding: EdgeInsets.zero, + title: TextAtom(widget.text), + controlAffinity: ListTileControlAffinity.leading, + value: isChecked, + onChanged: onChange, + ), + trailing: widget.onIconPressed != null + ? IconButton( + onPressed: widget.onIconPressed, + icon: const Icon(Icons.arrow_forward),) + : null, ); } } diff --git a/lib/presentation/organisms/intro/tips_organism.dart b/lib/presentation/organisms/intro/tips_organism.dart index 7721a49..5072965 100644 --- a/lib/presentation/organisms/intro/tips_organism.dart +++ b/lib/presentation/organisms/intro/tips_organism.dart @@ -8,6 +8,7 @@ import 'package:infinite_horizons/domain/tip.dart'; import 'package:infinite_horizons/presentation/atoms/atoms.dart'; import 'package:infinite_horizons/presentation/molecules/molecules.dart'; import 'package:infinite_horizons/presentation/pages/all_tips_page.dart'; +import 'package:infinite_horizons/presentation/pages/tip_information_page.dart'; class TipsOrganism extends StatelessWidget { const TipsOrganism(this.studyType); @@ -58,6 +59,11 @@ class TipsOrganism extends StatelessWidget { tip.text, callback: (value) => onCheckBox(tip.id, value), initialValue: tip.selected, + onIconPressed: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => TipInformationPage(tip), + ), + ), ); }, itemCount: beforeStudyTips.length,