🐛 Fix web issue

This commit is contained in:
LittleSheep 2024-07-27 20:27:29 +08:00
parent 056b98db07
commit 7e98edfbc9
5 changed files with 26 additions and 15 deletions

View File

@ -2,6 +2,7 @@ import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_acrylic/flutter_acrylic.dart'; import 'package:flutter_acrylic/flutter_acrylic.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:go_router/go_router.dart';
import 'package:media_kit/media_kit.dart'; import 'package:media_kit/media_kit.dart';
import 'package:protocol_handler/protocol_handler.dart'; import 'package:protocol_handler/protocol_handler.dart';
import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_flutter/sentry_flutter.dart';
@ -21,6 +22,7 @@ import 'package:solian/router.dart';
import 'package:solian/shells/system_shell.dart'; import 'package:solian/shells/system_shell.dart';
import 'package:solian/theme.dart'; import 'package:solian/theme.dart';
import 'package:solian/translations.dart'; import 'package:solian/translations.dart';
import 'package:flutter_web_plugins/url_strategy.dart' show usePathUrlStrategy;
void main() async { void main() async {
await SentryFlutter.init( await SentryFlutter.init(
@ -39,6 +41,9 @@ void main() async {
_initializePlatformComponents(), _initializePlatformComponents(),
]); ]);
GoRouter.optionURLReflectsImperativeAPIs = true;
usePathUrlStrategy();
runApp(const SolianApp()); runApp(const SolianApp());
}, },
); );

View File

@ -326,6 +326,7 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
borderRadius: radius, borderRadius: radius,
child: AttachmentListEntry( child: AttachmentListEntry(
item: item, item: item,
isDense: true,
parentId: 'album', parentId: 'album',
showMature: _showMature, showMature: _showMature,
onReveal: (value) { onReveal: (value) {

View File

@ -214,6 +214,7 @@ class AttachmentListEntry extends StatelessWidget {
final bool showBorder; final bool showBorder;
final bool showBadge; final bool showBadge;
final bool showMature; final bool showMature;
final bool isDense;
final Function(bool) onReveal; final Function(bool) onReveal;
const AttachmentListEntry({ const AttachmentListEntry({
@ -226,6 +227,7 @@ class AttachmentListEntry extends StatelessWidget {
this.showBorder = false, this.showBorder = false,
this.showBadge = false, this.showBadge = false,
this.showMature = false, this.showMature = false,
this.isDense = false,
}); });
@override @override
@ -295,20 +297,22 @@ class AttachmentListEntry extends StatelessWidget {
color: Colors.white, color: Colors.white,
size: 32, size: 32,
), ),
const SizedBox(height: 8), if (!isDense) const SizedBox(height: 8),
Text( if (!isDense)
'matureContent'.tr, Text(
style: const TextStyle( 'matureContent'.tr,
color: Colors.white, style: const TextStyle(
fontWeight: FontWeight.bold, color: Colors.white,
fontSize: 16, fontWeight: FontWeight.bold,
fontSize: 16,
),
),
if (!isDense)
Text(
'matureContentCaption'.tr,
style: const TextStyle(color: Colors.white),
textAlign: TextAlign.center,
), ),
),
Text(
'matureContentCaption'.tr,
style: const TextStyle(color: Colors.white),
textAlign: TextAlign.center,
),
], ],
), ),
), ),

View File

@ -628,7 +628,7 @@ packages:
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_web_plugins: flutter_web_plugins:
dependency: transitive dependency: "direct main"
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"

View File

@ -10,7 +10,8 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
flutter_web_plugins:
sdk: flutter
cupertino_icons: ^1.0.6 cupertino_icons: ^1.0.6
go_router: ^14.1.1 go_router: ^14.1.1
get: ^4.6.6 get: ^4.6.6