mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
Feature Timeline: translate text with link to GitHub
This commit is contained in:
@ -333,6 +333,7 @@ feature_timeline:
|
|||||||
title: Feature Timeline
|
title: Feature Timeline
|
||||||
progress: In Progress
|
progress: In Progress
|
||||||
plan: Planned
|
plan: Planned
|
||||||
|
issues: GitJournal's development is tracked on Github. Please consider voting on the issues you consider important.
|
||||||
|
|
||||||
purchase_screen:
|
purchase_screen:
|
||||||
title: Pro Version
|
title: Pro Version
|
||||||
|
@ -159,32 +159,41 @@ class _DevelopmentText extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var style = Theme.of(context).textTheme.bodyText2;
|
var style = Theme.of(context).textTheme.bodyText2;
|
||||||
|
|
||||||
|
var str = tr('feature_timeline.issues');
|
||||||
|
var i = str.toLowerCase().indexOf('github');
|
||||||
|
if (i == -1) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: RichText(text: TextSpan(children: [gitHubLink(str)])),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
var before = str.substring(0, i);
|
||||||
|
var after = str.substring(i + 6);
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: RichText(
|
child: RichText(
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(text: before, style: style),
|
||||||
text: "GitJournal's development is tracked on ",
|
gitHubLink('GitHub'),
|
||||||
style: style,
|
TextSpan(text: after, style: style),
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: 'GitHub',
|
|
||||||
style: const TextStyle(color: Colors.blue),
|
|
||||||
recognizer: TapGestureRecognizer()
|
|
||||||
..onTap = () {
|
|
||||||
launch(githubUrl);
|
|
||||||
logEvent(Event.FeatureTimelineGithubClicked);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text:
|
|
||||||
" Please consider voting on the issues you consider important.",
|
|
||||||
style: style,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextSpan gitHubLink(String text) {
|
||||||
|
return TextSpan(
|
||||||
|
text: text,
|
||||||
|
style: const TextStyle(color: Colors.blue),
|
||||||
|
recognizer: TapGestureRecognizer()
|
||||||
|
..onTap = () {
|
||||||
|
launch(githubUrl);
|
||||||
|
logEvent(Event.FeatureTimelineGithubClicked);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user