Skip to content

Commit

Permalink
fix: 详情页TabBar布局异常
Browse files Browse the repository at this point in the history
  • Loading branch information
guozhigq committed Mar 23, 2024
2 parents c216c9b + 14338dc commit 7b15f19
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
1 change: 1 addition & 0 deletions assets/images/video/danmu_close.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/video/danmu_open.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 22 additions & 25 deletions lib/pages/video/detail/view.dart
Expand Up @@ -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';
Expand Down Expand Up @@ -334,9 +335,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
dividerColor: Colors.transparent,
tabs: vdCtr.tabs
.map(
(String name) => Flexible(
child: Tab(text: name),
),
(String name) => Tab(text: name),
)
.toList(),
),
Expand All @@ -359,30 +358,28 @@ class _VideoDetailPageState extends State<VideoDetailPage>
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),
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Expand Up @@ -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

Expand Down

0 comments on commit 7b15f19

Please sign in to comment.