diff --git a/assets/images/video/danmu_close.svg b/assets/images/video/danmu_close.svg
new file mode 100644
index 000000000..9f48027b0
--- /dev/null
+++ b/assets/images/video/danmu_close.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/images/video/danmu_open.svg b/assets/images/video/danmu_open.svg
new file mode 100644
index 000000000..24e8d7a99
--- /dev/null
+++ b/assets/images/video/danmu_open.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart
index af901cd2f..a403e2980 100644
--- a/lib/pages/video/detail/view.dart
+++ b/lib/pages/video/detail/view.dart
@@ -5,6 +5,7 @@ import 'dart:ui';
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
import 'package:floating/floating.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
+import 'package:flutter_svg/svg.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get/get.dart';
import 'package:flutter/material.dart';
@@ -334,9 +335,7 @@ class _VideoDetailPageState extends State
dividerColor: Colors.transparent,
tabs: vdCtr.tabs
.map(
- (String name) => Flexible(
- child: Tab(text: name),
- ),
+ (String name) => Tab(text: name),
)
.toList(),
),
@@ -359,30 +358,28 @@ class _VideoDetailPageState extends State
const Text('发弹幕', style: TextStyle(fontSize: 12)),
),
),
- const SizedBox(width: 4),
SizedBox(
- width: 34,
- height: 32,
- child: TextButton(
- style: ButtonStyle(
- padding: MaterialStateProperty.all(EdgeInsets.zero),
+ width: 38,
+ height: 38,
+ child: Obx(
+ () => IconButton(
+ onPressed: () {
+ plPlayerController?.isOpenDanmu.value =
+ !(plPlayerController?.isOpenDanmu.value ??
+ false);
+ },
+ icon: (plPlayerController?.isOpenDanmu.value ??
+ false)
+ ? SvgPicture.asset(
+ 'assets/images/video/danmu_close.svg',
+ )
+ : SvgPicture.asset(
+ 'assets/images/video/danmu_open.svg',
+ // ignore: deprecated_member_use
+ color:
+ Theme.of(context).colorScheme.primary,
+ ),
),
- onPressed: () {
- plPlayerController?.isOpenDanmu.value =
- !(plPlayerController?.isOpenDanmu.value ??
- false);
- },
- child: Obx(() => Text(
- '弹',
- style: TextStyle(
- fontSize: 12,
- color: (plPlayerController
- ?.isOpenDanmu.value ??
- false)
- ? Theme.of(context).colorScheme.primary
- : Theme.of(context).colorScheme.outline,
- ),
- )),
),
),
const SizedBox(width: 14),
diff --git a/pubspec.yaml b/pubspec.yaml
index 5c25f0442..821664030 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -191,6 +191,7 @@ flutter:
- assets/images/lv/
- assets/images/logo/
- assets/images/live/
+ - assets/images/video/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware