Support page improved

This commit is contained in:
Vicente J. Ruiz Jurado 2018-08-14 10:09:37 +02:00
parent aa496b0ed2
commit 3253c429ab
5 changed files with 54 additions and 6 deletions

View file

@ -1,5 +1,6 @@
import 'package:comunes_flutter/comunes_flutter.dart';
import 'package:flutter/material.dart';
import 'package:launch_review/launch_review.dart';
import 'package:url_launcher/url_launcher.dart';
import 'generated/i18n.dart';
@ -18,9 +19,9 @@ class _SupportPageState extends State<SupportPage> {
Widget buildSupportButton() {
return new Align(
alignment: const Alignment(0.0, -0.2),
child: new FloatingActionButton(
heroTag: 'callAction',
child: const Icon(Icons.favorite),
child: new OutlineButton.icon(
icon: const Icon(Icons.favorite_border),
label: new Text(S.of(context).comunesSupportBtn),
onPressed: () {
launch("https://comunes.org/");
},
@ -28,6 +29,33 @@ class _SupportPageState extends State<SupportPage> {
);
}
Widget buildShareButton() {
return new Align(
alignment: const Alignment(0.0, -0.2),
child: new OutlineButton.icon(
icon: const Icon(Icons.share),
label: new Text(S.of(context).shareAppBtn),
onPressed: () {
launch(
"https://play.google.com/store/apps/details?id=org.comunes.fires");
},
),
);
}
Widget buildStarButton() {
return new Align(
alignment: const Alignment(0.0, -0.2),
child: new OutlineButton.icon(
icon: const Icon(Icons.star_border),
label: new Text(S.of(context).starAppBtn),
onPressed: () {
LaunchReview.launch();
},
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -45,7 +73,11 @@ class _SupportPageState extends State<SupportPage> {
textAlign: TextAlign.center,
),
new SizedBox(height: 20.0),
buildSupportButton()
buildSupportButton(),
new SizedBox(height: 20.0),
buildStarButton(),
new SizedBox(height: 20.0),
buildShareButton()
]))
]),
));