Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lang information on extension manager page #173

Merged
merged 3 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/views/pages/extension/extension_repo_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class _ExtensionRepoPageState extends State<ExtensionRepoPage> {
icon: e['icon'],
version: e['version'],
package: e['package'],
lang: e['lang'],
nsfw: e['nsfw'] == 'true',
type: ExtensionType.values.firstWhere(
(element) => element.toString() == 'ExtensionType.${e['type']}',
Expand Down
96 changes: 50 additions & 46 deletions lib/views/widgets/extension/extension_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ class ExtensionCard extends StatefulWidget {
required this.version,
required this.icon,
required this.package,
required this.lang,
required this.nsfw,
required this.type,
});
final String? icon;
final String name;
final String version;
final String package;
final String lang;
final ExtensionType type;
final bool nsfw;

Expand Down Expand Up @@ -80,35 +82,34 @@ class _ExtensionCardState extends State<ExtensionCard> {
),
),
title: Text(widget.name),
subtitle: Row(
children: [
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(
widget.version,
style: const TextStyle(fontSize: 12),
),
),
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(
ExtensionUtils.typeToString(widget.type),
style: const TextStyle(fontSize: 12),
),
),
if (widget.nsfw)
const Padding(
padding: EdgeInsets.only(right: 8),
child: Text(
'18+',
style: TextStyle(
color: Colors.redAccent,
fontSize: 12,
),
subtitle: DefaultTextStyle(
style: const TextStyle(fontSize: 12),
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(widget.version),
),
),
],
),
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(ExtensionUtils.typeToString(widget.type)),
),
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(widget.lang),
),
if (widget.nsfw)
const Padding(
padding: EdgeInsets.only(right: 8),
child: Text(
'18+',
style: TextStyle(
color: Colors.redAccent,
),
),
),
],
)),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
Expand Down Expand Up @@ -172,27 +173,30 @@ class _ExtensionCardState extends State<ExtensionCard> {
),
const SizedBox(height: 8),
Text(widget.name, style: const TextStyle(fontSize: 17)),
Row(
children: [
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(
ExtensionUtils.typeToString(widget.type),
style: const TextStyle(fontSize: 12),
DefaultTextStyle(
style: const TextStyle(fontSize: 12),
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(ExtensionUtils.typeToString(widget.type)),
),
),
if (widget.nsfw)
const Padding(
padding: EdgeInsets.only(right: 8),
child: Text(
'18+',
style: TextStyle(
color: Colors.redAccent,
fontSize: 12,
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(widget.lang),
),
if (widget.nsfw)
const Padding(
padding: EdgeInsets.only(right: 8),
child: Text(
'18+',
style: TextStyle(
color: Colors.redAccent,
),
),
),
),
],
],
),
),
Row(
children: [
Expand Down