1
0
mirror of https://github.com/stonega/tsacdop synced 2025-02-17 20:10:37 +01:00

Update about page UI.

This commit is contained in:
stonegate 2020-10-03 16:57:30 +08:00
parent 4aa53515e3
commit 84c3a268dd

View File

@ -7,7 +7,29 @@ import '../util/extension_helper.dart';
const String version = '0.4.19'; const String version = '0.4.19';
class AboutApp extends StatelessWidget { class AboutApp extends StatefulWidget {
@override
_AboutAppState createState() => _AboutAppState();
}
class _AboutAppState extends State<AboutApp> {
ScrollController _scrollController;
bool _scroll;
@override
void initState() {
super.initState();
_scroll = false;
_scrollController = ScrollController()
..addListener(() {
if (_scrollController.offset > 0 && !_scroll && mounted) {
setState(() => _scroll = true);
}
if (_scrollController.offset <= 0 && _scroll && mounted) {
setState(() => _scroll = false);
}
});
}
Widget _listItem( Widget _listItem(
BuildContext context, String text, IconData icons, String url) => BuildContext context, String text, IconData icons, String url) =>
InkWell( InkWell(
@ -34,6 +56,7 @@ class AboutApp extends StatelessWidget {
), ),
), ),
); );
Widget _translatorInfo(BuildContext context, {String name, String flag}) => Widget _translatorInfo(BuildContext context, {String name, String flag}) =>
Container( Container(
height: 50.0, height: 50.0,
@ -103,219 +126,231 @@ class AboutApp extends StatelessWidget {
backgroundColor: Theme.of(context).primaryColor, backgroundColor: Theme.of(context).primaryColor,
appBar: AppBar( appBar: AppBar(
title: Text(s.homeToprightMenuAbout), title: Text(s.homeToprightMenuAbout),
elevation: _scroll ? 1 : 0,
), ),
body: SafeArea( body: SafeArea(
child: SingleChildScrollView( child: ScrollConfiguration(
scrollDirection: Axis.vertical, behavior: NoGrowBehavior(),
child: Padding( child: SingleChildScrollView(
padding: const EdgeInsets.all(20.0), controller: _scrollController,
child: Column( scrollDirection: Axis.vertical,
mainAxisAlignment: MainAxisAlignment.start, child: Padding(
mainAxisSize: MainAxisSize.min, padding: const EdgeInsets.all(20.0),
children: <Widget>[ child: Column(
Container( mainAxisAlignment: MainAxisAlignment.start,
height: 110.0, mainAxisSize: MainAxisSize.min,
alignment: Alignment.center, children: <Widget>[
child: Column( Container(
height: 110.0,
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image(
image: AssetImage('assets/logo.png'),
height: 80,
),
Text(s.version(version)),
],
),
),
Padding(
padding: const EdgeInsets.all(20),
child: Text(
'Tsacdop is a podcast player built with flutter, a clean, simply beautiful and friendly app.',
textAlign: TextAlign.center,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: [
Image( TextButton(
image: AssetImage('assets/logo.png'), onPressed: () =>
height: 80, 'https://tsacdop.stonegate.me/#/privacy'
.launchUrl,
style: TextButton.styleFrom(
primary: context.accentColor,
textStyle:
TextStyle(fontWeight: FontWeight.bold)),
child: Text(
s.privacyPolicy,
),
),
Container(
margin: const EdgeInsets.symmetric(horizontal: 5),
height: 4,
width: 4,
decoration: BoxDecoration(
color: context.accentColor,
shape: BoxShape.circle),
),
TextButton(
onPressed: () =>
'https://tsacdop.stonegate.me/#/changelog'
.launchUrl,
style: TextButton.styleFrom(
primary: context.accentColor,
textStyle:
TextStyle(fontWeight: FontWeight.bold)),
child: Text(s.changelog,
style: TextStyle(color: context.accentColor)),
), ),
Text(s.version(version)),
], ],
), ),
), Padding(
Padding( padding: EdgeInsets.all(10.0),
padding: const EdgeInsets.all(20),
child: Text(
'Tsacdop is a podcast player built with flutter, a clean, simply beautiful and friendly app.',
textAlign: TextAlign.center,
), ),
), Container(
Row( padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
mainAxisAlignment: MainAxisAlignment.center, decoration: BoxDecoration(
crossAxisAlignment: CrossAxisAlignment.center, borderRadius: BorderRadius.all(Radius.circular(10)),
children: [ border: Border.all(
FlatButton( color: Theme.of(context).accentColor, width: 1),
onPressed: () =>
'https://tsacdop.stonegate.me/#/privacy'.launchUrl,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5)),
child: Text(s.privacyPolicy,
style: TextStyle(color: context.accentColor)),
), ),
Container( child: Column(
margin: const EdgeInsets.symmetric(horizontal: 5), mainAxisAlignment: MainAxisAlignment.start,
height: 4, mainAxisSize: MainAxisSize.min,
width: 4, children: <Widget>[
decoration: BoxDecoration( // Text(
color: context.accentColor, shape: BoxShape.circle), // s.developer,
), // style: TextStyle(
FlatButton( // color: context.accentColor,
onPressed: () => // fontWeight: FontWeight.bold),
'https://tsacdop.stonegate.me/#/changelog' // ),
.launchUrl, _listItem(context, 'Twitter @tsacdop',
shape: RoundedRectangleBorder( LineIcons.twitter, 'https://twitter.com/tsacdop'),
borderRadius: BorderRadius.circular(5)), _listItem(context, 'GitHub', LineIcons.github_alt,
child: Text(s.changelog, 'https://github.com/stonega/tsacdop'),
style: TextStyle(color: context.accentColor)), _listItem(context, 'Telegram', LineIcons.telegram,
), 'https://t.me/joinchat/Bk3LkRpTHy40QYC78PK7Qg'),
], Center(
), child: SizedBox(
Padding( width: 200,
padding: EdgeInsets.all(10.0), child: ElevatedButton(
), onPressed: () =>
Container( 'https://www.buymeacoffee.com/stonegate'
padding: EdgeInsets.only(top: 20.0, bottom: 10.0), .launchUrl,
decoration: BoxDecoration( style: ElevatedButton.styleFrom(
borderRadius: BorderRadius.all(Radius.circular(10)), primary: context.accentColor),
border: Border.all( child: Container(
color: Theme.of(context).accentColor, width: 1), height: 30.0,
), padding:
child: Column( EdgeInsets.symmetric(horizontal: 4.0),
mainAxisAlignment: MainAxisAlignment.start, alignment: Alignment.center,
mainAxisSize: MainAxisSize.min, child: Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.center,
Text( mainAxisSize: MainAxisSize.min,
s.developer, children: <Widget>[
style: TextStyle( Text('Buy me a coffee',
color: context.accentColor, style: TextStyle(
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold)),
), SizedBox(width: 10),
_listItem(context, 'Twitter', LineIcons.twitter, Image(
'https://twitter.com/shimenmen'), image: AssetImage(
_listItem(context, 'GitHub', LineIcons.github_alt, 'assets/buymeacoffee.png'),
'https://github.com/stonega'), height: 20,
_listItem(context, 'Medium', LineIcons.medium, fit: BoxFit.fitHeight,
'https://medium.com/@stonegate'), ),
Center( ],
child: SizedBox( ),
width: 200,
child: FlatButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
color: Colors.yellow.withAlpha(70),
onPressed: () =>
'https://www.buymeacoffee.com/stonegate'
.launchUrl,
child: Container(
height: 30.0,
padding: EdgeInsets.symmetric(horizontal: 10.0),
alignment: Alignment.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text('Buy me a coffee',
style: TextStyle(
fontWeight: FontWeight.bold)),
SizedBox(width: 10),
Image(
image:
AssetImage('assets/buymeacoffee.png'),
height: 20,
fit: BoxFit.fitHeight,
),
],
), ),
), ),
), ),
), ),
), Padding(
Padding( padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
padding: EdgeInsets.fromLTRB(20, 10, 20, 10), child: Text(
child: Text( 'I need to pay for podcast search API and '
'I need to pay for podcast search API and ' 'always get headache without caffeine.',
'always get headache without caffeine.', textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(color: Colors.grey[500]),
style: TextStyle(color: Colors.grey[500]),
),
),
],
),
),
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>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
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),
],
),
_translatorInfo(context, name: 'Atrate'),
_translatorInfo(context, name: 'ppp', flag: 'fr'),
_translatorInfo(context,
name: 'Joel Israel', flag: 'mx'),
_translatorInfo(context,
name: 'Bruno Pinheiro', flag: 'pt'),
_translatorInfo(context,
name: 'Edoardo Maria Elidoro', flag: 'it'),
],
),
),
//Spacer(),
Padding(
padding: EdgeInsets.symmetric(vertical: 10),
),
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,
), ),
], ],
), ),
), ),
), 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>[
Row(
children: [
SizedBox(width: 25),
Text(
s.translators,
style: TextStyle(
color: Theme.of(context).accentColor,
fontWeight: FontWeight.bold),
),
SizedBox(width: 2),
Icon(Icons.favorite, color: Colors.red, size: 20),
],
),
_translatorInfo(context, name: 'Atrate'),
_translatorInfo(context, name: 'ppp', flag: 'fr'),
_translatorInfo(context,
name: 'Joel Israel', flag: 'mx'),
_translatorInfo(context,
name: 'Bruno Pinheiro', flag: 'pt'),
_translatorInfo(context,
name: 'Edoardo Maria Elidoro', flag: 'it'),
],
),
),
//Spacer(),
Padding(
padding: EdgeInsets.symmetric(vertical: 10),
),
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,
),
],
),
),
),
],
),
), ),
), ),
), ),