File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
lib/src/schedules/presentations Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -79,11 +79,19 @@ class SectionWidget extends ConsumerWidget {
79
79
child:
80
80
Column (crossAxisAlignment: CrossAxisAlignment .start, children: [
81
81
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
+ },
84
90
child: Text (
85
91
'${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
+ ))),
87
95
if (plan.showEvents)
88
96
...section.events
89
97
.map ((eventKey) => events? .events[eventKey] != null
@@ -101,9 +109,3 @@ class SectionWidget extends ConsumerWidget {
101
109
);
102
110
}
103
111
}
104
-
105
- Future <void > _launchUrl (Uri url) async {
106
- if (! await launchUrl (url)) {
107
- throw Exception ('Could not launch $url ' );
108
- }
109
- }
You can’t perform that action at this time.
0 commit comments