mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-16 23:26:14 +08:00
opt: article list page
opt: fav/sub detail Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import 'package:PiliPlus/common/constants.dart';
|
import 'package:PiliPlus/common/constants.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
@@ -10,7 +11,7 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
this.src,
|
this.src,
|
||||||
required this.width,
|
required this.width,
|
||||||
this.height,
|
this.height,
|
||||||
this.type,
|
this.type = ImageType.def,
|
||||||
this.fadeOutDuration,
|
this.fadeOutDuration,
|
||||||
this.fadeInDuration,
|
this.fadeInDuration,
|
||||||
// 图片质量 默认1%
|
// 图片质量 默认1%
|
||||||
@@ -27,7 +28,7 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
final String? src;
|
final String? src;
|
||||||
final double width;
|
final double width;
|
||||||
final double? height;
|
final double? height;
|
||||||
final String? type;
|
final ImageType type;
|
||||||
final Duration? fadeOutDuration;
|
final Duration? fadeOutDuration;
|
||||||
final Duration? fadeInDuration;
|
final Duration? fadeInDuration;
|
||||||
final int? quality;
|
final int? quality;
|
||||||
@@ -42,9 +43,9 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return src.isNullOrEmpty.not
|
return src.isNullOrEmpty.not
|
||||||
? type == 'avatar'
|
? type == ImageType.avatar
|
||||||
? ClipOval(child: _buildImage(context))
|
? ClipOval(child: _buildImage(context))
|
||||||
: radius == 0 || type == 'emote'
|
: radius == 0 || type == ImageType.emote
|
||||||
? _buildImage(context)
|
? _buildImage(context)
|
||||||
: ClipRRect(
|
: ClipRRect(
|
||||||
borderRadius: radius != null
|
borderRadius: radius != null
|
||||||
@@ -86,9 +87,10 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
height: height,
|
height: height,
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: type == 'avatar' ? BoxShape.circle : BoxShape.rectangle,
|
shape: type == ImageType.avatar ? BoxShape.circle : BoxShape.rectangle,
|
||||||
color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4),
|
color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4),
|
||||||
borderRadius: type == 'avatar' || type == 'emote' || radius == 0
|
borderRadius:
|
||||||
|
type == ImageType.avatar || type == ImageType.emote || radius == 0
|
||||||
? null
|
? null
|
||||||
: radius != null
|
: radius != null
|
||||||
? BorderRadius.circular(radius!)
|
? BorderRadius.circular(radius!)
|
||||||
@@ -98,7 +100,7 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
? const SizedBox.shrink()
|
? const SizedBox.shrink()
|
||||||
: Center(
|
: Center(
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
type == 'avatar'
|
type == ImageType.avatar
|
||||||
? 'assets/images/noface.jpeg'
|
? 'assets/images/noface.jpeg'
|
||||||
: 'assets/images/loading.png',
|
: 'assets/images/loading.png',
|
||||||
width: width,
|
width: width,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/models/common/avatar_badge_type.dart';
|
import 'package:PiliPlus/models/common/avatar_badge_type.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
@@ -120,7 +121,7 @@ class PendantAvatar extends StatelessWidget {
|
|||||||
src: avatar,
|
src: avatar,
|
||||||
width: size,
|
width: size,
|
||||||
height: size,
|
height: size,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -128,7 +129,7 @@ class PendantAvatar extends StatelessWidget {
|
|||||||
src: avatar,
|
src: avatar,
|
||||||
width: size,
|
width: size,
|
||||||
height: size,
|
height: size,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildBadge(ColorScheme colorScheme) {
|
Widget _buildBadge(ColorScheme colorScheme) {
|
||||||
|
|||||||
1
lib/models/common/image_type.dart
Normal file
1
lib/models/common/image_type.dart
Normal file
@@ -0,0 +1 @@
|
|||||||
|
enum ImageType { avatar, emote, def }
|
||||||
@@ -10,6 +10,7 @@ import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
|||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models/common/badge_type.dart';
|
import 'package:PiliPlus/models/common/badge_type.dart';
|
||||||
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
|
import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
|
||||||
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
import 'package:PiliPlus/models/common/reply/reply_type.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/result.dart' show DynamicStat;
|
import 'package:PiliPlus/models/dynamics/result.dart' show DynamicStat;
|
||||||
@@ -486,7 +487,7 @@ class _ArticlePageState extends State<ArticlePage>
|
|||||||
// TODO Avatar
|
// TODO Avatar
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: _articleCtr.summary.author?.face,
|
src: _articleCtr.summary.author?.face,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ class ArticleListController
|
|||||||
queryData();
|
queryData();
|
||||||
}
|
}
|
||||||
|
|
||||||
ArticleList? list;
|
Rx<ArticleList?> list = Rx<ArticleList?>(null);
|
||||||
Author? author;
|
Author? author;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Article>? getDataList(ArticleListData response) {
|
List<Article>? getDataList(ArticleListData response) {
|
||||||
list = response.list;
|
list.value = response.list;
|
||||||
author = response.author;
|
author = response.author;
|
||||||
return response.articles;
|
return response.articles;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/article_list/article.dart';
|
import 'package:PiliPlus/models/dynamics/article_list/article.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/article_list/list.dart';
|
import 'package:PiliPlus/models/dynamics/article_list/list.dart';
|
||||||
import 'package:PiliPlus/pages/article_list/controller.dart';
|
import 'package:PiliPlus/pages/article_list/controller.dart';
|
||||||
@@ -35,6 +36,7 @@ class _ArticleListPageState extends State<ArticleListPage> {
|
|||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
|
Obx(() => _buildHeader(theme, _controller.list.value)),
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
bottom: MediaQuery.paddingOf(context).bottom + 80),
|
bottom: MediaQuery.paddingOf(context).bottom + 80),
|
||||||
@@ -64,12 +66,8 @@ class _ArticleListPageState extends State<ArticleListPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Success() => SliverMainAxisGroup(
|
Success() => loadingState.response?.isNotEmpty == true
|
||||||
slivers: [
|
? SliverGrid(
|
||||||
if (_controller.list != null)
|
|
||||||
_buildHeader(theme, _controller.list!),
|
|
||||||
if (loadingState.response?.isNotEmpty == true)
|
|
||||||
SliverGrid(
|
|
||||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||||
mainAxisSpacing: 2,
|
mainAxisSpacing: 2,
|
||||||
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
maxCrossAxisExtent: Grid.smallCardWidth * 2,
|
||||||
@@ -85,10 +83,7 @@ class _ArticleListPageState extends State<ArticleListPage> {
|
|||||||
childCount: loadingState.response!.length,
|
childCount: loadingState.response!.length,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
else
|
: HttpError(onReload: _controller.onReload),
|
||||||
HttpError(onReload: _controller.onReload),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Error() => HttpError(
|
Error() => HttpError(
|
||||||
errMsg: loadingState.errMsg,
|
errMsg: loadingState.errMsg,
|
||||||
onReload: _controller.onReload,
|
onReload: _controller.onReload,
|
||||||
@@ -96,7 +91,10 @@ class _ArticleListPageState extends State<ArticleListPage> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildHeader(ThemeData theme, ArticleList item) {
|
Widget _buildHeader(ThemeData theme, ArticleList? item) {
|
||||||
|
if (item == null) {
|
||||||
|
return const SliverToBoxAdapter();
|
||||||
|
}
|
||||||
late final style = TextStyle(color: theme.colorScheme.onSurfaceVariant);
|
late final style = TextStyle(color: theme.colorScheme.onSurfaceVariant);
|
||||||
late final divider = TextSpan(
|
late final divider = TextSpan(
|
||||||
text: ' | ',
|
text: ' | ',
|
||||||
@@ -105,6 +103,7 @@ class _ArticleListPageState extends State<ArticleListPage> {
|
|||||||
final padding = MediaQuery.paddingOf(context).top + kToolbarHeight;
|
final padding = MediaQuery.paddingOf(context).top + kToolbarHeight;
|
||||||
return SliverAppBar.medium(
|
return SliverAppBar.medium(
|
||||||
title: Text(item.name!),
|
title: Text(item.name!),
|
||||||
|
pinned: true,
|
||||||
expandedHeight: kToolbarHeight + 130,
|
expandedHeight: kToolbarHeight + 130,
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
background: Container(
|
background: Container(
|
||||||
@@ -117,7 +116,7 @@ class _ArticleListPageState extends State<ArticleListPage> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
if (item.imageUrl?.isNotEmpty == true)
|
if (item.imageUrl?.isNotEmpty == true) ...[
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
width: 91,
|
width: 91,
|
||||||
height: 120,
|
height: 120,
|
||||||
@@ -125,6 +124,7 @@ class _ArticleListPageState extends State<ArticleListPage> {
|
|||||||
radius: 6,
|
radius: 6,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
|
],
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -149,6 +149,7 @@ class _ArticleListPageState extends State<ArticleListPage> {
|
|||||||
width: 30,
|
width: 30,
|
||||||
height: 30,
|
height: 30,
|
||||||
src: _controller.author!.face,
|
src: _controller.author!.face,
|
||||||
|
type: ImageType.avatar,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(_controller.author!.name!),
|
Text(_controller.author!.name!),
|
||||||
@@ -162,9 +163,9 @@ class _ArticleListPageState extends State<ArticleListPage> {
|
|||||||
children: [
|
children: [
|
||||||
TextSpan(text: '${item.articlesCount}篇专栏'),
|
TextSpan(text: '${item.articlesCount}篇专栏'),
|
||||||
divider,
|
divider,
|
||||||
TextSpan(text: '${item.words}个字'),
|
TextSpan(text: '${Utils.numFormat(item.words)}个字'),
|
||||||
divider,
|
divider,
|
||||||
TextSpan(text: '${item.read}次阅读'),
|
TextSpan(text: '${Utils.numFormat(item.read)}次阅读'),
|
||||||
],
|
],
|
||||||
style: style,
|
style: style,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/user/black.dart';
|
import 'package:PiliPlus/models/user/black.dart';
|
||||||
import 'package:PiliPlus/pages/blacklist/controller.dart';
|
import 'package:PiliPlus/pages/blacklist/controller.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
@@ -75,7 +76,7 @@ class _BlackListPageState extends State<BlackListPage> {
|
|||||||
leading: NetworkImgLayer(
|
leading: NetworkImgLayer(
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: item.face,
|
src: item.face,
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:PiliPlus/common/widgets/badge.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/image/image_save.dart';
|
import 'package:PiliPlus/common/widgets/image/image_save.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/image_view.dart';
|
import 'package:PiliPlus/common/widgets/image/image_view.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||||
import 'package:PiliPlus/pages/article/widgets/opus_content.dart';
|
import 'package:PiliPlus/pages/article/widgets/opus_content.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics/widgets/additional_panel.dart';
|
import 'package:PiliPlus/pages/dynamics/widgets/additional_panel.dart';
|
||||||
@@ -332,7 +333,6 @@ Widget forWard(
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
type: 'cover',
|
|
||||||
radius: 8,
|
radius: 8,
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
@@ -382,7 +382,6 @@ Widget forWard(
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
type: 'cover',
|
|
||||||
radius: 8,
|
radius: 8,
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
@@ -432,7 +431,7 @@ Widget forWard(
|
|||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
width: 28,
|
width: 28,
|
||||||
height: 28,
|
height: 28,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: item.modules.moduleAuthor!.face,
|
src: item.modules.moduleAuthor!.face,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:PiliPlus/common/widgets/image/image_view.dart';
|
import 'package:PiliPlus/common/widgets/image/image_view.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/http/search.dart';
|
import 'package:PiliPlus/http/search.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics/widgets/vote.dart';
|
import 'package:PiliPlus/pages/dynamics/widgets/vote.dart';
|
||||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||||
@@ -136,7 +137,7 @@ TextSpan? richNode(
|
|||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src: i.emoji!.webpUrl ?? i.emoji!.gifUrl ?? i.emoji!.iconUrl,
|
src: i.emoji!.webpUrl ?? i.emoji!.gifUrl ?? i.emoji!.iconUrl,
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
width: (i.emoji!.size ?? 1) * 20,
|
width: (i.emoji!.size ?? 1) * 20,
|
||||||
height: (i.emoji!.size ?? 1) * 20,
|
height: (i.emoji!.size ?? 1) * 20,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/up.dart';
|
import 'package:PiliPlus/models/dynamics/up.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics/controller.dart';
|
import 'package:PiliPlus/pages/dynamics/controller.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
@@ -150,7 +151,7 @@ class _UpPanelState extends State<UpPanel> {
|
|||||||
width: 38,
|
width: 38,
|
||||||
height: 38,
|
height: 38,
|
||||||
src: data.face,
|
src: data.face,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
)
|
)
|
||||||
: const CircleAvatar(
|
: const CircleAvatar(
|
||||||
backgroundColor: Color(0xFF5CB67B),
|
backgroundColor: Color(0xFF5CB67B),
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
||||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/video/reply/emote.dart';
|
import 'package:PiliPlus/models/video/reply/emote.dart';
|
||||||
import 'package:PiliPlus/pages/emote/controller.dart';
|
import 'package:PiliPlus/pages/emote/controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -78,7 +79,7 @@ class _EmotePanelState extends State<EmotePanel>
|
|||||||
width: size * 38,
|
width: size * 38,
|
||||||
height: size * 38,
|
height: size * 38,
|
||||||
semanticsLabel: e.emote![index].text!,
|
semanticsLabel: e.emote![index].text!,
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
boxFit: BoxFit.contain,
|
boxFit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -107,7 +108,7 @@ class _EmotePanelState extends State<EmotePanel>
|
|||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
src: e.url,
|
src: e.url,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/fans/result.dart';
|
import 'package:PiliPlus/models/fans/result.dart';
|
||||||
import 'package:PiliPlus/pages/fan/controller.dart';
|
import 'package:PiliPlus/pages/fan/controller.dart';
|
||||||
import 'package:PiliPlus/pages/share/view.dart' show UserModel;
|
import 'package:PiliPlus/pages/share/view.dart' show UserModel;
|
||||||
@@ -132,7 +133,7 @@ class _FansPageState extends State<FansPage> {
|
|||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: item.face,
|
src: item.face,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ class FavDetailController
|
|||||||
late int mediaId;
|
late int mediaId;
|
||||||
late String heroTag;
|
late String heroTag;
|
||||||
RxBool isOwner = false.obs;
|
RxBool isOwner = false.obs;
|
||||||
RxBool titleCtr = false.obs;
|
|
||||||
|
|
||||||
dynamic mid;
|
dynamic mid;
|
||||||
|
|
||||||
|
|||||||
@@ -36,18 +36,6 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
mediaId = Get.parameters['mediaId']!;
|
mediaId = Get.parameters['mediaId']!;
|
||||||
_favDetailController.scrollController.addListener(listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
void listener() {
|
|
||||||
_favDetailController.titleCtr.value =
|
|
||||||
_favDetailController.scrollController.offset >= 130;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_favDetailController.scrollController.removeListener(listener);
|
|
||||||
super.dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -81,7 +69,20 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
controller: _favDetailController.scrollController,
|
controller: _favDetailController.scrollController,
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverAppBar(
|
_buildHeader(theme),
|
||||||
|
Obx(() => _buildBody(
|
||||||
|
theme, _favDetailController.loadingState.value)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildHeader(ThemeData theme) {
|
||||||
|
return SliverAppBar.medium(
|
||||||
leading: _favDetailController.enableMultiSelect.value
|
leading: _favDetailController.enableMultiSelect.value
|
||||||
? IconButton(
|
? IconButton(
|
||||||
tooltip: '取消',
|
tooltip: '取消',
|
||||||
@@ -92,16 +93,8 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
expandedHeight: kToolbarHeight + 130,
|
expandedHeight: kToolbarHeight + 130,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
title: _favDetailController.enableMultiSelect.value
|
title: _favDetailController.enableMultiSelect.value
|
||||||
? Text(
|
? Text('已选: ${_favDetailController.checkedCount.value}')
|
||||||
'已选: ${_favDetailController.checkedCount.value}',
|
: Column(
|
||||||
)
|
|
||||||
: Obx(
|
|
||||||
() => AnimatedOpacity(
|
|
||||||
opacity:
|
|
||||||
_favDetailController.titleCtr.value ? 1 : 0,
|
|
||||||
curve: Curves.easeOut,
|
|
||||||
duration: const Duration(milliseconds: 500),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@@ -114,16 +107,13 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
actions: _favDetailController.enableMultiSelect.value
|
actions: _favDetailController.enableMultiSelect.value
|
||||||
? [
|
? [
|
||||||
TextButton(
|
TextButton(
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
onPressed: () =>
|
onPressed: () => _favDetailController.handleSelect(true),
|
||||||
_favDetailController.handleSelect(true),
|
|
||||||
child: const Text('全选'),
|
child: const Text('全选'),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
@@ -131,8 +121,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
RequestUtils.onCopyOrMove<FavDetailData,
|
RequestUtils.onCopyOrMove<FavDetailData, FavDetailItemData>(
|
||||||
FavDetailItemData>(
|
|
||||||
context: context,
|
context: context,
|
||||||
isCopy: true,
|
isCopy: true,
|
||||||
ctr: _favDetailController,
|
ctr: _favDetailController,
|
||||||
@@ -152,8 +141,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
RequestUtils.onCopyOrMove<FavDetailData,
|
RequestUtils.onCopyOrMove<FavDetailData, FavDetailItemData>(
|
||||||
FavDetailItemData>(
|
|
||||||
context: context,
|
context: context,
|
||||||
isCopy: false,
|
isCopy: false,
|
||||||
ctr: _favDetailController,
|
ctr: _favDetailController,
|
||||||
@@ -172,12 +160,10 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
),
|
),
|
||||||
onPressed: () =>
|
onPressed: () => _favDetailController.onDelChecked(context),
|
||||||
_favDetailController.onDelChecked(context),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
'删除',
|
'删除',
|
||||||
style:
|
style: TextStyle(color: theme.colorScheme.error),
|
||||||
TextStyle(color: theme.colorScheme.error),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
@@ -190,10 +176,8 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
arguments: {
|
arguments: {
|
||||||
'type': 0,
|
'type': 0,
|
||||||
'mediaId': int.parse(mediaId),
|
'mediaId': int.parse(mediaId),
|
||||||
'title':
|
'title': _favDetailController.item.value.title,
|
||||||
_favDetailController.item.value.title,
|
'count': _favDetailController.item.value.mediaCount,
|
||||||
'count': _favDetailController
|
|
||||||
.item.value.mediaCount,
|
|
||||||
'isOwner': _favDetailController.isOwner.value,
|
'isOwner': _favDetailController.isOwner.value,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -211,8 +195,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
parameters: {'mediaId': mediaId},
|
parameters: {'mediaId': mediaId},
|
||||||
)?.then((res) {
|
)?.then((res) {
|
||||||
if (res is FavFolderItemData) {
|
if (res is FavFolderItemData) {
|
||||||
_favDetailController
|
_favDetailController.item.value = res;
|
||||||
.item.value = res;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -220,19 +203,15 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
),
|
),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
UserHttp.cleanFav(mediaId: mediaId)
|
UserHttp.cleanFav(mediaId: mediaId).then((data) {
|
||||||
.then((data) {
|
|
||||||
if (data['status']) {
|
if (data['status']) {
|
||||||
SmartDialog.showToast('清除成功');
|
SmartDialog.showToast('清除成功');
|
||||||
Future.delayed(
|
Future.delayed(
|
||||||
const Duration(
|
const Duration(milliseconds: 200), () {
|
||||||
milliseconds: 200), () {
|
_favDetailController.onReload();
|
||||||
_favDetailController
|
|
||||||
.onReload();
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
SmartDialog.showToast(
|
SmartDialog.showToast(data['msg']);
|
||||||
data['msg']);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -240,22 +219,18 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
),
|
),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (_favDetailController
|
if (_favDetailController.loadingState.value
|
||||||
.loadingState
|
is Success &&
|
||||||
.value is Success &&
|
((_favDetailController.loadingState.value
|
||||||
((_favDetailController
|
|
||||||
.loadingState
|
|
||||||
.value
|
|
||||||
as Success)
|
as Success)
|
||||||
.response as List?)
|
.response as List?)
|
||||||
?.isNotEmpty ==
|
?.isNotEmpty ==
|
||||||
true) {
|
true) {
|
||||||
if ((_favDetailController.item
|
if ((_favDetailController
|
||||||
.value.mediaCount ??
|
.item.value.mediaCount ??
|
||||||
0) >
|
0) >
|
||||||
1000) {
|
1000) {
|
||||||
SmartDialog.showToast(
|
SmartDialog.showToast('内容太多啦!超过1000不支持排序');
|
||||||
'内容太多啦!超过1000不支持排序');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Get.to(
|
Get.to(
|
||||||
@@ -268,25 +243,20 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
child: const Text('排序'),
|
child: const Text('排序'),
|
||||||
),
|
),
|
||||||
if (!Utils.isDefaultFav(
|
if (!Utils.isDefaultFav(
|
||||||
_favDetailController
|
_favDetailController.item.value.attr ?? 0))
|
||||||
.item.value.attr ??
|
|
||||||
0))
|
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showConfirmDialog(
|
showConfirmDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: '确定删除该收藏夹?',
|
title: '确定删除该收藏夹?',
|
||||||
onConfirm: () {
|
onConfirm: () {
|
||||||
UserHttp.deleteFolder(
|
UserHttp.deleteFolder(mediaIds: [mediaId])
|
||||||
mediaIds: [mediaId])
|
|
||||||
.then((data) {
|
.then((data) {
|
||||||
if (data['status']) {
|
if (data['status']) {
|
||||||
SmartDialog.showToast(
|
SmartDialog.showToast('删除成功');
|
||||||
'删除成功');
|
|
||||||
Get.back(result: true);
|
Get.back(result: true);
|
||||||
} else {
|
} else {
|
||||||
SmartDialog.showToast(
|
SmartDialog.showToast(data['msg']);
|
||||||
data['msg']);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -308,9 +278,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
background: Padding(
|
background: Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: kToolbarHeight +
|
top: kToolbarHeight + MediaQuery.of(context).padding.top + 10,
|
||||||
MediaQuery.of(context).padding.top +
|
|
||||||
10,
|
|
||||||
left: 14,
|
left: 14,
|
||||||
right: 20,
|
right: 20,
|
||||||
bottom: 10,
|
bottom: 10,
|
||||||
@@ -335,55 +303,41 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
height: 110,
|
height: 110,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
MainAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
_favDetailController
|
_favDetailController.item.value.title ?? '',
|
||||||
.item.value.title ??
|
|
||||||
'',
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: theme.textTheme
|
fontSize: theme.textTheme.titleMedium!.fontSize,
|
||||||
.titleMedium!.fontSize,
|
|
||||||
fontWeight: FontWeight.bold),
|
fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
if (_favDetailController
|
if (_favDetailController
|
||||||
.item.value.intro?.isNotEmpty ==
|
.item.value.intro?.isNotEmpty ==
|
||||||
true)
|
true)
|
||||||
Text(
|
Text(
|
||||||
_favDetailController
|
_favDetailController.item.value.intro ?? '',
|
||||||
.item.value.intro ??
|
|
||||||
'',
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: theme.textTheme
|
fontSize:
|
||||||
.labelSmall!.fontSize,
|
theme.textTheme.labelSmall!.fontSize,
|
||||||
color:
|
color: theme.colorScheme.outline),
|
||||||
theme.colorScheme.outline),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
_favDetailController
|
_favDetailController.item.value.upper?.name ?? '',
|
||||||
.item.value.upper?.name ??
|
|
||||||
'',
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: theme.textTheme
|
fontSize: theme.textTheme.labelSmall!.fontSize,
|
||||||
.labelSmall!.fontSize,
|
|
||||||
color: theme.colorScheme.outline),
|
color: theme.colorScheme.outline),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
if (_favDetailController
|
if (_favDetailController.item.value.attr != null)
|
||||||
.item.value.attr !=
|
|
||||||
null)
|
|
||||||
Text(
|
Text(
|
||||||
'共${_favDetailController.item.value.mediaCount}条视频 · ${Utils.isPublicFavText(_favDetailController.item.value.attr ?? 0)}',
|
'共${_favDetailController.item.value.mediaCount}条视频 · ${Utils.isPublicFavText(_favDetailController.item.value.attr ?? 0)}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: theme.textTheme
|
fontSize:
|
||||||
.labelSmall!.fontSize,
|
theme.textTheme.labelSmall!.fontSize,
|
||||||
color:
|
color: theme.colorScheme.outline),
|
||||||
theme.colorScheme.outline),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -395,15 +349,6 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Obx(() => _buildBody(
|
|
||||||
theme, _favDetailController.loadingState.value)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/follow/result.dart';
|
import 'package:PiliPlus/models/follow/result.dart';
|
||||||
import 'package:PiliPlus/pages/share/view.dart' show UserModel;
|
import 'package:PiliPlus/pages/share/view.dart' show UserModel;
|
||||||
import 'package:PiliPlus/utils/feed_back.dart';
|
import 'package:PiliPlus/utils/feed_back.dart';
|
||||||
@@ -49,7 +50,7 @@ class FollowItem extends StatelessWidget {
|
|||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: item.face,
|
src: item.face,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:PiliPlus/common/constants.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||||
import 'package:PiliPlus/models/common/dynamic/dynamic_badge_mode.dart';
|
import 'package:PiliPlus/models/common/dynamic/dynamic_badge_mode.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/pages/home/controller.dart';
|
import 'package:PiliPlus/pages/home/controller.dart';
|
||||||
import 'package:PiliPlus/pages/main/controller.dart';
|
import 'package:PiliPlus/pages/main/controller.dart';
|
||||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||||
@@ -98,7 +99,7 @@ class _HomePageState extends State<HomePage>
|
|||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
width: 34,
|
width: 34,
|
||||||
height: 34,
|
height: 34,
|
||||||
src: _homeController.userFace.value,
|
src: _homeController.userFace.value,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:PiliPlus/common/widgets/pair.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||||
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/live/live_feed_index/card_data_list_item.dart';
|
import 'package:PiliPlus/models/live/live_feed_index/card_data_list_item.dart';
|
||||||
import 'package:PiliPlus/models/live/live_feed_index/card_list.dart';
|
import 'package:PiliPlus/models/live/live_feed_index/card_list.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_page.dart';
|
import 'package:PiliPlus/pages/common/common_page.dart';
|
||||||
@@ -311,7 +312,7 @@ class _LivePageState extends CommonPageState<LivePage, LiveController>
|
|||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
src: item.face,
|
src: item.face,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:PiliPlus/common/widgets/keep_alive_wrapper.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
||||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/live/live_area_list/area_item.dart';
|
import 'package:PiliPlus/models/live/live_area_list/area_item.dart';
|
||||||
import 'package:PiliPlus/models/live/live_area_list/area_list.dart';
|
import 'package:PiliPlus/models/live/live_area_list/area_list.dart';
|
||||||
import 'package:PiliPlus/pages/live_area/controller.dart';
|
import 'package:PiliPlus/pages/live_area/controller.dart';
|
||||||
@@ -258,7 +259,7 @@ class _LiveAreaPageState extends State<LiveAreaPage> {
|
|||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
src: item.pic,
|
src: item.pic,
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/live/live_area_list/area_item.dart';
|
import 'package:PiliPlus/models/live/live_area_list/area_item.dart';
|
||||||
import 'package:PiliPlus/pages/live_area_detail/child/view.dart';
|
import 'package:PiliPlus/pages/live_area_detail/child/view.dart';
|
||||||
import 'package:PiliPlus/pages/live_area_detail/controller.dart';
|
import 'package:PiliPlus/pages/live_area_detail/controller.dart';
|
||||||
@@ -131,7 +132,7 @@ class _LiveAreaDetailPageState extends State<LiveAreaDetailPage> {
|
|||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
src: item.pic,
|
src: item.pic,
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
||||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/live/live_emoticons/datum.dart';
|
import 'package:PiliPlus/models/live/live_emoticons/datum.dart';
|
||||||
import 'package:PiliPlus/models/live/live_emoticons/emoticon.dart';
|
import 'package:PiliPlus/models/live/live_emoticons/emoticon.dart';
|
||||||
import 'package:PiliPlus/pages/live_emote/controller.dart';
|
import 'package:PiliPlus/pages/live_emote/controller.dart';
|
||||||
@@ -93,7 +94,7 @@ class _LiveEmotePanelState extends State<LiveEmotePanel>
|
|||||||
src: item.emoticons![index].url!,
|
src: item.emoticons![index].url!,
|
||||||
width: widthFac * 38,
|
width: widthFac * 38,
|
||||||
height: heightFac * 38,
|
height: heightFac * 38,
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
quality: item.pkgType == 3 ? null : 80,
|
quality: item.pkgType == 3 ? null : 80,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -122,7 +123,7 @@ class _LiveEmotePanelState extends State<LiveEmotePanel>
|
|||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
src: item.currentCover,
|
src: item.currentCover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'dart:io';
|
|||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/live/live_room/room_info_h5.dart';
|
import 'package:PiliPlus/models/live/live_room/room_info_h5.dart';
|
||||||
import 'package:PiliPlus/pages/live_room/controller.dart';
|
import 'package:PiliPlus/pages/live_room/controller.dart';
|
||||||
import 'package:PiliPlus/pages/live_room/send_danmaku/view.dart';
|
import 'package:PiliPlus/pages/live_room/send_danmaku/view.dart';
|
||||||
@@ -386,7 +387,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
|||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: 34,
|
width: 34,
|
||||||
height: 34,
|
height: 34,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: _liveRoomController
|
src: _liveRoomController
|
||||||
.roomInfoH5.value!.anchorInfo!.baseInfo!.face,
|
.roomInfoH5.value!.anchorInfo!.baseInfo!.face,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/pages/live_room/controller.dart';
|
import 'package:PiliPlus/pages/live_room/controller.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
@@ -126,7 +127,7 @@ class LiveRoomChat extends StatelessWidget {
|
|||||||
child: ExcludeSemantics(
|
child: ExcludeSemantics(
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src: emote['url'],
|
src: emote['url'],
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
width: emote['width'].toDouble(),
|
width: emote['width'].toDouble(),
|
||||||
height: emote['height'].toDouble(),
|
height: emote['height'].toDouble(),
|
||||||
semanticsLabel: key,
|
semanticsLabel: key,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/live/live_search/user_item.dart';
|
import 'package:PiliPlus/models/live/live_search/user_item.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -30,7 +31,7 @@ class LiveSearchUserItem extends StatelessWidget {
|
|||||||
src: item.face,
|
src: item.face,
|
||||||
width: 42,
|
width: 42,
|
||||||
height: 42,
|
height: 42,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Column(
|
Column(
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'dart:io';
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/common/widgets/tabs.dart';
|
import 'package:PiliPlus/common/widgets/tabs.dart';
|
||||||
import 'package:PiliPlus/models/common/dynamic/dynamic_badge_mode.dart';
|
import 'package:PiliPlus/models/common/dynamic/dynamic_badge_mode.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics/controller.dart';
|
import 'package:PiliPlus/pages/dynamics/controller.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics/view.dart';
|
import 'package:PiliPlus/pages/dynamics/view.dart';
|
||||||
import 'package:PiliPlus/pages/home/controller.dart';
|
import 'package:PiliPlus/pages/home/controller.dart';
|
||||||
@@ -435,7 +436,7 @@ class _MainAppState extends State<MainApp>
|
|||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
width: 34,
|
width: 34,
|
||||||
height: 34,
|
height: 34,
|
||||||
src: _homeController.userFace.value,
|
src: _homeController.userFace.value,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/space_opus/item.dart';
|
import 'package:PiliPlus/models/space_opus/item.dart';
|
||||||
import 'package:PiliPlus/utils/page_utils.dart';
|
import 'package:PiliPlus/utils/page_utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -38,7 +39,7 @@ class SpaceOpusItem extends StatelessWidget {
|
|||||||
width: constraints.maxWidth,
|
width: constraints.maxWidth,
|
||||||
height: constraints.maxWidth * item.cover!.ratio,
|
height: constraints.maxWidth * item.cover!.ratio,
|
||||||
src: item.cover!.url,
|
src: item.cover!.url,
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
quality: 60,
|
quality: 60,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
|||||||
import 'package:PiliPlus/grpc/bilibili/app/im/v1.pbenum.dart'
|
import 'package:PiliPlus/grpc/bilibili/app/im/v1.pbenum.dart'
|
||||||
show IMSettingType;
|
show IMSettingType;
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/msg/msgfeed_at_me.dart';
|
import 'package:PiliPlus/models/msg/msgfeed_at_me.dart';
|
||||||
import 'package:PiliPlus/pages/msg_feed_top/at_me/controller.dart';
|
import 'package:PiliPlus/pages/msg_feed_top/at_me/controller.dart';
|
||||||
import 'package:PiliPlus/pages/whisper_settings/view.dart';
|
import 'package:PiliPlus/pages/whisper_settings/view.dart';
|
||||||
@@ -100,7 +101,7 @@ class _AtMePageState extends State<AtMePage> {
|
|||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: item.user?.avatar,
|
src: item.user?.avatar,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -147,7 +148,6 @@ class _AtMePageState extends State<AtMePage> {
|
|||||||
? NetworkImgLayer(
|
? NetworkImgLayer(
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
type: 'cover',
|
|
||||||
src: item.item?.image,
|
src: item.item?.image,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
|||||||
import 'package:PiliPlus/grpc/bilibili/app/im/v1.pbenum.dart'
|
import 'package:PiliPlus/grpc/bilibili/app/im/v1.pbenum.dart'
|
||||||
show IMSettingType;
|
show IMSettingType;
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/msg/msgfeed_like_me.dart';
|
import 'package:PiliPlus/models/msg/msgfeed_like_me.dart';
|
||||||
import 'package:PiliPlus/pages/msg_feed_top/like_me/controller.dart';
|
import 'package:PiliPlus/pages/msg_feed_top/like_me/controller.dart';
|
||||||
import 'package:PiliPlus/pages/whisper_settings/view.dart';
|
import 'package:PiliPlus/pages/whisper_settings/view.dart';
|
||||||
@@ -255,7 +256,7 @@ class _LikeMePageState extends State<LikeMePage> {
|
|||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: item.users!.length > 1 ? 30 : 45,
|
width: item.users!.length > 1 ? 30 : 45,
|
||||||
height: item.users!.length > 1 ? 30 : 45,
|
height: item.users!.length > 1 ? 30 : 45,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: item.users![j].avatar,
|
src: item.users![j].avatar,
|
||||||
)),
|
)),
|
||||||
]
|
]
|
||||||
@@ -319,7 +320,6 @@ class _LikeMePageState extends State<LikeMePage> {
|
|||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
type: 'cover',
|
|
||||||
src: item.item!.image,
|
src: item.item!.image,
|
||||||
),
|
),
|
||||||
if (item.noticeState == 1)
|
if (item.noticeState == 1)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
|||||||
import 'package:PiliPlus/grpc/bilibili/app/im/v1.pbenum.dart'
|
import 'package:PiliPlus/grpc/bilibili/app/im/v1.pbenum.dart'
|
||||||
show IMSettingType;
|
show IMSettingType;
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/msg/msgfeed_reply_me.dart';
|
import 'package:PiliPlus/models/msg/msgfeed_reply_me.dart';
|
||||||
import 'package:PiliPlus/pages/msg_feed_top/reply_me/controller.dart';
|
import 'package:PiliPlus/pages/msg_feed_top/reply_me/controller.dart';
|
||||||
import 'package:PiliPlus/pages/whisper_settings/view.dart';
|
import 'package:PiliPlus/pages/whisper_settings/view.dart';
|
||||||
@@ -105,7 +106,7 @@ class _ReplyMePageState extends State<ReplyMePage> {
|
|||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 45,
|
height: 45,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: item.user?.avatar,
|
src: item.user?.avatar,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:PiliPlus/common/constants.dart';
|
import 'package:PiliPlus/common/constants.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/image_save.dart';
|
import 'package:PiliPlus/common/widgets/image/image_save.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/search/result.dart';
|
import 'package:PiliPlus/models/search/result.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -37,7 +38,7 @@ class LiveItem extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
src: liveItem.cover,
|
src: liveItem.cover,
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
width: maxWidth,
|
width: maxWidth,
|
||||||
height: maxHeight,
|
height: maxHeight,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/pages/contact/view.dart';
|
import 'package:PiliPlus/pages/contact/view.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/request_utils.dart';
|
import 'package:PiliPlus/utils/request_utils.dart';
|
||||||
@@ -130,7 +131,7 @@ class _SharePanelState extends State<SharePanel> {
|
|||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
src: _userList[index].avatar,
|
src: _userList[index].avatar,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:PiliPlus/common/skeleton/video_card_h.dart';
|
import 'package:PiliPlus/common/skeleton/video_card_h.dart';
|
||||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||||
|
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models/user/sub_detail.dart';
|
import 'package:PiliPlus/models/user/sub_detail.dart';
|
||||||
import 'package:PiliPlus/models/user/sub_folder.dart';
|
import 'package:PiliPlus/models/user/sub_folder.dart';
|
||||||
@@ -23,23 +24,6 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
|||||||
SubDetailController(),
|
SubDetailController(),
|
||||||
tag: Utils.makeHeroTag(Get.parameters['id']),
|
tag: Utils.makeHeroTag(Get.parameters['id']),
|
||||||
);
|
);
|
||||||
final RxBool showTitle = false.obs;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_subDetailController.scrollController.addListener(listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
void listener() {
|
|
||||||
showTitle.value = _subDetailController.scrollController.offset > 132;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_subDetailController.scrollController.removeListener(listener);
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -48,6 +32,8 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
|||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
bottom: false,
|
bottom: false,
|
||||||
|
child: refreshIndicator(
|
||||||
|
onRefresh: _subDetailController.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
controller: _subDetailController.scrollController,
|
controller: _subDetailController.scrollController,
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
@@ -58,6 +44,7 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +92,7 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
|||||||
padding: const EdgeInsets.only(top: 12, bottom: 8, left: 14),
|
padding: const EdgeInsets.only(top: 12, bottom: 8, left: 14),
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() => Text(
|
() => Text(
|
||||||
'共${_subDetailController.mediaCount}条视频',
|
'共${_subDetailController.mediaCount.value}条视频',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: theme.textTheme.labelMedium!.fontSize,
|
fontSize: theme.textTheme.labelMedium!.fontSize,
|
||||||
color: theme.colorScheme.outline,
|
color: theme.colorScheme.outline,
|
||||||
@@ -116,16 +103,10 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildAppBar(ThemeData theme) => SliverAppBar(
|
Widget _buildAppBar(ThemeData theme) => SliverAppBar.medium(
|
||||||
expandedHeight: kToolbarHeight + 132,
|
expandedHeight: kToolbarHeight + 132,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
title: Obx(
|
title: Column(
|
||||||
() {
|
|
||||||
return AnimatedOpacity(
|
|
||||||
opacity: showTitle.value ? 1 : 0,
|
|
||||||
curve: Curves.easeOut,
|
|
||||||
duration: const Duration(milliseconds: 500),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@@ -134,14 +115,13 @@ class _SubDetailPageState extends State<SubDetailPage> {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: theme.textTheme.titleMedium,
|
style: theme.textTheme.titleMedium,
|
||||||
),
|
),
|
||||||
Text(
|
Obx(
|
||||||
|
() => Text(
|
||||||
'共${_subDetailController.mediaCount.value}条视频',
|
'共${_subDetailController.mediaCount.value}条视频',
|
||||||
style: theme.textTheme.labelMedium,
|
style: theme.textTheme.labelMedium,
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
],
|
||||||
),
|
),
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
background: Container(
|
background: Container(
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||||
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
||||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||||
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
||||||
@@ -389,7 +390,7 @@ class _VideoInfoState extends State<VideoInfo> {
|
|||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: videoItem['staff'][index].face,
|
src: videoItem['staff'][index].face,
|
||||||
width: 35,
|
width: 35,
|
||||||
height: 35,
|
height: 35,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/video_card/video_card_h_member_video.dart';
|
import 'package:PiliPlus/common/widgets/video_card/video_card_h_member_video.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/member/info.dart';
|
import 'package:PiliPlus/models/member/info.dart';
|
||||||
import 'package:PiliPlus/models/space_archive/item.dart';
|
import 'package:PiliPlus/models/space_archive/item.dart';
|
||||||
import 'package:PiliPlus/pages/video/controller.dart';
|
import 'package:PiliPlus/pages/video/controller.dart';
|
||||||
@@ -417,7 +418,7 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
|
|||||||
},
|
},
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src: face,
|
src: face,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
width: 70,
|
width: 70,
|
||||||
height: 70,
|
height: 70,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_slide_page.dart';
|
import 'package:PiliPlus/pages/common/common_slide_page.dart';
|
||||||
import 'package:PiliPlus/pages/video/note/controller.dart';
|
import 'package:PiliPlus/pages/video/note/controller.dart';
|
||||||
import 'package:PiliPlus/pages/webview/view.dart';
|
import 'package:PiliPlus/pages/webview/view.dart';
|
||||||
@@ -212,7 +213,7 @@ Widget _itemWidget(BuildContext context, ThemeData theme, dynamic item) {
|
|||||||
height: 34,
|
height: 34,
|
||||||
width: 34,
|
width: 34,
|
||||||
src: item['author']['face'],
|
src: item['author']['face'],
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
|||||||
import 'package:PiliPlus/http/init.dart';
|
import 'package:PiliPlus/http/init.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/models/common/badge_type.dart';
|
import 'package:PiliPlus/models/common/badge_type.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics/widgets/vote.dart';
|
import 'package:PiliPlus/pages/dynamics/widgets/vote.dart';
|
||||||
import 'package:PiliPlus/pages/save_panel/view.dart';
|
import 'package:PiliPlus/pages/save_panel/view.dart';
|
||||||
import 'package:PiliPlus/pages/video/controller.dart';
|
import 'package:PiliPlus/pages/video/controller.dart';
|
||||||
@@ -656,7 +657,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
src: content.emotes[matchStr]?.hasGifUrl() == true
|
src: content.emotes[matchStr]?.hasGifUrl() == true
|
||||||
? content.emotes[matchStr]?.gifUrl
|
? content.emotes[matchStr]?.gifUrl
|
||||||
: content.emotes[matchStr]?.url,
|
: content.emotes[matchStr]?.url,
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
width: size * 20,
|
width: size * 20,
|
||||||
height: size * 20,
|
height: size * 20,
|
||||||
semanticsLabel: matchStr,
|
semanticsLabel: matchStr,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
|||||||
import 'package:PiliPlus/grpc/bilibili/im/type.pb.dart' show Msg;
|
import 'package:PiliPlus/grpc/bilibili/im/type.pb.dart' show Msg;
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/http/msg.dart';
|
import 'package:PiliPlus/http/msg.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/models/common/publish_panel_type.dart';
|
import 'package:PiliPlus/models/common/publish_panel_type.dart';
|
||||||
import 'package:PiliPlus/pages/common/common_publish_page.dart';
|
import 'package:PiliPlus/pages/common/common_publish_page.dart';
|
||||||
import 'package:PiliPlus/pages/emote/view.dart';
|
import 'package:PiliPlus/pages/emote/view.dart';
|
||||||
@@ -79,7 +80,7 @@ class _WhisperDetailPageState
|
|||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
width: 34,
|
width: 34,
|
||||||
height: 34,
|
height: 34,
|
||||||
type: 'avatar',
|
type: ImageType.avatar,
|
||||||
src: _whisperDetailController.face,
|
src: _whisperDetailController.face,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:PiliPlus/grpc/bilibili/im/interfaces/v1.pb.dart'
|
|||||||
import 'package:PiliPlus/grpc/bilibili/im/type.pb.dart' show Msg, MsgType;
|
import 'package:PiliPlus/grpc/bilibili/im/type.pb.dart' show Msg, MsgType;
|
||||||
import 'package:PiliPlus/http/search.dart';
|
import 'package:PiliPlus/http/search.dart';
|
||||||
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
||||||
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/utils/extension.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/page_utils.dart';
|
import 'package:PiliPlus/utils/page_utils.dart';
|
||||||
@@ -598,7 +599,7 @@ class ChatItem extends StatelessWidget {
|
|||||||
width: emojiMap[emojiKey]!['size'],
|
width: emojiMap[emojiKey]!['size'],
|
||||||
height: emojiMap[emojiKey]!['size'],
|
height: emojiMap[emojiKey]!['size'],
|
||||||
src: emojiMap[emojiKey]!['url'],
|
src: emojiMap[emojiKey]!['url'],
|
||||||
type: 'emote',
|
type: ImageType.emote,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user