about: added source link
This commit is contained in:
parent
fb4455399f
commit
043fe51379
3 changed files with 83 additions and 54 deletions
|
@ -1,4 +1,5 @@
|
||||||
import 'package:aves/widgets/about/licenses.dart';
|
import 'package:aves/widgets/about/licenses.dart';
|
||||||
|
import 'package:aves/widgets/common/link_chip.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
||||||
|
|
||||||
|
@ -19,7 +20,9 @@ class AboutPage extends StatelessWidget {
|
||||||
delegate: SliverChildListDelegate(
|
delegate: SliverChildListDelegate(
|
||||||
[
|
[
|
||||||
Center(
|
Center(
|
||||||
child: Text.rich(
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text.rich(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
children: [
|
children: [
|
||||||
const TextSpan(text: 'Made with ❤️ and '),
|
const TextSpan(text: 'Made with ❤️ and '),
|
||||||
|
@ -31,6 +34,14 @@ class AboutPage extends StatelessWidget {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
const LinkChip(
|
||||||
|
text: 'Sources',
|
||||||
|
url: 'https://github.com/deckerst/aves',
|
||||||
|
textStyle: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import 'package:aves/utils/constants.dart';
|
import 'package:aves/utils/constants.dart';
|
||||||
import 'package:aves/utils/durations.dart';
|
import 'package:aves/utils/durations.dart';
|
||||||
import 'package:aves/widgets/common/icons.dart';
|
import 'package:aves/widgets/common/icons.dart';
|
||||||
|
import 'package:aves/widgets/common/link_chip.dart';
|
||||||
import 'package:aves/widgets/common/menu_row.dart';
|
import 'package:aves/widgets/common/menu_row.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
|
||||||
|
|
||||||
class Licenses extends StatefulWidget {
|
class Licenses extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
|
@ -115,8 +115,6 @@ class LicenseRow extends StatelessWidget {
|
||||||
|
|
||||||
const LicenseRow(this.package);
|
const LicenseRow(this.package);
|
||||||
|
|
||||||
static const borderRadius = BorderRadius.all(Radius.circular(8));
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final textTheme = Theme.of(context).textTheme;
|
final textTheme = Theme.of(context).textTheme;
|
||||||
|
@ -128,50 +126,17 @@ class LicenseRow extends StatelessWidget {
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
LinkChip(
|
||||||
borderRadius: borderRadius,
|
text: package.name,
|
||||||
onTap: () => launch(package.sourceUrl),
|
url: package.sourceUrl,
|
||||||
child: Padding(
|
textStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
padding: const EdgeInsets.all(8),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
package.name,
|
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Icon(
|
|
||||||
AIcons.openInNew,
|
|
||||||
size: bodyTextStyle.fontSize,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.only(start: 16),
|
padding: const EdgeInsetsDirectional.only(start: 16),
|
||||||
child: InkWell(
|
child: LinkChip(
|
||||||
borderRadius: borderRadius,
|
text: package.license,
|
||||||
onTap: () => launch(package.licenseUrl),
|
url: package.licenseUrl,
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
package.license,
|
|
||||||
style: TextStyle(color: subColor),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Icon(
|
|
||||||
AIcons.openInNew,
|
|
||||||
size: bodyTextStyle.fontSize,
|
|
||||||
color: subColor,
|
color: subColor,
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
53
lib/widgets/common/link_chip.dart
Normal file
53
lib/widgets/common/link_chip.dart
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
import 'package:aves/widgets/common/icons.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
class LinkChip extends StatelessWidget {
|
||||||
|
final String text;
|
||||||
|
final String url;
|
||||||
|
final Color color;
|
||||||
|
final TextStyle textStyle;
|
||||||
|
|
||||||
|
static const borderRadius = BorderRadius.all(Radius.circular(8));
|
||||||
|
|
||||||
|
const LinkChip({
|
||||||
|
Key key,
|
||||||
|
@required this.text,
|
||||||
|
@required this.url,
|
||||||
|
this.color,
|
||||||
|
this.textStyle,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final effectiveTextStyle = (textStyle ?? DefaultTextStyle.of(context).style).copyWith(
|
||||||
|
color: color,
|
||||||
|
);
|
||||||
|
return InkWell(
|
||||||
|
borderRadius: borderRadius,
|
||||||
|
onTap: () async {
|
||||||
|
if (await canLaunch(url)) {
|
||||||
|
await launch(url);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
text,
|
||||||
|
style: effectiveTextStyle,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Icon(
|
||||||
|
AIcons.openInNew,
|
||||||
|
size: Theme.of(context).textTheme.bodyText2.fontSize,
|
||||||
|
color: color,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue