Add downloads for Windows and Linux
This commit is contained in:
parent
1269a93624
commit
1e4ca0c61b
5 changed files with 128 additions and 2 deletions
|
@ -38,7 +38,7 @@ workflows:
|
|||
cd "$pwd"
|
||||
cp build/ios/Payload.zip build/ios/ipa/infotren.ipa
|
||||
artifacts:
|
||||
- build/ios/*.zip
|
||||
# - build/ios/*.zip
|
||||
- build/ios/ipa/*.ipa
|
||||
- /tmp/xcodebuild_logs/*.log
|
||||
- flutter_drive.log
|
||||
|
|
|
@ -12,5 +12,7 @@ Future<List<ChangelogEntry>> getRemoteReleases() async {
|
|||
version: ChangelogVersion.parse(e['tag_name']),
|
||||
description: e['body'],
|
||||
apkLink: (e['assets'] as List<dynamic>).where((e) => (e['name'] as String).contains('.apk')).map((e) => Uri.parse(e['browser_download_url'] as String)).firstOrNull,
|
||||
linuxLink: (e['assets'] as List<dynamic>).where((e) => (e['name'] as String).contains('infotren-linux')).map((e) => Uri.parse(e['browser_download_url'] as String)).firstOrNull,
|
||||
windowsLink: (e['assets'] as List<dynamic>).where((e) => (e['name'] as String).contains('-win.zip')).map((e) => Uri.parse(e['browser_download_url'] as String)).firstOrNull,
|
||||
)).toList();
|
||||
}
|
|
@ -4,8 +4,16 @@ class ChangelogEntry {
|
|||
final ChangelogVersion version;
|
||||
final String description;
|
||||
final Uri? apkLink;
|
||||
final Uri? linuxLink;
|
||||
final Uri? windowsLink;
|
||||
|
||||
ChangelogEntry({required this.version, required this.description, this.apkLink});
|
||||
ChangelogEntry({
|
||||
required this.version,
|
||||
required this.description,
|
||||
this.apkLink,
|
||||
this.linuxLink,
|
||||
this.windowsLink,
|
||||
});
|
||||
|
||||
factory ChangelogEntry.fromTextBlock(String text) {
|
||||
final lines = text.split(RegExp(r'(\r?\n)+'));
|
||||
|
|
|
@ -120,6 +120,64 @@ class AboutPageStateFluent extends AboutPageState<AboutPageFluent> {
|
|||
),
|
||||
),
|
||||
),
|
||||
if (AboutPageState.download == 'linux' && log.linuxLink != null)
|
||||
GestureDetector(
|
||||
onSecondaryTap: () {
|
||||
Clipboard.setData(ClipboardData(text: log.linuxLink!.toString()));
|
||||
// ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
// content: Text('Link copied to clipboard'),
|
||||
// ));
|
||||
},
|
||||
onLongPress: () {
|
||||
Clipboard.setData(ClipboardData(text: log.linuxLink!.toString()));
|
||||
// ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
// content: Text('Link copied to clipboard'),
|
||||
// ));
|
||||
},
|
||||
onTap: () {
|
||||
launchUrl(
|
||||
log.linuxLink!,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
behavior: HitTestBehavior.translucent,
|
||||
child: const Tooltip(
|
||||
message: 'Download Linux ZIP',
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
child: Icon(FluentIcons.download),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (AboutPageState.download == 'windows' && log.windowsLink != null)
|
||||
GestureDetector(
|
||||
onSecondaryTap: () {
|
||||
Clipboard.setData(ClipboardData(text: log.windowsLink!.toString()));
|
||||
// ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
// content: Text('Link copied to clipboard'),
|
||||
// ));
|
||||
},
|
||||
onLongPress: () {
|
||||
Clipboard.setData(ClipboardData(text: log.windowsLink!.toString()));
|
||||
// ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
// content: Text('Link copied to clipboard'),
|
||||
// ));
|
||||
},
|
||||
onTap: () {
|
||||
launchUrl(
|
||||
log.windowsLink!,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
behavior: HitTestBehavior.translucent,
|
||||
child: const Tooltip(
|
||||
message: 'Download Windows App ZIP',
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
child: Icon(FluentIcons.download),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -121,6 +121,64 @@ class AboutPageStateMaterial extends AboutPageState<AboutPageMaterial> {
|
|||
),
|
||||
),
|
||||
),
|
||||
if (AboutPageState.download == 'linux' && log.linuxLink != null)
|
||||
GestureDetector(
|
||||
onSecondaryTap: () {
|
||||
Clipboard.setData(ClipboardData(text: log.linuxLink!.toString()));
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
content: Text('Link copied to clipboard'),
|
||||
));
|
||||
},
|
||||
onLongPress: () {
|
||||
Clipboard.setData(ClipboardData(text: log.linuxLink!.toString()));
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
content: Text('Link copied to clipboard'),
|
||||
));
|
||||
},
|
||||
onTap: () {
|
||||
launchUrl(
|
||||
log.linuxLink!,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
behavior: HitTestBehavior.translucent,
|
||||
child: const Tooltip(
|
||||
message: 'Download Linux ZIP',
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
child: Icon(Icons.download),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (AboutPageState.download == 'windows' && log.windowsLink != null)
|
||||
GestureDetector(
|
||||
onSecondaryTap: () {
|
||||
Clipboard.setData(ClipboardData(text: log.windowsLink!.toString()));
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
content: Text('Link copied to clipboard'),
|
||||
));
|
||||
},
|
||||
onLongPress: () {
|
||||
Clipboard.setData(ClipboardData(text: log.windowsLink!.toString()));
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
content: Text('Link copied to clipboard'),
|
||||
));
|
||||
},
|
||||
onTap: () {
|
||||
launchUrl(
|
||||
log.windowsLink!,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
behavior: HitTestBehavior.translucent,
|
||||
child: const Tooltip(
|
||||
message: 'Download Windows App ZIP',
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
child: Icon(Icons.download),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue