tsacdop-podcast-app-android/lib/home/about.dart

319 lines
13 KiB
Dart
Raw Normal View History

2020-02-09 13:29:09 +01:00
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:line_icons/line_icons.dart';
2020-07-26 12:20:42 +02:00
import '../util/custom_widget.dart';
import '../util/extension_helper.dart';
const String version = '0.4.12';
2020-04-24 06:19:56 +02:00
2020-02-09 13:29:09 +01:00
class AboutApp extends StatelessWidget {
2020-03-01 13:17:06 +01:00
Widget _listItem(
BuildContext context, String text, IconData icons, String url) =>
InkWell(
2020-07-22 16:15:06 +02:00
onTap: () => url.launchUrl,
2020-03-01 13:17:06 +01:00
child: Container(
height: 50.0,
padding: EdgeInsets.symmetric(horizontal: 20.0),
alignment: Alignment.centerLeft,
decoration: BoxDecoration(
border: Border(
bottom: Divider.createBorderSide(context),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(icons, color: Theme.of(context).accentColor),
2020-03-01 13:17:06 +01:00
Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
),
Text(text),
],
),
),
);
2020-07-30 19:17:26 +02:00
Widget _translatorInfo(BuildContext context, {String name, String flag}) =>
Container(
height: 50.0,
padding: EdgeInsets.symmetric(horizontal: 20.0),
alignment: Alignment.centerLeft,
decoration: BoxDecoration(
border: Border(
bottom: Divider.createBorderSide(context),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(LineIcons.user, color: Theme.of(context).accentColor),
Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
),
Expanded(
child: Text(
name,
maxLines: 1,
overflow: TextOverflow.fade,
)),
2020-08-11 20:09:09 +02:00
if (flag != null)
ClipRRect(
borderRadius: BorderRadius.circular(4),
child: Image(
image: AssetImage('assets/$flag.png'),
height: 20,
width: 30,
fit: BoxFit.cover,
),
2020-07-30 19:17:26 +02:00
),
],
),
);
2020-03-01 13:17:06 +01:00
2020-02-09 13:29:09 +01:00
@override
Widget build(BuildContext context) {
OverlayEntry _createOverlayEntry(TapDownDetails detail) {
// RenderBox renderBox = context.findRenderObject();
var offset = detail.globalPosition;
return OverlayEntry(
builder: (constext) => Positioned(
left: offset.dx - 5,
top: offset.dy - 120,
child: Container(
width: 20,
height: 120,
color: Colors.transparent,
alignment: Alignment.topCenter,
child: HeartSet(height: 120, width: 20)),
),
);
}
2020-07-04 16:42:56 +02:00
final s = context.s;
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
2020-03-01 13:17:06 +01:00
statusBarIconBrightness: Theme.of(context).accentColorBrightness,
systemNavigationBarColor: Theme.of(context).primaryColor,
systemNavigationBarIconBrightness:
Theme.of(context).accentColorBrightness,
),
child: Scaffold(
backgroundColor: Theme.of(context).primaryColor,
2020-07-24 16:10:08 +02:00
appBar: AppBar(title: Center()
// Text(s.homeToprightMenuAbout),
),
body: SafeArea(
2020-06-02 16:05:49 +02:00
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
2020-08-01 09:30:24 +02:00
height: 110.0,
2020-06-02 16:05:49 +02:00
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image(
image: AssetImage('assets/logo.png'),
height: 80,
),
2020-07-04 16:42:56 +02:00
Text(s.version(version)),
2020-06-02 16:05:49 +02:00
],
),
2020-03-01 13:17:06 +01:00
),
Padding(
padding: const EdgeInsets.all(20),
2020-06-02 16:05:49 +02:00
child: Text(
2020-06-28 17:47:29 +02:00
'Tsacdop is a podcast player built with flutter, a clean, simply beautiful and friendly app.',
2020-06-02 16:05:49 +02:00
textAlign: TextAlign.center,
),
2020-03-01 13:17:06 +01:00
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
FlatButton(
2020-07-22 16:15:06 +02:00
onPressed: () =>
'https://tsacdop.stonegate.me/#/privacy'
.launchUrl,
2020-07-04 16:42:56 +02:00
child: Text(s.privacyPolicy,
style: TextStyle(color: context.accentColor)),
),
Container(
margin: const EdgeInsets.symmetric(horizontal: 5),
height: 4,
width: 4,
decoration: BoxDecoration(
color: context.accentColor,
shape: BoxShape.circle),
),
FlatButton(
2020-07-22 16:15:06 +02:00
onPressed: () =>
'https://tsacdop.stonegate.me/#/changelog'
.launchUrl,
2020-07-04 16:42:56 +02:00
child: Text(s.changelog,
style: TextStyle(color: context.accentColor)),
),
],
),
2020-06-02 16:05:49 +02:00
Padding(
padding: EdgeInsets.all(10.0),
2020-03-01 13:17:06 +01:00
),
2020-06-02 16:05:49 +02:00
Container(
padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.all(
color: Theme.of(context).accentColor, width: 1),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
2020-06-28 17:47:29 +02:00
padding: EdgeInsets.only(left: 20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
2020-07-04 16:42:56 +02:00
s.developer,
style: TextStyle(
2020-06-28 17:47:29 +02:00
color: Theme.of(context).accentColor,
fontWeight: FontWeight.bold),
),
Spacer(),
InkWell(
2020-07-22 16:15:06 +02:00
onTap: () =>
'https://www.buymeacoffee.com/stonegate'
.launchUrl,
child: Container(
height: 30.0,
padding:
EdgeInsets.symmetric(horizontal: 10.0),
alignment: Alignment.centerLeft,
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
2020-06-28 17:47:29 +02:00
Text('Buy me a coffee',
style: TextStyle(
2020-06-28 17:47:29 +02:00
color: context.accentColor,
fontWeight: FontWeight.bold)),
SizedBox(width: 10),
Image(
image: AssetImage(
'assets/buymeacoffee.png'),
height: 20,
fit: BoxFit.fitHeight,
),
],
),
),
)
],
2020-06-02 16:05:49 +02:00
),
),
2020-06-02 16:05:49 +02:00
_listItem(context, 'Twitter', LineIcons.twitter,
'https://twitter.com/shimenmen'),
_listItem(context, 'GitHub', LineIcons.github_alt,
'https://github.com/stonega'),
_listItem(context, 'Medium', LineIcons.medium,
'https://medium.com/@stonegate'),
],
),
2020-03-01 13:17:06 +01:00
),
2020-07-22 16:15:06 +02:00
Padding(
padding: EdgeInsets.all(10.0),
),
Container(
padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
border:
Border.all(color: context.accentColor, width: 1),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
s.translators,
style: TextStyle(
color: Theme.of(context).accentColor,
fontWeight: FontWeight.bold),
),
SizedBox(width: 2),
Icon(Icons.favorite,
color: Colors.red, size: 20),
],
),
),
2020-08-11 20:09:09 +02:00
_translatorInfo(context, name: 'Atrate'),
2020-07-30 19:17:26 +02:00
_translatorInfo(context, name: 'ppp', flag: 'fr'),
_translatorInfo(context,
name: 'Joel Israel', flag: 'mx')
2020-07-22 16:15:06 +02:00
],
),
),
2020-06-02 16:05:49 +02:00
//Spacer(),
Padding(
2020-07-25 14:28:24 +02:00
padding: EdgeInsets.symmetric(vertical: 10),
2020-06-02 16:05:49 +02:00
),
Container(
height: 50,
alignment: Alignment.center,
child: GestureDetector(
onTapDown: (detail) async {
OverlayEntry _overlayEntry;
_overlayEntry = _createOverlayEntry(detail);
Overlay.of(context).insert(_overlayEntry);
await Future.delayed(Duration(seconds: 2));
_overlayEntry?.remove();
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/text.png',
height: 25,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 5),
),
Icon(
Icons.favorite,
color: Colors.blue,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 5),
),
FlutterLogo(
size: 18,
),
],
),
),
),
],
),
2020-03-01 13:17:06 +01:00
),
),
)),
);
2020-02-09 13:29:09 +01:00
}
}