mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: image view
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -31,8 +31,7 @@ class VideoCardHSkeleton extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
Theme.of(context).colorScheme.onInverseSurface,
|
||||
borderRadius:
|
||||
BorderRadius.circular(StyleString.imgRadius.x),
|
||||
borderRadius: StyleString.mdRadius,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -16,9 +16,9 @@ class VideoCardVSkeleton extends StatelessWidget {
|
||||
builder: (context, boxConstraints) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.onInverseSurface,
|
||||
borderRadius:
|
||||
BorderRadius.circular(StyleString.imgRadius.x)),
|
||||
color: Theme.of(context).colorScheme.onInverseSurface,
|
||||
borderRadius: StyleString.mdRadius,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/nine_grid_view.dart';
|
||||
@@ -49,7 +50,7 @@ Widget imageview(
|
||||
}
|
||||
BorderRadius borderRadius(index) {
|
||||
if (picArr.length == 1) {
|
||||
return BorderRadius.circular(12);
|
||||
return StyleString.mdRadius;
|
||||
}
|
||||
final int row = picArr.length == 4 ? 2 : 3;
|
||||
return BorderRadius.only(
|
||||
@@ -57,27 +58,27 @@ Widget imageview(
|
||||
(index - row >= 0 ||
|
||||
((index - 1) >= 0 && (index - 1) % row < index % row))
|
||||
? 0
|
||||
: 12,
|
||||
: 10,
|
||||
),
|
||||
topRight: Radius.circular(
|
||||
(index - row >= 0 ||
|
||||
((index + 1) < picArr.length &&
|
||||
(index + 1) % row > index % row))
|
||||
? 0
|
||||
: 12,
|
||||
: 10,
|
||||
),
|
||||
bottomLeft: Radius.circular(
|
||||
(index + row < picArr.length ||
|
||||
((index - 1) >= 0 && (index - 1) % row < index % row))
|
||||
? 0
|
||||
: 12,
|
||||
: 10,
|
||||
),
|
||||
bottomRight: Radius.circular(
|
||||
(index + row < picArr.length ||
|
||||
((index + 1) < picArr.length &&
|
||||
(index + 1) % row > index % row))
|
||||
? 0
|
||||
: 12,
|
||||
: 10,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -41,20 +41,17 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double radius = this.radius != null
|
||||
? this.radius!
|
||||
: type == 'avatar'
|
||||
? 50
|
||||
: type == 'emote'
|
||||
? 0
|
||||
: StyleString.imgRadius.x;
|
||||
return src.isNullOrEmpty.not
|
||||
? radius != 0
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
child: _buildImage(context),
|
||||
)
|
||||
: _buildImage(context)
|
||||
? type == 'avatar'
|
||||
? ClipOval(child: _buildImage(context))
|
||||
: radius == 0 || type == 'emote'
|
||||
? _buildImage(context)
|
||||
: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
radius ?? StyleString.imgRadius.x,
|
||||
),
|
||||
child: _buildImage(context),
|
||||
)
|
||||
: getPlaceHolder?.call() ?? placeholder(context);
|
||||
}
|
||||
|
||||
@@ -99,15 +96,15 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
return Container(
|
||||
width: width,
|
||||
height: height,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
shape: type == 'avatar' ? BoxShape.circle : BoxShape.rectangle,
|
||||
color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4),
|
||||
borderRadius: BorderRadius.circular(
|
||||
type == 'avatar'
|
||||
? 50
|
||||
: type == 'emote'
|
||||
? 0
|
||||
: StyleString.imgRadius.x,
|
||||
),
|
||||
borderRadius: type == 'avatar' || type == 'emote' || radius == 0
|
||||
? null
|
||||
: BorderRadius.circular(
|
||||
radius ?? StyleString.imgRadius.x,
|
||||
),
|
||||
),
|
||||
child: type == 'bg'
|
||||
? const SizedBox()
|
||||
|
||||
@@ -72,7 +72,7 @@ class BangumiCardV extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.all(StyleString.imgRadius),
|
||||
borderRadius: StyleString.mdRadius,
|
||||
child: AspectRatio(
|
||||
aspectRatio: 0.75,
|
||||
child: LayoutBuilder(builder: (context, boxConstraints) {
|
||||
|
||||
@@ -110,16 +110,16 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
|
||||
padding: const EdgeInsets.fromLTRB(10, 0, 8, 8),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: <Color>[
|
||||
Colors.transparent,
|
||||
Colors.black54,
|
||||
],
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(StyleString.imgRadius.x)),
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: <Color>[
|
||||
Colors.transparent,
|
||||
Colors.black54,
|
||||
],
|
||||
),
|
||||
borderRadius: StyleString.mdRadius,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
|
||||
@@ -70,8 +70,8 @@ class _LivePageState extends State<LivePage>
|
||||
clipBehavior: Clip.hardEdge,
|
||||
margin: const EdgeInsets.only(
|
||||
left: StyleString.safeSpace, right: StyleString.safeSpace),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(StyleString.imgRadius),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: StyleString.mdRadius,
|
||||
),
|
||||
child: refreshIndicator(
|
||||
onRefresh: () async {
|
||||
|
||||
@@ -33,7 +33,7 @@ class LiveCardV extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.all(StyleString.imgRadius),
|
||||
borderRadius: StyleString.mdRadius,
|
||||
child: AspectRatio(
|
||||
aspectRatio: StyleString.aspectRatio,
|
||||
child: LayoutBuilder(builder: (context, boxConstraints) {
|
||||
|
||||
@@ -33,7 +33,7 @@ class LiveCardVFollow extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.all(StyleString.imgRadius),
|
||||
borderRadius: StyleString.mdRadius,
|
||||
child: AspectRatio(
|
||||
aspectRatio: StyleString.aspectRatio,
|
||||
child: LayoutBuilder(builder: (context, boxConstraints) {
|
||||
|
||||
@@ -64,8 +64,8 @@ class _RcmdPageState extends State<RcmdPage>
|
||||
clipBehavior: Clip.hardEdge,
|
||||
margin: const EdgeInsets.only(
|
||||
left: StyleString.safeSpace, right: StyleString.safeSpace),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(StyleString.imgRadius),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: StyleString.mdRadius,
|
||||
),
|
||||
child: refreshIndicator(
|
||||
onRefresh: () async {
|
||||
|
||||
Reference in New Issue
Block a user