Skip to content

Commit 0b89bf6

Browse files
committed
schedules: use primary color for section buttons
1 parent 66014de commit 0b89bf6

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lib/src/schedules/presentations/section_widget.dart

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,19 @@ class SectionWidget extends ConsumerWidget {
7979
child:
8080
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
8181
TextButton(
82-
onPressed: () => _launchUrl(Uri.parse(
83-
'https://www.jw.org/finder?srcid=jwlshare&wtlocale=${bibleLanguage?.wtCode}&prefer=lang&bible=${section.url}')),
82+
onPressed: () async {
83+
final url = Uri.parse(
84+
'https://www.jw.org/finder?srcid=jwlshare&wtlocale=${bibleLanguage?.wtCode}&prefer=lang&bible=${section.url}');
85+
86+
if (await canLaunchUrl(url)) {
87+
await launchUrl(url);
88+
}
89+
},
8490
child: Text(
8591
'${bibleLanguage?.books[section.bookIndex].name} ${section.ref}',
86-
style: const TextStyle(color: Color(0xff007bff)))),
92+
style: TextStyle(
93+
color: Theme.of(context).colorScheme.primary,
94+
))),
8795
if (plan.showEvents)
8896
...section.events
8997
.map((eventKey) => events?.events[eventKey] != null
@@ -101,9 +109,3 @@ class SectionWidget extends ConsumerWidget {
101109
);
102110
}
103111
}
104-
105-
Future<void> _launchUrl(Uri url) async {
106-
if (!await launchUrl(url)) {
107-
throw Exception('Could not launch $url');
108-
}
109-
}

0 commit comments

Comments
 (0)