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

182 lines
6.7 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:tsacdop/util/custompaint.dart';
2020-03-01 13:17:06 +01:00
import 'package:url_launcher/url_launcher.dart';
import 'package:line_icons/line_icons.dart';
2020-05-18 19:32:32 +02:00
const String version = '0.3.0';
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
_launchUrl(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
2020-02-09 13:29:09 +01:00
}
2020-03-01 13:17:06 +01:00
Widget _listItem(
BuildContext context, String text, IconData icons, String url) =>
InkWell(
onTap: () => _launchUrl(url),
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-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)),
),
);
}
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,
appBar: AppBar(
title: Text('About'),
),
body: SafeArea(
child: Container(
padding: EdgeInsets.all(20),
alignment: Alignment.topLeft,
2020-03-01 13:17:06 +01:00
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
height: 200.0,
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image(
image: AssetImage('assets/logo.png'),
height: 80,
),
2020-04-24 06:19:56 +02:00
Text('Version: $version'),
2020-03-01 13:17:06 +01:00
],
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 50),
child: Text(
'Tsacdop is a podcast player developed in flutter, a clean, simply beautiful and friendly app.',
2020-03-01 13:17:06 +01:00
textAlign: TextAlign.center,
),
),
Padding(
padding: EdgeInsets.all(10.0),
2020-03-01 13:17:06 +01:00
),
Container(
padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
2020-03-01 13:17:06 +01:00
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.all(
color: Theme.of(context).accentColor, width: 1),
2020-03-01 13:17:06 +01:00
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
padding: EdgeInsets.symmetric(horizontal: 20.0),
alignment: Alignment.centerLeft,
child: Text(
'Developer',
style:
TextStyle(color: Theme.of(context).accentColor),
),
),
_listItem(context, 'Twitter', LineIcons.twitter,
2020-03-31 18:36:20 +02:00
'https://twitter.com/shimenmen'),
_listItem(context, 'GitHub', LineIcons.github_alt,
'https://github.com/stonega'),
2020-04-02 12:18:25 +02:00
_listItem(context, 'Medium', LineIcons.medium,
2020-03-31 18:36:20 +02:00
'https://medium.com/@stonegate'),
2020-03-01 13:17:06 +01:00
],
),
),
Spacer(),
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
}
}