mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: 表情体验优化,代码整理
This commit is contained in:
@@ -512,13 +512,6 @@ class Api {
|
|||||||
/// 我的订阅详情
|
/// 我的订阅详情
|
||||||
static const userSubFolderDetail = '/x/space/fav/season/list';
|
static const userSubFolderDetail = '/x/space/fav/season/list';
|
||||||
|
|
||||||
/// 表情
|
|
||||||
static const emojiList = '/x/emote/user/panel/web';
|
|
||||||
|
|
||||||
/// 已读标记
|
|
||||||
static const String ackSessionMsg =
|
|
||||||
'${HttpString.tUrl}/session_svr/v1/session_svr/update_ack';
|
|
||||||
|
|
||||||
/// 发送私信
|
/// 发送私信
|
||||||
static const String sendMsg = '${HttpString.tUrl}/web_im/v1/web_im/send_msg';
|
static const String sendMsg = '${HttpString.tUrl}/web_im/v1/web_im/send_msg';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,120 +1,300 @@
|
|||||||
class EmoteModelData {
|
class EmoteModelData {
|
||||||
final List<PackageItem>? packages;
|
Setting? setting;
|
||||||
|
List<Packages>? packages;
|
||||||
|
|
||||||
EmoteModelData({
|
EmoteModelData({this.setting, this.packages});
|
||||||
required this.packages,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory EmoteModelData.fromJson(Map<String, dynamic> jsonRes) {
|
EmoteModelData.fromJson(Map<String, dynamic> json) {
|
||||||
final List<PackageItem>? packages =
|
setting =
|
||||||
jsonRes['packages'] is List ? <PackageItem>[] : null;
|
json['setting'] != null ? Setting.fromJson(json['setting']) : null;
|
||||||
|
if (json['packages'] != null) {
|
||||||
|
packages = <Packages>[];
|
||||||
|
json['packages'].forEach((v) {
|
||||||
|
packages!.add(Packages.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
if (setting != null) {
|
||||||
|
data['setting'] = setting!.toJson();
|
||||||
|
}
|
||||||
if (packages != null) {
|
if (packages != null) {
|
||||||
for (final dynamic item in jsonRes['packages']!) {
|
data['packages'] = packages!.map((v) => v.toJson()).toList();
|
||||||
if (item != null) {
|
|
||||||
try {
|
|
||||||
packages.add(PackageItem.fromJson(item));
|
|
||||||
} catch (_) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return EmoteModelData(
|
return data;
|
||||||
packages: packages,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PackageItem {
|
class Setting {
|
||||||
final int? id;
|
int? recentLimit;
|
||||||
final String? text;
|
int? attr;
|
||||||
final String? url;
|
int? focusPkgId;
|
||||||
final int? mtime;
|
String? schema;
|
||||||
final int? type;
|
|
||||||
final int? attr;
|
|
||||||
final Meta? meta;
|
|
||||||
final List<Emote>? emote;
|
|
||||||
|
|
||||||
PackageItem({
|
Setting({this.recentLimit, this.attr, this.focusPkgId, this.schema});
|
||||||
required this.id,
|
|
||||||
required this.text,
|
|
||||||
required this.url,
|
|
||||||
required this.mtime,
|
|
||||||
required this.type,
|
|
||||||
required this.attr,
|
|
||||||
required this.meta,
|
|
||||||
required this.emote,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory PackageItem.fromJson(Map<String, dynamic> jsonRes) {
|
Setting.fromJson(Map<String, dynamic> json) {
|
||||||
final List<Emote>? emote = jsonRes['emote'] is List ? <Emote>[] : null;
|
recentLimit = json['recent_limit'];
|
||||||
|
attr = json['attr'];
|
||||||
|
focusPkgId = json['focus_pkg_id'];
|
||||||
|
schema = json['schema'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['recent_limit'] = recentLimit;
|
||||||
|
data['attr'] = attr;
|
||||||
|
data['focus_pkg_id'] = focusPkgId;
|
||||||
|
data['schema'] = schema;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Packages {
|
||||||
|
int? id;
|
||||||
|
String? text;
|
||||||
|
String? url;
|
||||||
|
int? mtime;
|
||||||
|
int? type;
|
||||||
|
int? attr;
|
||||||
|
PackagesMeta? meta;
|
||||||
|
List<Emote>? emote;
|
||||||
|
PackagesFlags? flags;
|
||||||
|
Label? label;
|
||||||
|
String? packageSubTitle;
|
||||||
|
int? refMid;
|
||||||
|
|
||||||
|
Packages(
|
||||||
|
{this.id,
|
||||||
|
this.text,
|
||||||
|
this.url,
|
||||||
|
this.mtime,
|
||||||
|
this.type,
|
||||||
|
this.attr,
|
||||||
|
this.meta,
|
||||||
|
this.emote,
|
||||||
|
this.flags,
|
||||||
|
this.label,
|
||||||
|
this.packageSubTitle,
|
||||||
|
this.refMid});
|
||||||
|
|
||||||
|
Packages.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
text = json['text'];
|
||||||
|
url = json['url'];
|
||||||
|
mtime = json['mtime'];
|
||||||
|
type = json['type'];
|
||||||
|
attr = json['attr'];
|
||||||
|
meta = json['meta'] != null ? PackagesMeta.fromJson(json['meta']) : null;
|
||||||
|
if (json['emote'] != null) {
|
||||||
|
emote = <Emote>[];
|
||||||
|
json['emote'].forEach((v) {
|
||||||
|
emote!.add(Emote.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
flags =
|
||||||
|
json['flags'] != null ? PackagesFlags.fromJson(json['flags']) : null;
|
||||||
|
label = json['label'] != null ? Label.fromJson(json['label']) : null;
|
||||||
|
packageSubTitle = json['package_sub_title'];
|
||||||
|
refMid = json['ref_mid'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['text'] = text;
|
||||||
|
data['url'] = url;
|
||||||
|
data['mtime'] = mtime;
|
||||||
|
data['type'] = type;
|
||||||
|
data['attr'] = attr;
|
||||||
|
if (meta != null) {
|
||||||
|
data['meta'] = meta!.toJson();
|
||||||
|
}
|
||||||
if (emote != null) {
|
if (emote != null) {
|
||||||
for (final dynamic item in jsonRes['emote']!) {
|
data['emote'] = emote!.map((v) => v.toJson()).toList();
|
||||||
if (item != null) {
|
|
||||||
try {
|
|
||||||
emote.add(Emote.fromJson(item));
|
|
||||||
} catch (_) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return PackageItem(
|
if (flags != null) {
|
||||||
id: jsonRes['id'],
|
data['flags'] = flags!.toJson();
|
||||||
text: jsonRes['text'],
|
}
|
||||||
url: jsonRes['url'],
|
if (label != null) {
|
||||||
mtime: jsonRes['mtime'],
|
data['label'] = label!.toJson();
|
||||||
type: jsonRes['type'],
|
}
|
||||||
attr: jsonRes['attr'],
|
data['package_sub_title'] = packageSubTitle;
|
||||||
meta: Meta.fromJson(jsonRes['meta']),
|
data['ref_mid'] = refMid;
|
||||||
emote: emote,
|
return data;
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Meta {
|
class Label {
|
||||||
final int? size;
|
String? fontColor;
|
||||||
final List<String>? suggest;
|
String? backgroundColor;
|
||||||
|
String? text;
|
||||||
|
|
||||||
Meta({
|
Label({this.fontColor, this.backgroundColor, this.text});
|
||||||
required this.size,
|
|
||||||
required this.suggest,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory Meta.fromJson(Map<String, dynamic> jsonRes) => Meta(
|
Label.fromJson(Map<String, dynamic> json) {
|
||||||
size: jsonRes['size'],
|
fontColor = json['font_color'];
|
||||||
suggest: jsonRes['suggest'] is List ? <String>[] : null,
|
backgroundColor = json['background_color'];
|
||||||
);
|
text = json['text'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['font_color'] = fontColor;
|
||||||
|
data['background_color'] = backgroundColor;
|
||||||
|
data['text'] = text;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PackagesMeta {
|
||||||
|
int? size;
|
||||||
|
int? itemId;
|
||||||
|
String? itemUrl;
|
||||||
|
int? assetId;
|
||||||
|
|
||||||
|
PackagesMeta({this.size, this.itemId, this.itemUrl, this.assetId});
|
||||||
|
|
||||||
|
PackagesMeta.fromJson(Map<String, dynamic> json) {
|
||||||
|
size = json['size'];
|
||||||
|
itemId = json['item_id'];
|
||||||
|
itemUrl = json['item_url'];
|
||||||
|
assetId = json['asset_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['size'] = size;
|
||||||
|
data['item_id'] = itemId;
|
||||||
|
data['item_url'] = itemUrl;
|
||||||
|
data['asset_id'] = assetId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Emote {
|
class Emote {
|
||||||
final int? id;
|
int? id;
|
||||||
final int? packageId;
|
int? packageId;
|
||||||
final String? text;
|
String? text;
|
||||||
final String? url;
|
String? url;
|
||||||
final int? mtime;
|
int? mtime;
|
||||||
final int? type;
|
int? type;
|
||||||
final int? attr;
|
int? attr;
|
||||||
final Meta? meta;
|
EmoteMeta? meta;
|
||||||
final dynamic activity;
|
EmoteFlags? flags;
|
||||||
|
dynamic activity;
|
||||||
|
String? gifUrl;
|
||||||
|
|
||||||
Emote({
|
Emote(
|
||||||
required this.id,
|
{this.id,
|
||||||
required this.packageId,
|
this.packageId,
|
||||||
required this.text,
|
this.text,
|
||||||
required this.url,
|
this.url,
|
||||||
required this.mtime,
|
this.mtime,
|
||||||
required this.type,
|
this.type,
|
||||||
required this.attr,
|
this.attr,
|
||||||
required this.meta,
|
this.meta,
|
||||||
required this.activity,
|
this.flags,
|
||||||
});
|
this.activity,
|
||||||
|
this.gifUrl});
|
||||||
|
|
||||||
factory Emote.fromJson(Map<String, dynamic> jsonRes) => Emote(
|
Emote.fromJson(Map<String, dynamic> json) {
|
||||||
id: jsonRes['id'],
|
id = json['id'];
|
||||||
packageId: jsonRes['package_id'],
|
packageId = json['package_id'];
|
||||||
text: jsonRes['text'],
|
text = json['text'];
|
||||||
url: jsonRes['url'],
|
url = json['url'];
|
||||||
mtime: jsonRes['mtime'],
|
mtime = json['mtime'];
|
||||||
type: jsonRes['type'],
|
type = json['type'];
|
||||||
attr: jsonRes['attr'],
|
attr = json['attr'];
|
||||||
meta: Meta.fromJson(jsonRes['meta']),
|
meta = json['meta'] != null ? EmoteMeta.fromJson(json['meta']) : null;
|
||||||
activity: jsonRes['activity'],
|
flags = json['flags'] != null ? EmoteFlags.fromJson(json['flags']) : null;
|
||||||
);
|
activity = json['activity'];
|
||||||
|
gifUrl = json['gif_url'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['package_id'] = packageId;
|
||||||
|
data['text'] = text;
|
||||||
|
data['url'] = url;
|
||||||
|
data['mtime'] = mtime;
|
||||||
|
data['type'] = type;
|
||||||
|
data['attr'] = attr;
|
||||||
|
if (meta != null) {
|
||||||
|
data['meta'] = meta!.toJson();
|
||||||
|
}
|
||||||
|
if (flags != null) {
|
||||||
|
data['flags'] = flags!.toJson();
|
||||||
|
}
|
||||||
|
data['activity'] = activity;
|
||||||
|
data['gif_url'] = gifUrl;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class EmoteMeta {
|
||||||
|
int? size;
|
||||||
|
List<String>? suggest;
|
||||||
|
String? alias;
|
||||||
|
String? gifUrl;
|
||||||
|
|
||||||
|
EmoteMeta({this.size, this.suggest, this.alias, this.gifUrl});
|
||||||
|
|
||||||
|
EmoteMeta.fromJson(Map<String, dynamic> json) {
|
||||||
|
size = json['size'];
|
||||||
|
suggest = json['suggest'] == null
|
||||||
|
? null
|
||||||
|
: List<String>.from(json['suggest'].map((x) => x));
|
||||||
|
alias = json['alias'];
|
||||||
|
gifUrl = json['gif_url'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['size'] = size;
|
||||||
|
data['suggest'] = suggest;
|
||||||
|
data['alias'] = alias;
|
||||||
|
data['gif_url'] = gifUrl;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class EmoteFlags {
|
||||||
|
bool? unlocked;
|
||||||
|
bool? recentUseForbid;
|
||||||
|
|
||||||
|
EmoteFlags({this.unlocked, this.recentUseForbid});
|
||||||
|
EmoteFlags.fromJson(Map<String, dynamic> json) {
|
||||||
|
unlocked = json['unlocked'];
|
||||||
|
recentUseForbid = json['recent_use_forbid'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['unlocked'] = unlocked;
|
||||||
|
data['recent_use_forbid'] = recentUseForbid;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PackagesFlags {
|
||||||
|
bool? added;
|
||||||
|
bool? preview;
|
||||||
|
|
||||||
|
PackagesFlags({this.added, this.preview});
|
||||||
|
|
||||||
|
PackagesFlags.fromJson(Map<String, dynamic> json) {
|
||||||
|
added = json['added'];
|
||||||
|
preview = json['preview'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['added'] = added;
|
||||||
|
data['preview'] = preview;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import '../../models/video/reply/emote.dart';
|
|||||||
|
|
||||||
class EmotePanelController extends GetxController
|
class EmotePanelController extends GetxController
|
||||||
with GetTickerProviderStateMixin {
|
with GetTickerProviderStateMixin {
|
||||||
late List<PackageItem> emotePackage;
|
late List<Packages> emotePackage;
|
||||||
late TabController tabController;
|
late TabController tabController;
|
||||||
|
|
||||||
Future getEmote() async {
|
Future getEmote() async {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import '../../common/widgets/network_img_layer.dart';
|
||||||
import '../../models/video/reply/emote.dart';
|
import '../../models/video/reply/emote.dart';
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
|
|
||||||
@@ -35,8 +36,7 @@ class _EmotePanelState extends State<EmotePanel>
|
|||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
Map data = snapshot.data as Map;
|
Map data = snapshot.data as Map;
|
||||||
if (data['status']) {
|
if (data['status']) {
|
||||||
List<PackageItem> emotePackage =
|
List<Packages> emotePackage = _emotePanelController.emotePackage;
|
||||||
_emotePanelController.emotePackage;
|
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -52,9 +52,11 @@ class _EmotePanelState extends State<EmotePanel>
|
|||||||
child: GridView.builder(
|
child: GridView.builder(
|
||||||
gridDelegate:
|
gridDelegate:
|
||||||
SliverGridDelegateWithMaxCrossAxisExtent(
|
SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
maxCrossAxisExtent: size == 1 ? 40 : 60,
|
maxCrossAxisExtent:
|
||||||
|
type == 4 ? 100 : (size == 1 ? 40 : 60),
|
||||||
crossAxisSpacing: 8,
|
crossAxisSpacing: 8,
|
||||||
mainAxisSpacing: 8,
|
mainAxisSpacing: 8,
|
||||||
|
mainAxisExtent: size == 1 ? 40 : 60,
|
||||||
),
|
),
|
||||||
itemCount: e.emote!.length,
|
itemCount: e.emote!.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
@@ -99,7 +101,14 @@ class _EmotePanelState extends State<EmotePanel>
|
|||||||
dividerColor: Colors.transparent,
|
dividerColor: Colors.transparent,
|
||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
tabs: _emotePanelController.emotePackage
|
tabs: _emotePanelController.emotePackage
|
||||||
.map((e) => Tab(text: e.text))
|
.map(
|
||||||
|
(e) => NetworkImgLayer(
|
||||||
|
width: 36,
|
||||||
|
height: 36,
|
||||||
|
type: 'emote',
|
||||||
|
src: e.url,
|
||||||
|
),
|
||||||
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
),
|
),
|
||||||
SizedBox(height: MediaQuery.of(context).padding.bottom + 20),
|
SizedBox(height: MediaQuery.of(context).padding.bottom + 20),
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/http/user.dart';
|
import 'package:PiliPalaX/http/user.dart';
|
||||||
import 'package:pilipala/models/user/info.dart';
|
import 'package:PiliPalaX/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:PiliPalaX/utils/storage.dart';
|
||||||
|
|
||||||
import '../../models/user/sub_folder.dart';
|
import '../../models/user/sub_folder.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'package:easy_debounce/easy_throttle.dart';
|
import 'package:easy_debounce/easy_throttle.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/widgets/http_error.dart';
|
import 'package:PiliPalaX/common/widgets/http_error.dart';
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
import 'widgets/item.dart';
|
import 'widgets/item.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/constants.dart';
|
import 'package:PiliPalaX/common/constants.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:PiliPalaX/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:PiliPalaX/utils/utils.dart';
|
||||||
|
|
||||||
import '../../../models/user/sub_folder.dart';
|
import '../../../models/user/sub_folder.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/http/user.dart';
|
import 'package:PiliPalaX/http/user.dart';
|
||||||
|
|
||||||
import '../../models/user/sub_detail.dart';
|
import '../../models/user/sub_detail.dart';
|
||||||
import '../../models/user/sub_folder.dart';
|
import '../../models/user/sub_folder.dart';
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import 'dart:async';
|
|||||||
import 'package:easy_debounce/easy_throttle.dart';
|
import 'package:easy_debounce/easy_throttle.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/skeleton/video_card_h.dart';
|
import 'package:PiliPalaX/common/skeleton/video_card_h.dart';
|
||||||
import 'package:pilipala/common/widgets/http_error.dart';
|
import 'package:PiliPalaX/common/widgets/http_error.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:PiliPalaX/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/common/widgets/no_data.dart';
|
import 'package:PiliPalaX/common/widgets/no_data.dart';
|
||||||
|
|
||||||
import '../../models/user/sub_folder.dart';
|
import '../../models/user/sub_folder.dart';
|
||||||
import '../../utils/utils.dart';
|
import '../../utils/utils.dart';
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:pilipala/common/constants.dart';
|
import 'package:PiliPalaX/common/constants.dart';
|
||||||
import 'package:pilipala/common/widgets/stat/danmu.dart';
|
import 'package:PiliPalaX/common/widgets/stat/danmu.dart';
|
||||||
import 'package:pilipala/common/widgets/stat/view.dart';
|
import 'package:PiliPalaX/common/widgets/stat/view.dart';
|
||||||
import 'package:pilipala/http/search.dart';
|
import 'package:PiliPalaX/http/search.dart';
|
||||||
import 'package:pilipala/models/common/search_type.dart';
|
import 'package:PiliPalaX/models/common/search_type.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:PiliPalaX/utils/utils.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:PiliPalaX/common/widgets/network_img_layer.dart';
|
||||||
import '../../../common/widgets/badge.dart';
|
import '../../../common/widgets/badge.dart';
|
||||||
import '../../../models/user/sub_detail.dart';
|
import '../../../models/user/sub_detail.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:easy_debounce/easy_throttle.dart';
|
import 'package:easy_debounce/easy_throttle.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:PiliPalaX/common/skeleton/video_reply.dart';
|
import 'package:PiliPalaX/common/skeleton/video_reply.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/http_error.dart';
|
|
||||||
import 'package:PiliPalaX/models/common/reply_type.dart';
|
import 'package:PiliPalaX/models/common/reply_type.dart';
|
||||||
import 'package:PiliPalaX/pages/video/detail/index.dart';
|
import 'package:PiliPalaX/pages/video/detail/index.dart';
|
||||||
import 'package:PiliPalaX/pages/video/detail/reply_new/index.dart';
|
import 'package:PiliPalaX/pages/video/detail/reply_new/index.dart';
|
||||||
|
|||||||
@@ -951,7 +951,6 @@ class MorePanel extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Color errorColor = Theme.of(context).colorScheme.error;
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
_replyContentController.value = TextEditingValue(
|
_replyContentController.value = TextEditingValue(
|
||||||
text: newText,
|
text: newText,
|
||||||
selection:
|
selection:
|
||||||
TextSelection.collapsed(offset: cursorPosition + emote.text!.length),
|
TextSelection.collapsed(offset: cursorPosition + emote.text!.length),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
if (keyboardHeight == 0 && emoteHeight == 0) {
|
if (keyboardHeight == 0 && emoteHeight == 0) {
|
||||||
setState(() {
|
setState(() {
|
||||||
emoteHeight = keyboardHeight =
|
emoteHeight = keyboardHeight =
|
||||||
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
|
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -221,15 +221,11 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
AnimatedSize(
|
SizedBox(
|
||||||
curve: Curves.easeInOut,
|
width: double.infinity,
|
||||||
duration: const Duration(milliseconds: 300),
|
height: toolbarType == 'input' ? keyboardHeight : emoteHeight,
|
||||||
child: SizedBox(
|
child: EmotePanel(
|
||||||
width: double.infinity,
|
onChoose: (package, emote) => onChooseEmote(package, emote),
|
||||||
height: toolbarType == 'input' ? keyboardHeight : emoteHeight,
|
|
||||||
child: EmotePanel(
|
|
||||||
onChoose: (package, emote) => onChooseEmote(package, emote),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -255,4 +251,4 @@ class Debouncer {
|
|||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user