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

Fix: Add Navigation Arrow for Tip Description (#80) #90

Merged
merged 3 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions lib/presentation/atoms/check_box_atom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<CheckBoxAtom> createState() => _CheckBoxAtomState();
Expand All @@ -37,12 +40,20 @@ class _CheckBoxAtomState extends State<CheckBoxAtom> {

@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,
);
}
}
6 changes: 6 additions & 0 deletions lib/presentation/organisms/intro/tips_organism.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
Loading