mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
@@ -1,5 +1,6 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:PiliPlus/common/widgets/flutter/layout_builder.dart';
|
||||
import 'package:PiliPlus/common/widgets/gesture/tap_gesture_recognizer.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/cached_network_svg_image.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
@@ -20,7 +21,7 @@ import 'package:PiliPlus/utils/image_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/material.dart' hide LayoutBuilder;
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:get/get_navigation/src/extension_navigation.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
@@ -711,7 +712,6 @@ Widget moduleBlockedItem(
|
||||
BuildContext context,
|
||||
ThemeData theme,
|
||||
ModuleBlocked moduleBlocked,
|
||||
double maxWidth,
|
||||
) {
|
||||
late final isDarkMode = theme.brightness.isDark;
|
||||
|
||||
@@ -784,35 +784,41 @@ Widget moduleBlockedItem(
|
||||
}
|
||||
|
||||
if (moduleBlocked.blockedType == 1) {
|
||||
maxWidth = maxWidth <= 255 ? maxWidth : math.min(400, maxWidth * 0.8);
|
||||
return UnconstrainedBox(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Container(
|
||||
width: maxWidth,
|
||||
height: maxWidth,
|
||||
decoration: bgImg(),
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
if (moduleBlocked.icon != null) icon(math.max(40, maxWidth / 7)),
|
||||
if (moduleBlocked.hintMessage?.isNotEmpty == true) ...[
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
moduleBlocked.hintMessage!,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: theme.colorScheme.outline),
|
||||
),
|
||||
],
|
||||
if (moduleBlocked.button != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
btn(
|
||||
context,
|
||||
visualDensity: const VisualDensity(vertical: -2.5),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
return Align(
|
||||
alignment: .centerLeft,
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
var maxWidth = constraints.maxWidth;
|
||||
maxWidth = maxWidth <= 255 ? maxWidth : math.min(400, maxWidth * 0.8);
|
||||
return Container(
|
||||
width: maxWidth,
|
||||
height: maxWidth,
|
||||
decoration: bgImg(),
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
if (moduleBlocked.icon != null)
|
||||
icon(math.max(40, maxWidth / 7)),
|
||||
if (moduleBlocked.hintMessage?.isNotEmpty == true) ...[
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
moduleBlocked.hintMessage!,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: theme.colorScheme.outline),
|
||||
),
|
||||
],
|
||||
if (moduleBlocked.button != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
btn(
|
||||
context,
|
||||
visualDensity: const VisualDensity(vertical: -2.5),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user