opt article page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-23 15:30:07 +08:00
parent 9c2f3d3f86
commit 70b55e5fdd
2 changed files with 93 additions and 86 deletions

View File

@@ -249,102 +249,109 @@ class _ArticlePageState extends State<ArticlePage>
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: _buildAppBar, appBar: _buildAppBar,
body: Stack( body: SafeArea(
clipBehavior: Clip.none, top: false,
children: [ bottom: false,
SafeArea( child: Stack(
top: false, clipBehavior: Clip.none,
bottom: false, children: [
child: Builder( SafeArea(
builder: (context) { top: false,
final isPortrait = context.orientation == Orientation.portrait; bottom: false,
double padding = child: Builder(
max(context.width / 2 - Grid.smallCardWidth, 0); builder: (context) {
if (isPortrait) { final isPortrait =
return LayoutBuilder(builder: (context, constraints) { context.orientation == Orientation.portrait;
final maxWidth = constraints.maxWidth - 2 * padding - 24; double padding =
return Padding( max(context.width / 2 - Grid.smallCardWidth, 0);
padding: EdgeInsets.symmetric(horizontal: padding), if (isPortrait) {
child: CustomScrollView( return LayoutBuilder(builder: (context, constraints) {
controller: _articleCtr.scrollController, final maxWidth = constraints.maxWidth - 2 * padding - 24;
physics: const AlwaysScrollableScrollPhysics(), return Padding(
slivers: [ padding: EdgeInsets.symmetric(horizontal: padding),
_buildContent(theme, maxWidth), child: CustomScrollView(
SliverToBoxAdapter( controller: _articleCtr.scrollController,
child: Divider( physics: const AlwaysScrollableScrollPhysics(),
thickness: 8, slivers: [
color: theme.dividerColor.withValues(alpha: 0.05), _buildContent(theme, maxWidth),
SliverToBoxAdapter(
child: Divider(
thickness: 8,
color:
theme.dividerColor.withValues(alpha: 0.05),
),
), ),
), _buildReplyHeader(theme),
_buildReplyHeader(theme), Obx(() => _buildReplyList(
Obx(() => _buildReplyList( theme, _articleCtr.loadingState.value)),
theme, _articleCtr.loadingState.value)), ],
],
),
);
});
} else {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: _ratio[0].toInt(),
child: LayoutBuilder(
builder: (context, constraints) {
final maxWidth =
constraints.maxWidth - padding / 4 - 24;
return CustomScrollView(
controller: _articleCtr.scrollController,
physics: const AlwaysScrollableScrollPhysics(),
slivers: [
SliverPadding(
padding: EdgeInsets.only(
left: padding / 4,
bottom:
MediaQuery.paddingOf(context).bottom +
80,
),
sliver: _buildContent(theme, maxWidth),
),
],
);
},
), ),
), );
VerticalDivider( });
thickness: 8, } else {
color: theme.dividerColor.withValues(alpha: 0.05), return Row(
), crossAxisAlignment: CrossAxisAlignment.start,
Expanded( children: [
flex: _ratio[1].toInt(), Expanded(
child: Scaffold( flex: _ratio[0].toInt(),
key: _key, child: LayoutBuilder(
backgroundColor: Colors.transparent, builder: (context, constraints) {
body: refreshIndicator( final maxWidth =
onRefresh: _articleCtr.onRefresh, constraints.maxWidth - padding / 4 - 24;
child: Padding( return CustomScrollView(
padding: EdgeInsets.only(right: padding / 4),
child: CustomScrollView(
controller: _articleCtr.scrollController, controller: _articleCtr.scrollController,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
slivers: [ slivers: [
_buildReplyHeader(theme), SliverPadding(
Obx(() => _buildReplyList( padding: EdgeInsets.only(
theme, _articleCtr.loadingState.value)), left: padding / 4,
bottom:
MediaQuery.paddingOf(context).bottom +
80,
),
sliver: _buildContent(theme, maxWidth),
),
], ],
);
},
),
),
VerticalDivider(
thickness: 8,
color: theme.dividerColor.withValues(alpha: 0.05),
),
Expanded(
flex: _ratio[1].toInt(),
child: Scaffold(
key: _key,
backgroundColor: Colors.transparent,
body: refreshIndicator(
onRefresh: _articleCtr.onRefresh,
child: Padding(
padding: EdgeInsets.only(right: padding / 4),
child: CustomScrollView(
controller: _articleCtr.scrollController,
physics:
const AlwaysScrollableScrollPhysics(),
slivers: [
_buildReplyHeader(theme),
Obx(() => _buildReplyList(
theme, _articleCtr.loadingState.value)),
],
),
), ),
), ),
), ),
), ),
), ],
], );
); }
} },
}, ),
), ),
), _buildBottom(theme),
_buildBottom(theme), ],
], ),
), ),
); );
} }

View File

@@ -42,7 +42,7 @@ class _WebviewPageState extends State<WebviewPage> {
super.initState(); super.initState();
if (Get.arguments is Map) { if (Get.arguments is Map) {
_inApp = Get.arguments['inApp']; _inApp = Get.arguments['inApp'];
_off = Get.arguments['off']; _off = Get.arguments['off'] ?? false;
} }
} }