Skip to content

Commit

Permalink
refactor: use table in about
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jun 18, 2023
1 parent 93bd4dc commit af6ab5f
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 63 deletions.
119 changes: 60 additions & 59 deletions lib/pages/settings/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:spotube/collections/assets.gen.dart';
import 'package:spotube/components/shared/image/universal_image.dart';
import 'package:spotube/components/shared/links/hyper_link.dart';
import 'package:spotube/components/shared/page_window_title_bar.dart';
import 'package:spotube/extensions/context.dart';
import 'package:spotube/hooks/use_package_info.dart';
Expand All @@ -24,6 +25,8 @@ class AboutSpotube extends HookConsumerWidget {
final license = ref.watch(_licenseProvider);
final theme = Theme.of(context);

final colon = Text(":");

return Scaffold(
appBar: PageWindowTitleBar(
leading: const BackButton(),
Expand All @@ -40,77 +43,75 @@ class AboutSpotube extends HookConsumerWidget {
),
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
context.l10n.spotube_description,
style: theme.textTheme.titleLarge,
),
const SizedBox(height: 20),
Row(
mainAxisSize: MainAxisSize.min,
Table(
columnWidths: const {
0: FixedColumnWidth(95),
1: FixedColumnWidth(10),
2: IntrinsicColumnWidth(),
},
children: [
Text(
"${context.l10n.founder}: ${context.l10n.kingkor_roy_tirtho}",
style: const TextStyle(
fontWeight: FontWeight.bold,
),
TableRow(
children: [
Text(context.l10n.founder),
colon,
Hyperlink(
context.l10n.kingkor_roy_tirtho,
"https://github.com/KRTirtho",
)
],
),
TableRow(
children: [
Text(context.l10n.version),
colon,
Text("v${packageInfo.version}")
],
),
const SizedBox(width: 5),
CircleAvatar(
radius: 20,
child: ClipOval(
child: Image.network(
"https://avatars.githubusercontent.com/u/61944859?v=4",
TableRow(
children: [
Text(context.l10n.build_number),
colon,
Text(packageInfo.buildNumber.replaceAll(".", " "))
],
),
TableRow(
children: [
Text(context.l10n.repository),
colon,
const Hyperlink(
"github.com/KRTirtho/spotube",
"https://github.com/KRTirtho/spotube",
),
),
],
),
TableRow(
children: [
Text(context.l10n.license),
colon,
const Hyperlink(
"BSD-4-Clause",
"https://raw.githubusercontent.com/KRTirtho/spotube/master/LICENSE",
),
],
),
TableRow(
children: [
Text(context.l10n.bug_issues),
colon,
const Hyperlink(
"github.com/KRTirtho/spotube/issues",
"https://github.com/KRTirtho/spotube/issues",
),
],
),
],
),
const SizedBox(height: 5),
Text(
"${context.l10n.version}: v${packageInfo.version}",
),
const SizedBox(height: 5),
Text(
"${context.l10n.build_number}: ${packageInfo.buildNumber.replaceAll(".", " ")}",
),
const SizedBox(height: 5),
InkWell(
onTap: () {
launchUrlString(
"https://github.com/KRTirtho/spotube",
mode: LaunchMode.externalApplication,
);
},
child: Text(
"${context.l10n.repository}: https://github.com/KRTirtho/spotube",
),
),
const SizedBox(height: 5),
InkWell(
onTap: () {
launchUrlString(
"https://raw.githubusercontent.com/KRTirtho/spotube/master/LICENSE",
mode: LaunchMode.externalApplication,
);
},
child: Text(
"${context.l10n.license}: BSD-4-Clause",
),
),
const SizedBox(height: 5),
InkWell(
onTap: () {
launchUrlString(
"https://github.com/KRTirtho/spotube/issues",
mode: LaunchMode.externalApplication,
);
},
child: Text(
"${context.l10n.bug_issues}: https://github.com/KRTirtho/spotube/issues",
),
),
],
),
),
Expand Down
9 changes: 5 additions & 4 deletions lib/pages/settings/blacklist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';

import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/shared/page_window_title_bar.dart';
import 'package:spotube/extensions/context.dart';
import 'package:spotube/provider/blacklist_provider.dart';

class BlackListPage extends HookConsumerWidget {
Expand Down Expand Up @@ -38,7 +39,7 @@ class BlackListPage extends HookConsumerWidget {

return Scaffold(
appBar: PageWindowTitleBar(
title: const Text("Blacklist"),
title: Text(context.l10n.blacklist),
centerTitle: true,
leading: const BackButton(),
),
Expand All @@ -49,9 +50,9 @@ class BlackListPage extends HookConsumerWidget {
padding: const EdgeInsets.all(8.0),
child: TextField(
onChanged: (value) => searchText.value = value,
decoration: const InputDecoration(
hintText: "Search",
prefixIcon: Icon(SpotubeIcons.search),
decoration: InputDecoration(
hintText: context.l10n.search,
prefixIcon: const Icon(SpotubeIcons.search),
),
),
),
Expand Down

0 comments on commit af6ab5f

Please sign in to comment.