mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-16 07:06:14 +08:00
emoji setting
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
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/scroll_physics.dart';
|
||||
@@ -27,10 +28,13 @@ class _EmotePanelState extends State<EmotePanel>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Obx(() => _buildBody(_emotePanelController.loadingState.value));
|
||||
final ThemeData theme = Theme.of(context);
|
||||
return Obx(
|
||||
() => _buildBody(theme, _emotePanelController.loadingState.value));
|
||||
}
|
||||
|
||||
Widget _buildBody(LoadingState<List<Packages>?> loadingState) {
|
||||
Widget _buildBody(
|
||||
ThemeData theme, LoadingState<List<Packages>?> loadingState) {
|
||||
return switch (loadingState) {
|
||||
Loading() => loadingWidget,
|
||||
Success(:var response) => response?.isNotEmpty == true
|
||||
@@ -93,27 +97,56 @@ class _EmotePanelState extends State<EmotePanel>
|
||||
),
|
||||
Divider(
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
||||
color: theme.dividerColor.withOpacity(0.1),
|
||||
),
|
||||
TabBar(
|
||||
controller: _emotePanelController.tabController,
|
||||
padding: const EdgeInsets.only(right: 60),
|
||||
dividerColor: Colors.transparent,
|
||||
dividerHeight: 0,
|
||||
isScrollable: true,
|
||||
tabs: response
|
||||
.map(
|
||||
(e) => Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: NetworkImgLayer(
|
||||
width: 24,
|
||||
height: 24,
|
||||
type: ImageType.emote,
|
||||
src: e.url,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: iconButton(
|
||||
iconSize: 20,
|
||||
iconColor:
|
||||
theme.colorScheme.onSurfaceVariant.withOpacity(0.8),
|
||||
bgColor: Colors.transparent,
|
||||
context: context,
|
||||
onPressed: () {
|
||||
Get.toNamed(
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url':
|
||||
'https://www.bilibili.com/h5/mall/emoji-package/home?navhide=1&native.theme=1&night=${Get.isDarkMode ? 1 : 0}',
|
||||
},
|
||||
);
|
||||
},
|
||||
icon: Icons.settings,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: TabBar(
|
||||
controller: _emotePanelController.tabController,
|
||||
padding: const EdgeInsets.only(right: 60),
|
||||
dividerColor: Colors.transparent,
|
||||
dividerHeight: 0,
|
||||
isScrollable: true,
|
||||
tabs: response
|
||||
.map(
|
||||
(e) => Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: NetworkImgLayer(
|
||||
width: 24,
|
||||
height: 24,
|
||||
type: ImageType.emote,
|
||||
src: e.url,
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: MediaQuery.of(context).padding.bottom),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user