Skip to content

Commit

Permalink
feat: Add lang information on extension manager page (#173)
Browse files Browse the repository at this point in the history
* Add lang information on extension manager page

* Put language after extension type on Android

* upload

---------

Co-authored-by: MiaoMint <miaomint@0u0.ren>
  • Loading branch information
sub-versivo and MiaoMint authored Jan 13, 2024
1 parent 5eb25d2 commit 9b41e90
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 46 deletions.
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

0 comments on commit 9b41e90

Please sign in to comment.