-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b0bb2f
commit be2348f
Showing
16 changed files
with
536 additions
and
508 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:github/github.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:ubuntu_service/ubuntu_service.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
import 'package:yaru_icons/yaru_icons.dart'; | ||
import 'package:yaru_widgets/yaru_widgets.dart'; | ||
|
||
import '../../build_context_x.dart'; | ||
import '../../common.dart'; | ||
import '../../constants.dart'; | ||
import '../../l10n.dart'; | ||
import 'settings_model.dart'; | ||
|
||
const _kTileSize = 50.0; | ||
|
||
class AboutPage extends StatelessWidget { | ||
const AboutPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = context.t; | ||
final appName = context.select((SettingsModel m) => m.appName); | ||
final linkStyle = theme.textTheme.bodyLarge | ||
?.copyWith(color: Colors.lightBlue, overflow: TextOverflow.visible); | ||
const maxLines = 3; | ||
|
||
return Container( | ||
decoration: BoxDecoration( | ||
color: Theme.of(context).colorScheme.background, | ||
borderRadius: BorderRadius.circular(10), | ||
), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
YaruDialogTitleBar( | ||
title: Text('${context.l10n.about} ${appName ?? ''}'), | ||
leading: YaruBackButton( | ||
style: YaruBackButtonStyle.rounded, | ||
onPressed: () => Navigator.of(context).pop(), | ||
), | ||
), | ||
Expanded( | ||
child: Padding( | ||
padding: const EdgeInsets.all(kYaruPagePadding), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
TapAbleText( | ||
text: | ||
'MusicPod is made by Frederik Feichtmeier. If you like MusicPod, please sponsor me!', | ||
onTap: () => launchUrl(Uri.parse(kSponsorLink)), | ||
style: linkStyle, | ||
maxLines: maxLines, | ||
), | ||
const SizedBox( | ||
height: kYaruPagePadding, | ||
), | ||
TapAbleText( | ||
onTap: () => | ||
launchUrl(Uri.parse('https://ko-fi.com/amugofjava')), | ||
text: | ||
'MusicPod uses Podcast Search to find podcasts which is made by Ben Hills, please sponsor him!', | ||
style: linkStyle, | ||
maxLines: maxLines, | ||
), | ||
const SizedBox( | ||
height: kYaruPagePadding, | ||
), | ||
TapAbleText( | ||
onTap: () => launchUrl( | ||
Uri.parse('https://github.com/sponsors/alexmercerind'), | ||
), | ||
text: | ||
'MusicPod uses MediaKit to play Media which is made by Hitesh Kumar Saini, please sponsor him!', | ||
style: linkStyle, | ||
maxLines: maxLines, | ||
), | ||
const SizedBox( | ||
height: kYaruPagePadding, | ||
), | ||
TapAbleText( | ||
onTap: () => | ||
launchUrl(Uri.parse('https://github.com/kenvandine')), | ||
text: | ||
'MusicPod Snap packaging is made by Ken VanDine, please sponsor him!', | ||
style: linkStyle, | ||
maxLines: maxLines, | ||
), | ||
const SizedBox( | ||
height: 2 * kYaruPagePadding, | ||
), | ||
Text( | ||
context.l10n.contributors, | ||
style: theme.textTheme.bodyLarge, | ||
), | ||
Expanded( | ||
child: FutureBuilder<List<Contributor>>( | ||
future: _loadContributors(), | ||
builder: (context, snapshot) { | ||
if (snapshot.hasData) { | ||
return SizedBox( | ||
height: 300, | ||
child: GridView.builder( | ||
padding: | ||
const EdgeInsets.only(bottom: 20, top: 10), | ||
gridDelegate: | ||
const SliverGridDelegateWithMaxCrossAxisExtent( | ||
maxCrossAxisExtent: _kTileSize, | ||
mainAxisExtent: _kTileSize, | ||
mainAxisSpacing: 10, | ||
crossAxisSpacing: 10, | ||
), | ||
itemCount: snapshot.data!.length, | ||
itemBuilder: (context, index) { | ||
final e = snapshot.data!.elementAt(index); | ||
return InkWell( | ||
borderRadius: BorderRadius.circular(100), | ||
onTap: e.htmlUrl == null | ||
? null | ||
: () => launchUrl(Uri.parse(e.htmlUrl!)), | ||
child: CircleAvatar( | ||
backgroundImage: e.avatarUrl != null | ||
? NetworkImage( | ||
e.avatarUrl!, | ||
) | ||
: null, | ||
child: e.avatarUrl == null | ||
? const YaruPlaceholderIcon( | ||
size: Size.square(_kTileSize), | ||
) | ||
: null, | ||
), | ||
); | ||
}, | ||
), | ||
); | ||
} else { | ||
return const Center( | ||
child: Progress(), | ||
); | ||
} | ||
}, | ||
), | ||
), | ||
TapAbleText( | ||
style: linkStyle, | ||
onTap: () => launchUrl(Uri.parse(kRepoUrl)), | ||
text: | ||
'Copyright by Frederik Feichtmeier 2023 and onwards - all rights reserved.', | ||
maxLines: maxLines, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
|
||
Future<List<Contributor>> _loadContributors() async { | ||
final github = getService<GitHub>(); | ||
return (await github.repositories | ||
.listContributors( | ||
RepositorySlug.full(kGitHubShortLink), | ||
) | ||
.where((c) => c.type == 'User') | ||
.toList()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:yaru_widgets/yaru_widgets.dart'; | ||
|
||
class LicensePage extends StatelessWidget { | ||
const LicensePage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
decoration: BoxDecoration( | ||
color: Theme.of(context).colorScheme.background, | ||
borderRadius: BorderRadius.circular(10), | ||
), | ||
child: ClipRRect( | ||
borderRadius: const BorderRadius.only( | ||
bottomLeft: Radius.circular(8.0), | ||
bottomRight: Radius.circular(8.0), | ||
), | ||
child: Column( | ||
children: [ | ||
const YaruDialogTitleBar(), | ||
Expanded( | ||
child: Theme( | ||
data: Theme.of(context).copyWith( | ||
pageTransitionsTheme: | ||
YaruMasterDetailTheme.of(context).landscapeTransitions, | ||
), | ||
child: const Padding( | ||
padding: EdgeInsets.all(kYaruPagePadding), | ||
child: LicensePage(), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.