Skip to content

Commit

Permalink
fix: extension info text overlay (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaoMint authored Sep 19, 2023
1 parent 51df272 commit f99a0f6
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 53 deletions.
18 changes: 2 additions & 16 deletions lib/pages/extension_settings/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,7 @@ class _ExtensionSettingsPageState extends State<ExtensionSettingsPage> {
const SizedBox(height: 30),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: GridView(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 3,
crossAxisSpacing: 2,
mainAxisSpacing: 8,
),
child: Wrap(
children: [
InfoCard(
icon: Icons.person,
Expand Down Expand Up @@ -377,13 +369,7 @@ class _ExtensionSettingsPageState extends State<ExtensionSettingsPage> {
],
CardTile(
title: 'extension-info.other-infomation'.i18n,
child: GridView(
gridDelegate:
const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 300,
childAspectRatio: 3,
),
shrinkWrap: true,
child: Wrap(
children: [
InfoCard(
icon: fluent.FluentIcons.contact,
Expand Down
79 changes: 43 additions & 36 deletions lib/pages/extension_settings/widgets/info_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,51 @@ class InfoCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return PlatformWidget(
androidWidget: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
content,
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 4),
Expanded(
child: Text(
title,
style: Theme.of(context).textTheme.labelMedium!.copyWith(
color: Theme.of(context).colorScheme.secondary,
),
)),
],
androidWidget: Container(
width: 130,
margin: const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SelectableText(
content,
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 4),
Text(
title,
style: Theme.of(context).textTheme.labelMedium!.copyWith(
color: Theme.of(context).colorScheme.secondary,
),
),
],
),
),
desktopWidget: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
icon,
size: 14,
),
const SizedBox(width: 16),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title),
const SizedBox(height: 4),
Text(content),
],
desktopWidget: Container(
width: 200,
margin: const EdgeInsets.all(8),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
icon,
size: 14,
),
)
],
const SizedBox(width: 16),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title),
const SizedBox(height: 4),
Text(content),
],
),
)
],
),
),
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/utils/extension.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:math';

import 'package:desktop_multi_window/desktop_multi_window.dart';
import 'package:dio/dio.dart';
Expand Down

0 comments on commit f99a0f6

Please sign in to comment.