mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: card width
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -114,7 +114,7 @@ class _BangumiPageState extends State<BangumiPage>
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: Grid.maxRowWidth / 2 / 0.75 +
|
||||
height: Grid.mediumCardWidth / 2 / 0.75 +
|
||||
MediaQuery.textScalerOf(context).scale(50),
|
||||
child: Obx(
|
||||
() => _buildFollowBody(
|
||||
@@ -163,7 +163,7 @@ class _BangumiPageState extends State<BangumiPage>
|
||||
// 列间距
|
||||
crossAxisSpacing: StyleString.cardSpace,
|
||||
// 最大宽度
|
||||
maxCrossAxisExtent: Grid.maxRowWidth / 3 * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth / 3 * 2,
|
||||
childAspectRatio: 0.75,
|
||||
mainAxisExtent: MediaQuery.textScalerOf(context).scale(50),
|
||||
),
|
||||
@@ -199,7 +199,7 @@ class _BangumiPageState extends State<BangumiPage>
|
||||
_bangumiController.queryBangumiFollow(false);
|
||||
}
|
||||
return Container(
|
||||
width: Grid.maxRowWidth / 2,
|
||||
width: Grid.mediumCardWidth / 2,
|
||||
margin: EdgeInsets.only(
|
||||
left: StyleString.safeSpace,
|
||||
right: index == loadingState.response.length - 1
|
||||
|
||||
@@ -314,7 +314,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
children: [
|
||||
Builder(
|
||||
builder: (context) {
|
||||
double padding = max(context.width / 2 - Grid.maxRowWidth, 0);
|
||||
double padding = max(context.width / 2 - Grid.mediumCardWidth, 0);
|
||||
if (orientation == Orientation.portrait) {
|
||||
return CustomScrollView(
|
||||
controller: _dynamicDetailController.scrollController,
|
||||
|
||||
@@ -111,7 +111,7 @@ class _DynamicsTabPageState extends State<DynamicsTabPage>
|
||||
slivers: [
|
||||
const SliverFillRemaining(),
|
||||
SliverConstrainedCrossAxis(
|
||||
maxExtent: Grid.maxRowWidth * 2,
|
||||
maxExtent: Grid.mediumCardWidth * 2,
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
@@ -129,7 +129,7 @@ class _DynamicsTabPageState extends State<DynamicsTabPage>
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
crossAxisSpacing: StyleString.cardSpace / 2,
|
||||
mainAxisSpacing: StyleString.cardSpace / 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio,
|
||||
mainAxisExtent: 50,
|
||||
),
|
||||
@@ -148,7 +148,7 @@ class _DynamicsTabPageState extends State<DynamicsTabPage>
|
||||
Success() => (loadingState.response as List?)?.isNotEmpty == true
|
||||
? dynamicsWaterfallFlow
|
||||
? SliverWaterfallFlow.extent(
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
//cacheExtent: 0.0,
|
||||
crossAxisSpacing: StyleString.cardSpace / 2,
|
||||
mainAxisSpacing: StyleString.cardSpace / 2,
|
||||
@@ -184,7 +184,7 @@ class _DynamicsTabPageState extends State<DynamicsTabPage>
|
||||
slivers: [
|
||||
const SliverFillRemaining(),
|
||||
SliverConstrainedCrossAxis(
|
||||
maxExtent: Grid.maxRowWidth * 2,
|
||||
maxExtent: Grid.mediumCardWidth * 2,
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
|
||||
@@ -54,7 +54,7 @@ class _FansPageState extends State<FansPage> {
|
||||
Success() => (loadingState.response as List?)?.isNotEmpty == true
|
||||
? SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
mainAxisExtent: 56,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -85,7 +85,7 @@ class _FavPageState extends State<FavPage> {
|
||||
Loading() => SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -102,7 +102,7 @@ class _FavPageState extends State<FavPage> {
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -293,7 +293,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
||||
Loading() => SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -311,7 +311,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -73,7 +73,7 @@ class _FavSearchPageState extends State<FavSearchPage> {
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -117,7 +117,7 @@ class _FavSearchPageState extends State<FavSearchPage> {
|
||||
SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -151,7 +151,7 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
Loading() => SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -165,7 +165,7 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
? SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -85,7 +85,7 @@ class _HotPageState extends State<HotPage> with AutomaticKeepAliveClientMixin {
|
||||
return SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -104,7 +104,7 @@ class _HotPageState extends State<HotPage> with AutomaticKeepAliveClientMixin {
|
||||
? SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -290,7 +290,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
||||
children: [
|
||||
OrientationBuilder(
|
||||
builder: (context, orientation) {
|
||||
double padding = max(context.width / 2 - Grid.maxRowWidth, 0);
|
||||
double padding = max(context.width / 2 - Grid.mediumCardWidth, 0);
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
@@ -128,7 +128,7 @@ class _LaterPageState extends State<LaterPage> {
|
||||
Loading() => SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -142,7 +142,7 @@ class _LaterPageState extends State<LaterPage> {
|
||||
? SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -124,7 +124,7 @@ class _LivePageState extends State<LivePage>
|
||||
// 列间距
|
||||
crossAxisSpacing: StyleString.cardSpace,
|
||||
// 最大宽度
|
||||
maxCrossAxisExtent: Grid.maxRowWidth,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth,
|
||||
childAspectRatio: StyleString.aspectRatio,
|
||||
mainAxisExtent: MediaQuery.textScalerOf(context).scale(90),
|
||||
),
|
||||
@@ -319,7 +319,7 @@ class _LivePageState extends State<LivePage>
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: StyleString.cardSpace,
|
||||
crossAxisSpacing: StyleString.cardSpace,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth,
|
||||
childAspectRatio: StyleString.aspectRatio,
|
||||
mainAxisExtent: MediaQuery.textScalerOf(context).scale(90),
|
||||
),
|
||||
|
||||
@@ -63,7 +63,7 @@ class _MemberBangumiState extends State<MemberBangumi>
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: StyleString.cardSpace,
|
||||
crossAxisSpacing: StyleString.cardSpace,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth / 3 * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth / 3 * 2,
|
||||
childAspectRatio: 0.75,
|
||||
mainAxisExtent:
|
||||
MediaQuery.textScalerOf(context).scale(30),
|
||||
|
||||
@@ -159,7 +159,7 @@ class _MemberVideoState extends State<MemberVideo>
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -61,7 +61,7 @@ class _MemberHomeState extends State<MemberHome>
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: StyleString.cardSpace,
|
||||
crossAxisSpacing: StyleString.cardSpace,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth,
|
||||
childAspectRatio: StyleString.aspectRatio,
|
||||
mainAxisExtent:
|
||||
MediaQuery.textScalerOf(context).scale(55),
|
||||
@@ -188,7 +188,7 @@ class _MemberHomeState extends State<MemberHome>
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: StyleString.cardSpace,
|
||||
crossAxisSpacing: StyleString.cardSpace,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth / 3 * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth / 3 * 2,
|
||||
childAspectRatio: 0.75,
|
||||
mainAxisExtent:
|
||||
MediaQuery.textScalerOf(context).scale(30),
|
||||
|
||||
@@ -65,7 +65,7 @@ class MemberSeasonsPanel extends StatelessWidget {
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: StyleString.cardSpace,
|
||||
crossAxisSpacing: StyleString.cardSpace,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth,
|
||||
childAspectRatio: 0.94,
|
||||
),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
|
||||
@@ -96,7 +96,7 @@ class _MemberArchivePageState extends State<MemberArchivePage> {
|
||||
SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: StyleString.safeSpace,
|
||||
crossAxisSpacing: StyleString.safeSpace,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio:
|
||||
StyleString.aspectRatio * 2.4,
|
||||
),
|
||||
|
||||
@@ -82,7 +82,7 @@ class _MemberDynamicsPageState extends State<MemberDynamicsPage>
|
||||
),
|
||||
sliver: dynamicsWaterfallFlow
|
||||
? SliverWaterfallFlow.extent(
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
//cacheExtent: 0.0,
|
||||
crossAxisSpacing: StyleString.safeSpace,
|
||||
mainAxisSpacing: StyleString.safeSpace,
|
||||
@@ -117,7 +117,7 @@ class _MemberDynamicsPageState extends State<MemberDynamicsPage>
|
||||
slivers: [
|
||||
const SliverFillRemaining(),
|
||||
SliverConstrainedCrossAxis(
|
||||
maxExtent: Grid.maxRowWidth * 2,
|
||||
maxExtent: Grid.mediumCardWidth * 2,
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
|
||||
@@ -41,7 +41,7 @@ class SearchArchive extends StatelessWidget {
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -50,7 +50,7 @@ class SearchDynamic extends StatelessWidget {
|
||||
),
|
||||
sliver: dynamicsWaterfallFlow
|
||||
? SliverWaterfallFlow.extent(
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
crossAxisSpacing: StyleString.safeSpace,
|
||||
mainAxisSpacing: StyleString.safeSpace,
|
||||
lastChildLayoutTypeBuilder: (index) {
|
||||
@@ -72,7 +72,7 @@ class SearchDynamic extends StatelessWidget {
|
||||
slivers: [
|
||||
const SliverFillRemaining(),
|
||||
SliverConstrainedCrossAxis(
|
||||
maxExtent: Grid.maxRowWidth * 2,
|
||||
maxExtent: Grid.mediumCardWidth * 2,
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
|
||||
@@ -82,7 +82,7 @@ class _MemberSeasonsPageState extends State<MemberSeasonsPage> {
|
||||
SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: StyleString.cardSpace,
|
||||
crossAxisSpacing: StyleString.cardSpace,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth,
|
||||
childAspectRatio: 0.94,
|
||||
),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
|
||||
@@ -101,7 +101,7 @@ class _ZonePageState extends State<ZonePage>
|
||||
return SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -117,7 +117,7 @@ class _ZonePageState extends State<ZonePage>
|
||||
return SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -106,7 +106,7 @@ class _RcmdPageState extends State<RcmdPage>
|
||||
// 列间距
|
||||
crossAxisSpacing: StyleString.cardSpace,
|
||||
// 最大宽度
|
||||
maxCrossAxisExtent: Grid.maxRowWidth,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth,
|
||||
childAspectRatio: StyleString.aspectRatio,
|
||||
mainAxisExtent: MediaQuery.textScalerOf(context).scale(90),
|
||||
),
|
||||
|
||||
@@ -69,7 +69,7 @@ class _SearchPanelState extends State<SearchPanel>
|
||||
SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio *
|
||||
(widget.searchType == SearchType.media_bangumi ||
|
||||
widget.searchType == SearchType.media_ft
|
||||
|
||||
@@ -86,7 +86,7 @@ Widget searchArticlePanel(context, searchPanelCtr, LoadingState loadingState) {
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -21,7 +21,7 @@ Widget searchLivePanel(BuildContext context, ctr, LoadingState loadingState) {
|
||||
primary: false,
|
||||
controller: ctr!.scrollController,
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
maxCrossAxisExtent: Grid.maxRowWidth,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth,
|
||||
crossAxisSpacing: StyleString.safeSpace,
|
||||
mainAxisSpacing: StyleString.safeSpace,
|
||||
childAspectRatio: StyleString.aspectRatio,
|
||||
|
||||
@@ -24,7 +24,7 @@ Widget searchBangumiPanel(context, ctr, LoadingState loadingState) {
|
||||
),
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
mainAxisExtent: 160,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -82,7 +82,7 @@ Widget searchUserPanel(context, searchPanelCtr, LoadingState loadingState) {
|
||||
),
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||
mainAxisExtent: 56,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -92,7 +92,7 @@ Widget searchVideoPanel(context, ctr, LoadingState loadingState) {
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -154,8 +154,8 @@ List<SettingsModel> get styleSettings => [
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return SlideDialog<double>(
|
||||
title: '最大列宽度(默认280dp)',
|
||||
value: GStorage.maxRowWidth,
|
||||
title: '小卡最大列宽度(默认240dp)',
|
||||
value: GStorage.smallCardWidth,
|
||||
min: 150.0,
|
||||
max: 500.0,
|
||||
divisions: 35,
|
||||
@@ -163,15 +163,41 @@ List<SettingsModel> get styleSettings => [
|
||||
);
|
||||
});
|
||||
if (result != null) {
|
||||
await GStorage.setting.put(SettingBoxKey.maxRowWidth, result);
|
||||
await GStorage.setting.put(SettingBoxKey.smallCardWidth, result);
|
||||
SmartDialog.showToast('重启生效');
|
||||
setState();
|
||||
}
|
||||
},
|
||||
leading: const Icon(Icons.calendar_view_week_outlined),
|
||||
title: '列表宽度(dp)限制',
|
||||
title: '小卡列表宽度(dp)限制',
|
||||
getSubtitle: () =>
|
||||
'当前:${GStorage.maxRowWidth.toInt()}dp,屏幕宽度:${MediaQuery.of(Get.context!).size.width.toPrecision(2)}dp。宽度越小列数越多,横条、大卡会2倍折算',
|
||||
'当前:${GStorage.mediumCardWidth.toInt()}dp,屏幕宽度:${MediaQuery.of(Get.context!).size.width.toPrecision(2)}dp。宽度越小列数越多。',
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.normal,
|
||||
onTap: (setState) async {
|
||||
double? result = await showDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return SlideDialog<double>(
|
||||
title: '中卡最大列宽度(默认280dp)',
|
||||
value: GStorage.mediumCardWidth,
|
||||
min: 150.0,
|
||||
max: 500.0,
|
||||
divisions: 35,
|
||||
suffix: 'dp',
|
||||
);
|
||||
});
|
||||
if (result != null) {
|
||||
await GStorage.setting.put(SettingBoxKey.mediumCardWidth, result);
|
||||
SmartDialog.showToast('重启生效');
|
||||
setState();
|
||||
}
|
||||
},
|
||||
leading: const Icon(Icons.calendar_view_week_outlined),
|
||||
title: '中卡列表宽度(dp)限制',
|
||||
getSubtitle: () =>
|
||||
'当前:${GStorage.mediumCardWidth.toInt()}dp,屏幕宽度:${MediaQuery.of(Get.context!).size.width.toPrecision(2)}dp。宽度越小列数越多。',
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
|
||||
@@ -40,7 +40,7 @@ class _SubPageState extends State<SubPage> {
|
||||
Loading() => SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -52,7 +52,7 @@ class _SubPageState extends State<SubPage> {
|
||||
? SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -237,7 +237,7 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio:
|
||||
StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
@@ -267,7 +267,7 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
||||
return SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -167,7 +167,7 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
|
||||
@@ -37,7 +37,7 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
|
||||
Loading() => SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -51,7 +51,7 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
|
||||
? SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate((context, index) {
|
||||
|
||||
@@ -4,7 +4,8 @@ import 'package:flutter/rendering.dart';
|
||||
import 'storage.dart';
|
||||
|
||||
class Grid {
|
||||
static double maxRowWidth = GStorage.maxRowWidth;
|
||||
static double mediumCardWidth = GStorage.mediumCardWidth;
|
||||
static double smallCardWidth = GStorage.smallCardWidth;
|
||||
//
|
||||
// static double calculateActualWidth(BuildContext context, double maxCrossAxisExtent, double crossAxisSpacing, {double? screenWidthOffset}) {
|
||||
// double screenWidth = MediaQuery.of(context).size.width;
|
||||
|
||||
@@ -117,8 +117,11 @@ class GStorage {
|
||||
static int get previewQ =>
|
||||
setting.get(SettingBoxKey.previewQuality, defaultValue: 80);
|
||||
|
||||
static double get maxRowWidth =>
|
||||
setting.get(SettingBoxKey.maxRowWidth, defaultValue: 280.0);
|
||||
static double get mediumCardWidth =>
|
||||
setting.get(SettingBoxKey.mediumCardWidth, defaultValue: 280.0);
|
||||
|
||||
static double get smallCardWidth =>
|
||||
setting.get(SettingBoxKey.smallCardWidth, defaultValue: 240.0);
|
||||
|
||||
static UpPanelPosition get upPanelPosition =>
|
||||
UpPanelPosition.values[setting.get(SettingBoxKey.upPanelPosition,
|
||||
@@ -589,7 +592,8 @@ class SettingBoxKey {
|
||||
customColor = 'customColor', // 自定义主题色
|
||||
enableSingleRow = 'enableSingleRow', // 首页单列
|
||||
displayMode = 'displayMode',
|
||||
maxRowWidth = 'maxRowWidth', // 首页列最大宽度(dp)
|
||||
mediumCardWidth = 'mediumCardWidth', // 首页列最大宽度(dp)
|
||||
smallCardWidth = 'smallCardWidth',
|
||||
videoPlayerRemoveSafeArea = 'videoPlayerRemoveSafeArea', // 视频播放器移除安全边距
|
||||
// videoPlayerShowStatusBarBackgroundColor =
|
||||
// 'videoPlayerShowStatusBarBackgroundColor', // 播放页状态栏显示为背景色
|
||||
|
||||
Reference in New Issue
Block a user