mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-29 15:00:14 +08:00
@@ -29,6 +29,8 @@ import 'package:PiliPlus/utils/page_utils.dart';
|
|||||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||||
import 'package:flutter/material.dart'
|
import 'package:flutter/material.dart'
|
||||||
hide CustomMultiChildLayout, MultiChildLayoutDelegate;
|
hide CustomMultiChildLayout, MultiChildLayoutDelegate;
|
||||||
|
import 'package:get/get_core/src/get_main.dart';
|
||||||
|
import 'package:get/get_navigation/get_navigation.dart';
|
||||||
|
|
||||||
class ImageModel {
|
class ImageModel {
|
||||||
ImageModel({
|
ImageModel({
|
||||||
@@ -74,6 +76,7 @@ class CustomGridView extends StatelessWidget {
|
|||||||
final bool fullScreen;
|
final bool fullScreen;
|
||||||
|
|
||||||
static bool horizontalPreview = Pref.horizontalPreview;
|
static bool horizontalPreview = Pref.horizontalPreview;
|
||||||
|
static final _regex = RegExp(r'/(videoV|dynamicDetail)');
|
||||||
|
|
||||||
void onTap(BuildContext context, int index) {
|
void onTap(BuildContext context, int index) {
|
||||||
final imgList = picArr.map(
|
final imgList = picArr.map(
|
||||||
@@ -90,6 +93,7 @@ class CustomGridView extends StatelessWidget {
|
|||||||
).toList();
|
).toList();
|
||||||
if (horizontalPreview &&
|
if (horizontalPreview &&
|
||||||
!fullScreen &&
|
!fullScreen &&
|
||||||
|
Get.currentRoute.startsWith(_regex) &&
|
||||||
!context.mediaQuerySize.isPortrait) {
|
!context.mediaQuerySize.isPortrait) {
|
||||||
final scaffoldState = Scaffold.maybeOf(context);
|
final scaffoldState = Scaffold.maybeOf(context);
|
||||||
if (scaffoldState != null) {
|
if (scaffoldState != null) {
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ class _AudioPageState extends State<AudioPage> {
|
|||||||
final isPortrait = MediaQuery.sizeOf(context).isPortrait;
|
final isPortrait = MediaQuery.sizeOf(context).isPortrait;
|
||||||
final padding = MediaQuery.viewPaddingOf(context);
|
final padding = MediaQuery.viewPaddingOf(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
actions: [
|
actions: [
|
||||||
Builder(
|
Builder(
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ class _DLNAPageState extends State<DLNAPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final colorScheme = ColorScheme.of(context);
|
final colorScheme = ColorScheme.of(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('投屏'),
|
title: const Text('投屏'),
|
||||||
actions: [
|
actions: [
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ class _DownloadingPageState extends State<DownloadingPage>
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: MultiSelectAppBarWidget(
|
appBar: MultiSelectAppBarWidget(
|
||||||
ctr: this,
|
ctr: this,
|
||||||
child: AppBar(
|
child: AppBar(
|
||||||
|
|||||||
@@ -79,28 +79,25 @@ class FollowItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (isOwner ?? false)
|
if (isOwner ?? false)
|
||||||
SizedBox(
|
FilledButton.tonal(
|
||||||
height: 34,
|
onPressed: () => RequestUtils.actionRelationMod(
|
||||||
child: FilledButton.tonal(
|
context: context,
|
||||||
onPressed: () => RequestUtils.actionRelationMod(
|
mid: item.mid,
|
||||||
context: context,
|
isFollow: item.attribute != -1,
|
||||||
mid: item.mid,
|
callback: callback,
|
||||||
isFollow: item.attribute != -1,
|
),
|
||||||
callback: callback,
|
style: FilledButton.styleFrom(
|
||||||
),
|
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
|
||||||
style: FilledButton.styleFrom(
|
foregroundColor: item.attribute == -1
|
||||||
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
|
? null
|
||||||
foregroundColor: item.attribute == -1
|
: colorScheme.outline,
|
||||||
? null
|
backgroundColor: item.attribute == -1
|
||||||
: colorScheme.outline,
|
? null
|
||||||
backgroundColor: item.attribute == -1
|
: colorScheme.onInverseSurface,
|
||||||
? null
|
),
|
||||||
: colorScheme.onInverseSurface,
|
child: Text(
|
||||||
),
|
'${item.attribute == -1 ? '' : '已'}关注',
|
||||||
child: Text(
|
style: const TextStyle(fontSize: 12),
|
||||||
'${item.attribute == -1 ? '' : '已'}关注',
|
|
||||||
style: const TextStyle(fontSize: 12),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/pages/log_table/controller.dart';
|
import 'package:PiliPlus/pages/log_table/controller.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -21,23 +22,18 @@ class _LogPageState<T> extends State<LogPage<T>> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: AppBar(title: Text(_controller.title)),
|
appBar: AppBar(title: Text(_controller.title)),
|
||||||
body: Center(
|
body: CustomScrollView(
|
||||||
child: ConstrainedBox(
|
slivers: [
|
||||||
constraints: const BoxConstraints(maxWidth: 680),
|
SliverPadding(
|
||||||
child: CustomScrollView(
|
padding: EdgeInsets.only(
|
||||||
slivers: [
|
left: 10 + padding.left,
|
||||||
SliverPadding(
|
right: 10 + padding.right,
|
||||||
padding: EdgeInsets.only(
|
bottom: padding.bottom + 100,
|
||||||
left: 10 + padding.left,
|
),
|
||||||
right: 10 + padding.right,
|
sliver: Obx(() => _buildBody(_controller.loadingState.value)),
|
||||||
bottom: padding.bottom + 100,
|
|
||||||
),
|
|
||||||
sliver: Obx(() => _buildBody(_controller.loadingState.value)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
).constraintWidth(constraints: const BoxConstraints(maxWidth: 680)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -612,13 +612,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
Widget tabViewOuter(Widget child) {
|
Widget tabViewOuter(Widget child) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
padding: padding,
|
padding: padding,
|
||||||
child: Align(
|
child: child.constraintWidth(),
|
||||||
alignment: Alignment.topCenter,
|
|
||||||
child: ConstrainedBox(
|
|
||||||
constraints: const BoxConstraints(maxWidth: 600),
|
|
||||||
child: child,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:PiliPlus/common/widgets/view_sliver_safe_area.dart';
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models_new/login_devices/device.dart';
|
import 'package:PiliPlus/models_new/login_devices/device.dart';
|
||||||
import 'package:PiliPlus/pages/login_devices/controller.dart';
|
import 'package:PiliPlus/pages/login_devices/controller.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:flutter/material.dart' hide ListTile;
|
import 'package:flutter/material.dart' hide ListTile;
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -22,27 +23,23 @@ class LoginDevicesPageState extends State<LoginDevicesPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
final colorScheme = Theme.of(context).colorScheme;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: AppBar(title: const Text('登录设备')),
|
appBar: AppBar(title: const Text('登录设备')),
|
||||||
body: Center(
|
body: refreshIndicator(
|
||||||
child: ConstrainedBox(
|
onRefresh: _controller.onRefresh,
|
||||||
constraints: const BoxConstraints(maxWidth: 650),
|
child: CustomScrollView(
|
||||||
child: refreshIndicator(
|
slivers: [
|
||||||
onRefresh: _controller.onRefresh,
|
ViewSliverSafeArea(
|
||||||
child: CustomScrollView(
|
sliver: Obx(
|
||||||
slivers: [
|
() => _buildBody(
|
||||||
ViewSliverSafeArea(
|
colorScheme,
|
||||||
sliver: Obx(
|
_controller.loadingState.value,
|
||||||
() => _buildBody(
|
|
||||||
colorScheme,
|
|
||||||
_controller.loadingState.value,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
).constraintWidth(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import 'package:PiliPlus/http/loading_state.dart';
|
|||||||
import 'package:PiliPlus/pages/main_reply/controller.dart';
|
import 'package:PiliPlus/pages/main_reply/controller.dart';
|
||||||
import 'package:PiliPlus/pages/video/reply/widgets/reply_item_grpc.dart';
|
import 'package:PiliPlus/pages/video/reply/widgets/reply_item_grpc.dart';
|
||||||
import 'package:PiliPlus/pages/video/reply_reply/view.dart';
|
import 'package:PiliPlus/pages/video/reply_reply/view.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/feed_back.dart';
|
import 'package:PiliPlus/utils/feed_back.dart';
|
||||||
import 'package:PiliPlus/utils/num_utils.dart';
|
import 'package:PiliPlus/utils/num_utils.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
@@ -55,9 +56,8 @@ class _MainReplyPageState extends State<MainReplyPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final colorScheme = ColorScheme.of(context);
|
final colorScheme = ColorScheme.of(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
resizeToAvoidBottomInset: false,
|
||||||
title: const Text('查看评论'),
|
appBar: AppBar(title: const Text('查看评论')),
|
||||||
),
|
|
||||||
body: NotificationListener<UserScrollNotification>(
|
body: NotificationListener<UserScrollNotification>(
|
||||||
onNotification: (notification) {
|
onNotification: (notification) {
|
||||||
final direction = notification.direction;
|
final direction = notification.direction;
|
||||||
@@ -84,7 +84,7 @@ class _MainReplyPageState extends State<MainReplyPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
).constraintWidth(),
|
||||||
),
|
),
|
||||||
floatingActionButton: SlideTransition(
|
floatingActionButton: SlideTransition(
|
||||||
position: _controller.fabAnim,
|
position: _controller.fabAnim,
|
||||||
@@ -247,7 +247,7 @@ class _MainReplyPageState extends State<MainReplyPage> {
|
|||||||
replyType: _controller.replyType,
|
replyType: _controller.replyType,
|
||||||
firstFloor: replyItem,
|
firstFloor: replyItem,
|
||||||
),
|
),
|
||||||
),
|
).constraintWidth(),
|
||||||
),
|
),
|
||||||
routeName: 'dynamicDetail-Copy',
|
routeName: 'dynamicDetail-Copy',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class _MatchInfoPageState extends CommonDynPageState<MatchInfoPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
).constraintWidth(),
|
||||||
floatingActionButton: SlideTransition(
|
floatingActionButton: SlideTransition(
|
||||||
position: fabAnim,
|
position: fabAnim,
|
||||||
child: replyButton,
|
child: replyButton,
|
||||||
@@ -220,7 +220,7 @@ class _MatchInfoPageState extends CommonDynPageState<MatchInfoPage> {
|
|||||||
replyType: controller.replyType,
|
replyType: controller.replyType,
|
||||||
firstFloor: replyItem,
|
firstFloor: replyItem,
|
||||||
),
|
),
|
||||||
),
|
).constraintWidth(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:PiliPlus/http/loading_state.dart';
|
|||||||
import 'package:PiliPlus/models/common/image_type.dart';
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models_new/upower_rank/rank_info.dart';
|
import 'package:PiliPlus/models_new/upower_rank/rank_info.dart';
|
||||||
import 'package:PiliPlus/pages/member_upower_rank/controller.dart';
|
import 'package:PiliPlus/pages/member_upower_rank/controller.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart' hide ListTile;
|
import 'package:flutter/material.dart' hide ListTile;
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -93,76 +94,71 @@ class _UpowerRankPageState extends State<UpowerRankPage>
|
|||||||
),
|
),
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: EdgeInsets.only(left: padding.left, right: padding.right),
|
padding: EdgeInsets.only(left: padding.left, right: padding.right),
|
||||||
child: Center(
|
child: Obx(
|
||||||
child: ConstrainedBox(
|
() {
|
||||||
constraints: const BoxConstraints(maxWidth: 625),
|
final tabs = _controller.tabs.value;
|
||||||
child: Obx(
|
return tabs != null
|
||||||
() {
|
? DefaultTabController(
|
||||||
final tabs = _controller.tabs.value;
|
length: tabs.length,
|
||||||
return tabs != null
|
child: Builder(
|
||||||
? DefaultTabController(
|
builder: (context) {
|
||||||
length: tabs.length,
|
return Column(
|
||||||
child: Builder(
|
children: [
|
||||||
builder: (context) {
|
TabBar(
|
||||||
return Column(
|
isScrollable: true,
|
||||||
children: [
|
tabAlignment: TabAlignment.start,
|
||||||
TabBar(
|
tabs: tabs
|
||||||
isScrollable: true,
|
.map(
|
||||||
tabAlignment: TabAlignment.start,
|
(e) => Tab(
|
||||||
tabs: tabs
|
text:
|
||||||
.map(
|
'${e.name!}(${e.memberTotal ?? 0})',
|
||||||
(e) => Tab(
|
),
|
||||||
text:
|
)
|
||||||
'${e.name!}(${e.memberTotal ?? 0})',
|
.toList(),
|
||||||
),
|
onTap: (index) {
|
||||||
)
|
if (!DefaultTabController.of(
|
||||||
.toList(),
|
context,
|
||||||
onTap: (index) {
|
).indexIsChanging) {
|
||||||
if (!DefaultTabController.of(
|
try {
|
||||||
context,
|
if (index == 0) {
|
||||||
).indexIsChanging) {
|
_controller.animateToTop();
|
||||||
try {
|
} else {
|
||||||
if (index == 0) {
|
Get.find<UpowerRankController>(
|
||||||
_controller.animateToTop();
|
tag:
|
||||||
} else {
|
'$_tag${tabs[index].privilegeType}',
|
||||||
Get.find<UpowerRankController>(
|
).animateToTop();
|
||||||
tag:
|
|
||||||
'$_tag${tabs[index].privilegeType}',
|
|
||||||
).animateToTop();
|
|
||||||
}
|
|
||||||
} catch (_) {}
|
|
||||||
}
|
}
|
||||||
},
|
} catch (_) {}
|
||||||
),
|
}
|
||||||
Expanded(
|
},
|
||||||
child: tabBarView(
|
),
|
||||||
children: [
|
Expanded(
|
||||||
KeepAliveWrapper(
|
child: tabBarView(
|
||||||
builder: (context) => child,
|
children: [
|
||||||
),
|
KeepAliveWrapper(
|
||||||
...tabs
|
builder: (context) => child,
|
||||||
.skip(1)
|
|
||||||
.map(
|
|
||||||
(e) => UpowerRankPage(
|
|
||||||
upMid: _upMid,
|
|
||||||
tag: _tag,
|
|
||||||
privilegeType: e.privilegeType,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
...tabs
|
||||||
],
|
.skip(1)
|
||||||
);
|
.map(
|
||||||
},
|
(e) => UpowerRankPage(
|
||||||
),
|
upMid: _upMid,
|
||||||
)
|
tag: _tag,
|
||||||
: child;
|
privilegeType: e.privilegeType,
|
||||||
},
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: child;
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
).constraintWidth(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return child;
|
return child;
|
||||||
|
|||||||
@@ -227,12 +227,9 @@ class _PayCoinsPageState extends State<PayCoinsPage>
|
|||||||
final isPortrait = size.isPortrait;
|
final isPortrait = size.isPortrait;
|
||||||
return isPortrait
|
return isPortrait
|
||||||
? _buildBody(isPortrait)
|
? _buildBody(isPortrait)
|
||||||
: Center(
|
: _buildBody(isPortrait).constraintWidth(
|
||||||
child: ConstrainedBox(
|
constraints: BoxConstraints(
|
||||||
constraints: BoxConstraints(
|
maxWidth: math.min(525, size.width * 0.6),
|
||||||
maxWidth: math.min(525, size.width * 0.6),
|
|
||||||
),
|
|
||||||
child: _buildBody(isPortrait),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:PiliPlus/pages/common/slide/common_slide_page.dart';
|
|||||||
import 'package:PiliPlus/pages/video/reply/widgets/reply_item_grpc.dart';
|
import 'package:PiliPlus/pages/video/reply/widgets/reply_item_grpc.dart';
|
||||||
import 'package:PiliPlus/pages/video/reply_reply/controller.dart';
|
import 'package:PiliPlus/pages/video/reply_reply/controller.dart';
|
||||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/num_utils.dart';
|
import 'package:PiliPlus/utils/num_utils.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
||||||
@@ -83,7 +84,7 @@ class VideoReplyReplyPanel extends CommonSlidePage {
|
|||||||
firstFloor: null,
|
firstFloor: null,
|
||||||
id: rpId,
|
id: rpId,
|
||||||
),
|
),
|
||||||
),
|
).constraintWidth(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class _WebviewPageState extends State<WebviewPage> {
|
|||||||
if (Platform.isLinux) {
|
if (Platform.isLinux) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(),
|
appBar: AppBar(),
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
body: Center(
|
body: Center(
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () => PageUtils.launchURL(_url),
|
onPressed: () => PageUtils.launchURL(_url),
|
||||||
|
|||||||
@@ -130,10 +130,7 @@ class _WhisperDetailPageState
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(left: padding.left, right: padding.right),
|
||||||
left: padding.left,
|
|
||||||
right: padding.right,
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -161,7 +158,7 @@ class _WhisperDetailPageState
|
|||||||
SizedBox(height: padding.bottom),
|
SizedBox(height: padding.bottom),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
).constraintWidth(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import 'package:PiliPlus/models/common/image_type.dart';
|
|||||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||||
import 'package:PiliPlus/utils/date_utils.dart';
|
import 'package:PiliPlus/utils/date_utils.dart';
|
||||||
import 'package:PiliPlus/utils/duration_utils.dart';
|
import 'package:PiliPlus/utils/duration_utils.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/id_utils.dart';
|
import 'package:PiliPlus/utils/id_utils.dart';
|
||||||
import 'package:PiliPlus/utils/image_utils.dart';
|
import 'package:PiliPlus/utils/image_utils.dart';
|
||||||
import 'package:PiliPlus/utils/page_utils.dart';
|
import 'package:PiliPlus/utils/page_utils.dart';
|
||||||
@@ -754,20 +755,15 @@ class ChatItem extends StatelessWidget {
|
|||||||
|
|
||||||
Widget msgTypePictureCard_13(dynamic content) {
|
Widget msgTypePictureCard_13(dynamic content) {
|
||||||
final url = content['jump_url'];
|
final url = content['jump_url'];
|
||||||
return Center(
|
return ClipRRect(
|
||||||
child: ConstrainedBox(
|
borderRadius: StyleString.mdRadius,
|
||||||
constraints: const BoxConstraints(maxWidth: 400.0),
|
child: GestureDetector(
|
||||||
child: ClipRRect(
|
onTap: url == null ? null : () => PiliScheme.routePushFromUrl(url),
|
||||||
borderRadius: StyleString.mdRadius,
|
child: CachedNetworkImage(
|
||||||
child: GestureDetector(
|
imageUrl: ImageUtils.thumbnailUrl(content['pic_url']),
|
||||||
onTap: url == null ? null : () => PiliScheme.routePushFromUrl(url),
|
|
||||||
child: CachedNetworkImage(
|
|
||||||
imageUrl: ImageUtils.thumbnailUrl(content['pic_url']),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
).constraintWidth(constraints: const BoxConstraints(maxWidth: 400.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget def(Color textColor, {err}) {
|
Widget def(Color textColor, {err}) {
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class _WhisperSecPageState extends State<WhisperSecPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
).constraintWidth(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -275,3 +275,17 @@ extension GetExt on GetInterface {
|
|||||||
S putOrFind<S>(InstanceBuilderCallback<S> dep, {String? tag}) =>
|
S putOrFind<S>(InstanceBuilderCallback<S> dep, {String? tag}) =>
|
||||||
GetInstance().putOrFind(dep, tag: tag);
|
GetInstance().putOrFind(dep, tag: tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension WidgetExt on Widget {
|
||||||
|
Widget constraintWidth({
|
||||||
|
BoxConstraints constraints = const BoxConstraints(maxWidth: 625),
|
||||||
|
}) {
|
||||||
|
return Align(
|
||||||
|
alignment: Alignment.topCenter,
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: constraints,
|
||||||
|
child: this,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user