mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 01:26:59 +08:00
@@ -1,4 +1,4 @@
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomToast extends StatelessWidget {
|
||||
@@ -6,11 +6,11 @@ class CustomToast extends StatelessWidget {
|
||||
|
||||
final String msg;
|
||||
|
||||
static double toastOpacity = Pref.defaultToastOp;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final double toastOpacity = GStorage.setting
|
||||
.get(SettingBoxKey.defaultToastOp, defaultValue: 1.0) as double;
|
||||
return Container(
|
||||
margin:
|
||||
EdgeInsets.only(bottom: MediaQuery.paddingOf(context).bottom + 30),
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:PiliPlus/common/widgets/image/nine_grid_view.dart';
|
||||
import 'package:PiliPlus/models/common/badge_type.dart';
|
||||
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ImageModel {
|
||||
@@ -28,7 +28,10 @@ class ImageModel {
|
||||
dynamic get safeWidth => width ?? 1;
|
||||
dynamic get safeHeight => height ?? 1;
|
||||
bool get isLongPic => _isLongPic ??= (safeHeight / safeWidth) > (22 / 9);
|
||||
bool get isLivePhoto => _isLivePhoto ??= liveUrl?.isNotEmpty == true;
|
||||
bool get isLivePhoto =>
|
||||
_isLivePhoto ??= enableLivePhoto && liveUrl?.isNotEmpty == true;
|
||||
|
||||
static bool enableLivePhoto = Pref.enableLivePhoto;
|
||||
}
|
||||
|
||||
Widget imageView(
|
||||
@@ -80,8 +83,6 @@ Widget imageView(
|
||||
);
|
||||
}
|
||||
|
||||
late final enableLivePhoto = GStorage.enableLivePhoto;
|
||||
|
||||
int parseSize(size) {
|
||||
return switch (size) {
|
||||
int() => size,
|
||||
@@ -100,7 +101,7 @@ Widget imageView(
|
||||
initialPage: index,
|
||||
imgList: picArr.map(
|
||||
(item) {
|
||||
bool isLive = item.isLivePhoto && enableLivePhoto;
|
||||
bool isLive = item.isLivePhoto;
|
||||
return SourceModel(
|
||||
sourceType:
|
||||
isLive ? SourceType.livePhoto : SourceType.networkImage,
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:PiliPlus/common/widgets/interactiveviewer_gallery/interactive_vi
|
||||
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/image_util.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
@@ -95,7 +95,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
|
||||
late final RxInt currentIndex = widget.initIndex.obs;
|
||||
|
||||
late final int _quality = GStorage.previewQ;
|
||||
late final int _quality = Pref.previewQ;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -3,7 +3,7 @@ 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/image_util.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -38,7 +38,7 @@ class PendantAvatar extends StatelessWidget {
|
||||
: BadgeType.none,
|
||||
badgeSize = badgeSize ?? size / 3;
|
||||
|
||||
static bool showDynDecorate = GStorage.showDynDecorate;
|
||||
static bool showDynDecorate = Pref.showDynDecorate;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart' show clampDouble;
|
||||
import 'package:flutter/material.dart' hide RefreshIndicator;
|
||||
@@ -23,8 +24,8 @@ Widget refreshIndicator({
|
||||
// The over-scroll distance that moves the indicator to its maximum
|
||||
// displacement, as a percentage of the scrollable's container extent.
|
||||
|
||||
double displacement = 20;
|
||||
double kDragContainerExtentPercentage = 0.25;
|
||||
double displacement = Pref.refreshDisplacement;
|
||||
double kDragContainerExtentPercentage = Pref.refreshDragPercentage;
|
||||
|
||||
// How much the scroll's drag gesture can overshoot the RefreshIndicator's
|
||||
// displacement; max displacement = _kDragSizeFactorLimit * displacement.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Widget videoTabBarView({
|
||||
@@ -73,14 +73,16 @@ class MemberVideoScrollPhysics extends AlwaysScrollableScrollPhysics {
|
||||
}
|
||||
|
||||
class CustomSpringDescription implements SpringDescription {
|
||||
@override
|
||||
final mass = GStorage.springDescription[0];
|
||||
static final List<double> springDescription = Pref.springDescription;
|
||||
|
||||
@override
|
||||
final stiffness = GStorage.springDescription[1];
|
||||
final mass = springDescription[0];
|
||||
|
||||
@override
|
||||
final damping = GStorage.springDescription[2];
|
||||
final stiffness = springDescription[1];
|
||||
|
||||
@override
|
||||
final damping = springDescription[2];
|
||||
|
||||
CustomSpringDescription._();
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ import 'package:PiliPlus/models/model_video.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_archive/item.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -249,7 +250,7 @@ class VideoCustomActions {
|
||||
act: 5,
|
||||
reSrc: 11,
|
||||
);
|
||||
GStorage.setBlackMid(videoItem.owner.mid!);
|
||||
Pref.setBlackMid(videoItem.owner.mid!);
|
||||
Get.back();
|
||||
SmartDialog.showToast(res['msg'] ?? '成功');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user