diff --git a/lib/pages/emote/view.dart b/lib/pages/emote/view.dart index cd94eba9..08b600ac 100644 --- a/lib/pages/emote/view.dart +++ b/lib/pages/emote/view.dart @@ -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 @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?> loadingState) { + Widget _buildBody( + ThemeData theme, LoadingState?> loadingState) { return switch (loadingState) { Loading() => loadingWidget, Success(:var response) => response?.isNotEmpty == true @@ -93,27 +97,56 @@ class _EmotePanelState extends State ), 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), ],