You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
141 lines
5.4 KiB
141 lines
5.4 KiB
import 'package:flutter/material.dart'; |
|
import 'package:flutter/services.dart'; |
|
import 'package:info_tren/pages/about/about_page.dart'; |
|
import 'package:url_launcher/url_launcher.dart'; |
|
|
|
class AboutPageMaterial extends StatefulWidget { |
|
const AboutPageMaterial({super.key}); |
|
|
|
@override |
|
State<AboutPageShared> createState() => AboutPageStateMaterial(); |
|
} |
|
|
|
class AboutPageStateMaterial extends AboutPageState { |
|
@override |
|
Widget build(BuildContext context) { |
|
return Scaffold( |
|
appBar: AppBar( |
|
title: Text(pageTitle), |
|
centerTitle: true, |
|
), |
|
body: SingleChildScrollView( |
|
child: Column( |
|
mainAxisSize: MainAxisSize.min, |
|
crossAxisAlignment: CrossAxisAlignment.stretch, |
|
children: [ |
|
Center( |
|
child: Text( |
|
'Info Tren', |
|
style: Theme.of(context).textTheme.displayMedium, |
|
), |
|
), |
|
if (packageInfo != null) |
|
Center( |
|
child: Text( |
|
packageInfo!.packageName, |
|
style: Theme.of(context).textTheme.bodySmall, |
|
), |
|
), |
|
// ListTile( |
|
// title: Text(versionTitleText), |
|
// subtitle: localChangelog.isEmpty ? null : Text(localChangelog.first.title), |
|
// ), |
|
const Divider(), |
|
for (final log in mergedChangelogs) ...[ |
|
Padding( |
|
padding: const EdgeInsets.fromLTRB(8, 8, 8, 0), |
|
child: Row( |
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
children: [ |
|
Expanded( |
|
child: Text( |
|
log.version.toString(), |
|
style: Theme.of(context).textTheme.headlineMedium, |
|
), |
|
), |
|
if (localChangelog.isNotEmpty && log.version == localChangelog.first.version) |
|
Container( |
|
decoration: BoxDecoration( |
|
border: Border.all( |
|
color: Theme.of(context).colorScheme.onBackground, |
|
width: 1, |
|
), |
|
borderRadius: BorderRadius.circular(20), |
|
), |
|
child: Padding( |
|
padding: const EdgeInsets.all(4), |
|
child: Text( |
|
currentVersionText, |
|
style: const TextStyle( |
|
inherit: true, |
|
), |
|
), |
|
), |
|
), |
|
if (remoteChangelog.isNotEmpty && log.version == remoteChangelog.first.version && (localChangelog.isEmpty || localChangelog.first.version != log.version)) |
|
Container( |
|
decoration: BoxDecoration( |
|
border: Border.all( |
|
color: Colors.green, |
|
width: 1, |
|
), |
|
borderRadius: BorderRadius.circular(20), |
|
), |
|
child: Padding( |
|
padding: const EdgeInsets.all(4), |
|
child: Text( |
|
latestVersionText, |
|
style: const TextStyle( |
|
inherit: true, |
|
color: Colors.green, |
|
), |
|
), |
|
), |
|
), |
|
if (AboutPageState.download == 'apk' && log.apkLink != null) |
|
GestureDetector( |
|
onSecondaryTap: () { |
|
Clipboard.setData(ClipboardData(text: log.apkLink!.toString())); |
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar( |
|
content: Text('Link copied to clipboard'), |
|
)); |
|
}, |
|
onLongPress: () { |
|
Clipboard.setData(ClipboardData(text: log.apkLink!.toString())); |
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar( |
|
content: Text('Link copied to clipboard'), |
|
)); |
|
}, |
|
onTap: () { |
|
launchUrl( |
|
log.apkLink!, |
|
mode: LaunchMode.externalApplication, |
|
); |
|
}, |
|
behavior: HitTestBehavior.translucent, |
|
child: const Tooltip( |
|
message: 'Download APK', |
|
child: Padding( |
|
padding: EdgeInsets.all(4), |
|
child: Icon(Icons.download), |
|
), |
|
), |
|
), |
|
], |
|
), |
|
), |
|
Padding( |
|
padding: const EdgeInsets.all(8.0), |
|
child: RichText( |
|
text: TextSpan( |
|
text: log.description, |
|
), |
|
), |
|
), |
|
], |
|
], |
|
), |
|
), |
|
); |
|
} |
|
} |