Skip to content

Commit 641861c

Browse files
immadisairajspydon
andauthored
fix: change the unselected chapter color (#113)
The selected and unselected chapter has only difference of font weight. So, this commit changes the unselected color to a lighter variant. Also, this commit adds the mouse cursor to click on hover of the chapters telling that it is clickable. Co-authored-by: Lukas Klingsbo <[email protected]>
1 parent a1b034a commit 641861c

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

lib/src/widgets/stories_list.dart

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,20 +153,28 @@ class _StoriesListState extends State<StoriesList> {
153153
child: Row(
154154
children: [
155155
Expanded(
156-
child: GestureDetector(
157-
onTap: () {
158-
widget.onSelectChapter(chapter);
159-
},
160-
behavior: HitTestBehavior.opaque,
161-
child: Link(
162-
label: ' ${chapter.name}',
163-
textAlign: TextAlign.left,
164-
padding: const EdgeInsets.only(right: 8),
165-
textStyle: TextStyle(
166-
fontWeight: chapter.id ==
167-
widget.selectedChapter?.id
168-
? FontWeight.bold
169-
: FontWeight.normal,
156+
child: MouseRegion(
157+
cursor: SystemMouseCursors.click,
158+
child: GestureDetector(
159+
onTap: () {
160+
widget.onSelectChapter(chapter);
161+
},
162+
behavior: HitTestBehavior.opaque,
163+
child: Link(
164+
label: ' ${chapter.name}',
165+
textAlign: TextAlign.left,
166+
padding:
167+
const EdgeInsets.only(right: 8),
168+
textStyle: TextStyle(
169+
fontWeight: chapter.id ==
170+
widget.selectedChapter?.id
171+
? FontWeight.bold
172+
: FontWeight.normal,
173+
color: chapter.id ==
174+
widget.selectedChapter?.id
175+
? null
176+
: Theme.of(context).hintColor,
177+
),
170178
),
171179
),
172180
),

0 commit comments

Comments
 (0)