mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: color scheme
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -69,34 +69,27 @@ class UserInfoCard extends StatelessWidget {
|
||||
? images.imgUrl?.http2https
|
||||
: images.nightImgurl?.http2https)
|
||||
: images.imgUrl?.http2https;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
context.imageView(
|
||||
imgList: [imgUrl ?? ''],
|
||||
);
|
||||
// showDialog(
|
||||
// useSafeArea: false,
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return ImagePreview(
|
||||
// initialPage: 0,
|
||||
// imgList: [imgUrl ?? ''],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
},
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: imgUrl ?? '',
|
||||
width: double.infinity,
|
||||
height: 135,
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider,
|
||||
fit: BoxFit.cover,
|
||||
colorFilter: ColorFilter.mode(
|
||||
darken ? const Color(0x8D000000) : const Color(0x5DFFFFFF),
|
||||
darken ? BlendMode.darken : BlendMode.lighten,
|
||||
return Hero(
|
||||
tag: imgUrl ?? 'bgTag',
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
context.imageView(
|
||||
imgList: [imgUrl ?? 'bgTag'],
|
||||
);
|
||||
},
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: imgUrl ?? '',
|
||||
width: double.infinity,
|
||||
height: 135,
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider,
|
||||
fit: BoxFit.cover,
|
||||
colorFilter: ColorFilter.mode(
|
||||
darken ? const Color(0x8D000000) : const Color(0x5DFFFFFF),
|
||||
darken ? BlendMode.darken : BlendMode.lighten,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -134,13 +127,13 @@ class UserInfoCard extends StatelessWidget {
|
||||
semanticLabel: '等级${card.levelInfo?.currentLevel}',
|
||||
),
|
||||
if (card.vip?.vipStatus == 1)
|
||||
Image.network(
|
||||
card.vip!.label!.image!,
|
||||
CachedNetworkImage(
|
||||
imageUrl: card.vip!.label!.image!,
|
||||
height: 20,
|
||||
),
|
||||
if (card.nameplate?.image?.isNotEmpty == true)
|
||||
Image.network(
|
||||
card.nameplate!.image!,
|
||||
CachedNetworkImage(
|
||||
imageUrl: card.nameplate!.image!,
|
||||
height: 20,
|
||||
),
|
||||
// GestureDetector(
|
||||
@@ -416,35 +409,28 @@ class UserInfoCard extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
|
||||
_buildAvatar(BuildContext context) => GestureDetector(
|
||||
onTap: () {
|
||||
context.imageView(
|
||||
imgList: [card.face ?? ''],
|
||||
);
|
||||
// showDialog(
|
||||
// useSafeArea: false,
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return ImagePreview(
|
||||
// initialPage: 0,
|
||||
// imgList: [card.face ?? ''],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 2.5,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
_buildAvatar(BuildContext context) => Hero(
|
||||
tag: card.face ?? 'avatarTag',
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
context.imageView(
|
||||
imgList: [card.face ?? 'avatarTag'],
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 2.5,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: NetworkImgLayer(
|
||||
src: card.face,
|
||||
type: 'avatar',
|
||||
width: 80,
|
||||
height: 80,
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: NetworkImgLayer(
|
||||
src: card.face,
|
||||
type: 'avatar',
|
||||
width: 80,
|
||||
height: 80,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:PiliPalaX/http/member.dart';
|
||||
import 'package:PiliPalaX/utils/extension.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -432,22 +433,22 @@ class _MemberPageState extends State<MemberPage>
|
||||
if (_memberController
|
||||
.memberInfo.value.vip?.label?['img_label_uri_hans'] !=
|
||||
'')
|
||||
Image.network(
|
||||
_memberController
|
||||
CachedNetworkImage(
|
||||
imageUrl: _memberController
|
||||
.memberInfo.value.vip!.label!['img_label_uri_hans'],
|
||||
height: 20,
|
||||
semanticLabel:
|
||||
_memberController.memberInfo.value.vip!.label!['text'],
|
||||
// semanticLabel:
|
||||
// _memberController.memberInfo.value.vip!.label!['text'],
|
||||
)
|
||||
else if (_memberController.memberInfo.value.vip
|
||||
?.label?['img_label_uri_hans_static'] !=
|
||||
'')
|
||||
Image.network(
|
||||
_memberController.memberInfo.value.vip!
|
||||
CachedNetworkImage(
|
||||
imageUrl: _memberController.memberInfo.value.vip!
|
||||
.label!['img_label_uri_hans_static'],
|
||||
height: 20,
|
||||
semanticLabel:
|
||||
_memberController.memberInfo.value.vip!.label!['text'],
|
||||
// semanticLabel:
|
||||
// _memberController.memberInfo.value.vip!.label!['text'],
|
||||
),
|
||||
],
|
||||
const SizedBox(width: 5),
|
||||
|
||||
@@ -23,7 +23,7 @@ class ProfilePanel extends StatelessWidget {
|
||||
return Row(
|
||||
children: [
|
||||
Hero(
|
||||
tag: ctr.heroTag!,
|
||||
tag: !loadingStatus ? memberInfo.face : ctr.face.value,
|
||||
child: Stack(
|
||||
children: [
|
||||
GestureDetector(
|
||||
@@ -32,15 +32,6 @@ class ProfilePanel extends StatelessWidget {
|
||||
!loadingStatus ? memberInfo.face : ctr.face.value
|
||||
],
|
||||
),
|
||||
// showDialog(
|
||||
// useSafeArea: false,
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return ImagePreview(initialPage: 0, imgList: [
|
||||
// !loadingStatus ? memberInfo.face : ctr.face.value
|
||||
// ]);
|
||||
// },
|
||||
// ),
|
||||
child: NetworkImgLayer(
|
||||
width: 90,
|
||||
height: 90,
|
||||
|
||||
@@ -22,8 +22,7 @@ class SearchText extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: bgColor ??
|
||||
Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
|
||||
color: bgColor ?? Theme.of(context).colorScheme.onInverseSurface,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.zero,
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
||||
class SearchResultController extends GetxController {
|
||||
String? keyword;
|
||||
|
||||
RxList<int> count = List.filled(5, -1).toList().obs;
|
||||
RxList<int> count = List.generate(5, (_) => -1).toList().obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
||||
@@ -1,34 +1,35 @@
|
||||
import 'package:flex_seed_scheme/flex_seed_scheme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:PiliPalaX/models/common/color_type.dart';
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
|
||||
extension _SchemeExt on DynamicSchemeVariant {
|
||||
String get title => [
|
||||
'色调点', //tonalSpot
|
||||
'富达', //fidelity
|
||||
'单色', //monochrome
|
||||
'中性的', //neutral
|
||||
'充满活力', //vibrant
|
||||
'富有表现力', //expressive
|
||||
'内容', //content
|
||||
'彩虹', //rainbow
|
||||
'水果沙拉', //fruitSalad
|
||||
][index];
|
||||
// from ImageToolbox
|
||||
String get subTitle => [
|
||||
'默认调色板样式,它允许自定义所有四种颜色,其他允许您仅设置关键颜色', //tonalSpot
|
||||
'与内容方案非常相似的方案', //fidelity
|
||||
'单色主题,颜色纯黑/白/灰', //monochrome
|
||||
'色彩比单色稍多的风格', //neutral
|
||||
'响亮的主题,主要调色板的色彩度最大,其他调色板的色彩度增加', //vibrant
|
||||
'有趣的主题 - 源颜色的色调不会出现在主题中', //expressive
|
||||
'将源颜色放置在Scheme.primaryContainer中的方案', //content
|
||||
'有趣的主题 - 源颜色的色调不会出现在主题中', //rainbow
|
||||
'有趣的主题 - 源颜色的色调不会出现在主题中', //fruitSalad
|
||||
][index];
|
||||
}
|
||||
// extension _SchemeExt on DynamicSchemeVariant {
|
||||
// String get title => [
|
||||
// '色调点', //tonalSpot
|
||||
// '富达', //fidelity
|
||||
// '单色', //monochrome
|
||||
// '中性的', //neutral
|
||||
// '充满活力', //vibrant
|
||||
// '富有表现力', //expressive
|
||||
// '内容', //content
|
||||
// '彩虹', //rainbow
|
||||
// '水果沙拉', //fruitSalad
|
||||
// ][index];
|
||||
// // from ImageToolbox
|
||||
// String get subTitle => [
|
||||
// '默认调色板样式,它允许自定义所有四种颜色,其他允许您仅设置关键颜色', //tonalSpot
|
||||
// '与内容方案非常相似的方案', //fidelity
|
||||
// '单色主题,颜色纯黑/白/灰', //monochrome
|
||||
// '色彩比单色稍多的风格', //neutral
|
||||
// '响亮的主题,主要调色板的色彩度最大,其他调色板的色彩度增加', //vibrant
|
||||
// '有趣的主题 - 源颜色的色调不会出现在主题中', //expressive
|
||||
// '将源颜色放置在Scheme.primaryContainer中的方案', //content
|
||||
// '有趣的主题 - 源颜色的色调不会出现在主题中', //rainbow
|
||||
// '有趣的主题 - 源颜色的色调不会出现在主题中', //fruitSalad
|
||||
// ][index];
|
||||
// }
|
||||
|
||||
class ColorSelectPage extends StatefulWidget {
|
||||
const ColorSelectPage({super.key});
|
||||
@@ -60,8 +61,8 @@ List<Item> generateItems(int count) {
|
||||
|
||||
class _ColorSelectPageState extends State<ColorSelectPage> {
|
||||
final ColorSelectController ctr = Get.put(ColorSelectController());
|
||||
DynamicSchemeVariant _dynamicSchemeVariant =
|
||||
DynamicSchemeVariant.values[GStorage.schemeVariant];
|
||||
FlexSchemeVariant _dynamicSchemeVariant =
|
||||
FlexSchemeVariant.values[GStorage.schemeVariant];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -78,7 +79,7 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
|
||||
child: Icon(Icons.palette_outlined),
|
||||
),
|
||||
subtitle: Text(
|
||||
_dynamicSchemeVariant.subTitle,
|
||||
_dynamicSchemeVariant.description,
|
||||
style: TextStyle(fontSize: 12),
|
||||
),
|
||||
trailing: PopupMenuButton(
|
||||
@@ -90,17 +91,17 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
|
||||
(context as Element).markNeedsBuild();
|
||||
Get.forceAppUpdate();
|
||||
},
|
||||
itemBuilder: (context) => DynamicSchemeVariant.values
|
||||
.map((item) => PopupMenuItem<DynamicSchemeVariant>(
|
||||
itemBuilder: (context) => FlexSchemeVariant.values
|
||||
.map((item) => PopupMenuItem<FlexSchemeVariant>(
|
||||
value: item,
|
||||
child: Text(item.title),
|
||||
child: Text(item.variantName),
|
||||
))
|
||||
.toList(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
_dynamicSchemeVariant.title,
|
||||
_dynamicSchemeVariant.variantName,
|
||||
style: TextStyle(
|
||||
height: 1,
|
||||
fontSize: 13,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:PiliPalaX/common/widgets/http_error.dart';
|
||||
import 'package:PiliPalaX/http/msg.dart';
|
||||
import 'package:PiliPalaX/http/user.dart';
|
||||
import 'package:PiliPalaX/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -233,8 +234,8 @@ class _CreateFavPageState extends State<CreateFavPage> {
|
||||
builder: (context, constraints) {
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
child: Image.network(
|
||||
_cover!,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: _cover!,
|
||||
height: constraints.maxHeight,
|
||||
width: constraints.maxHeight * 16 / 9,
|
||||
fit: BoxFit.cover,
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:math';
|
||||
import 'package:PiliPalaX/common/widgets/imageview.dart';
|
||||
import 'package:PiliPalaX/http/video.dart';
|
||||
import 'package:PiliPalaX/utils/extension.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -763,8 +764,8 @@ class ReplyItem extends StatelessWidget {
|
||||
[
|
||||
if (content.jumpUrl[matchStr]?['prefix_icon'] != null) ...[
|
||||
WidgetSpan(
|
||||
child: Image.network(
|
||||
content.jumpUrl[matchStr]['prefix_icon'],
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: content.jumpUrl[matchStr]['prefix_icon'],
|
||||
height: 19,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
@@ -909,8 +910,8 @@ class ReplyItem extends StatelessWidget {
|
||||
[
|
||||
if (content.jumpUrl[patternStr]?['prefix_icon'] != null) ...[
|
||||
WidgetSpan(
|
||||
child: Image.network(
|
||||
content.jumpUrl[patternStr]['prefix_icon'],
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: content.jumpUrl[patternStr]['prefix_icon'],
|
||||
height: 19,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:PiliPalaX/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||
import 'package:PiliPalaX/http/video.dart';
|
||||
import 'package:PiliPalaX/pages/video/detail/reply/widgets/zan_grpc.dart';
|
||||
import 'package:PiliPalaX/utils/extension.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -786,8 +787,8 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
[
|
||||
if (content.url[matchStr]?.hasPrefixIcon() == true) ...[
|
||||
WidgetSpan(
|
||||
child: Image.network(
|
||||
content.url[matchStr]!.prefixIcon,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: content.url[matchStr]!.prefixIcon,
|
||||
height: 19,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
@@ -946,8 +947,8 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
[
|
||||
if (content.url[patternStr]?.hasPrefixIcon() == true) ...[
|
||||
WidgetSpan(
|
||||
child: Image.network(
|
||||
content.url[patternStr]!.prefixIcon,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: content.url[patternStr]!.prefixIcon,
|
||||
height: 19,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
|
||||
@@ -1168,8 +1168,14 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: videoDetailController.showShootDanmakuSheet,
|
||||
child:
|
||||
const Text('发弹幕', style: TextStyle(fontSize: 12)),
|
||||
child: Text(
|
||||
'发弹幕',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
|
||||
Reference in New Issue
Block a user