mod: 修改样式
This commit is contained in:
@ -576,6 +576,7 @@ class DynamicLiveModel {
|
|||||||
String? areaName;
|
String? areaName;
|
||||||
String? title;
|
String? title;
|
||||||
int? liveStartTime;
|
int? liveStartTime;
|
||||||
|
Map? watchedShow;
|
||||||
|
|
||||||
DynamicLiveModel.fromJson(Map<String, dynamic> json) {
|
DynamicLiveModel.fromJson(Map<String, dynamic> json) {
|
||||||
content = json['content'];
|
content = json['content'];
|
||||||
@ -594,6 +595,7 @@ class DynamicLiveModel {
|
|||||||
areaName = livePlayInfo['area_name'];
|
areaName = livePlayInfo['area_name'];
|
||||||
title = livePlayInfo['title'];
|
title = livePlayInfo['title'];
|
||||||
liveStartTime = livePlayInfo['live_start_time'];
|
liveStartTime = livePlayInfo['live_start_time'];
|
||||||
|
watchedShow = livePlayInfo['watched_show'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -140,13 +140,6 @@ class _DynamicsPageState extends State<DynamicsPage>
|
|||||||
thumbDecoration: BoxDecoration(
|
thumbDecoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
border: Border.all(
|
|
||||||
width: 1,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.surfaceVariant
|
|
||||||
.withOpacity(0.7),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
|
|||||||
@ -13,8 +13,9 @@ final DynamicsController _dynamicsController = Get.put(DynamicsController());
|
|||||||
Widget liveRcmdPanel(item, context, {floor = 1}) {
|
Widget liveRcmdPanel(item, context, {floor = 1}) {
|
||||||
TextStyle authorStyle =
|
TextStyle authorStyle =
|
||||||
TextStyle(color: Theme.of(context).colorScheme.primary);
|
TextStyle(color: Theme.of(context).colorScheme.primary);
|
||||||
int liveStatus = item.modules.moduleDynamic.major.liveRcmd.liveStatus;
|
|
||||||
DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd;
|
DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd;
|
||||||
|
int liveStatus = liveRcmd.liveStatus!;
|
||||||
|
Map watchedShow = liveRcmd.watchedShow!;
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@ -74,6 +75,8 @@ Widget liveRcmdPanel(item, context, {floor = 1}) {
|
|||||||
src: item.modules.moduleDynamic.major.liveRcmd.cover,
|
src: item.modules.moduleDynamic.major.liveRcmd.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
pBadge(watchedShow['text_large'], context, 6, 56, null, null,
|
||||||
|
type: 'gray'),
|
||||||
pBadge(
|
pBadge(
|
||||||
liveStatus == 1 ? '直播中' : '直播结束', context, 6, 6, null, null),
|
liveStatus == 1 ? '直播中' : '直播结束', context, 6, 6, null, null),
|
||||||
Positioned(
|
Positioned(
|
||||||
|
|||||||
@ -94,7 +94,7 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
|
|||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: const LinearGradient(
|
gradient: const LinearGradient(
|
||||||
begin: Alignment.topCenter,
|
begin: Alignment.center,
|
||||||
end: Alignment.bottomCenter,
|
end: Alignment.bottomCenter,
|
||||||
colors: <Color>[
|
colors: <Color>[
|
||||||
Colors.transparent,
|
Colors.transparent,
|
||||||
@ -115,7 +115,9 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
|
|||||||
color: Colors.white),
|
color: Colors.white),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(content.durationText ?? ''),
|
pBadge(content.durationText ?? '', context, null,
|
||||||
|
null, 0, 0,
|
||||||
|
type: 'gray'),
|
||||||
if (content.durationText != null)
|
if (content.durationText != null)
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(content.stat.play + '次围观'),
|
Text(content.stat.play + '次围观'),
|
||||||
|
|||||||
@ -9,6 +9,7 @@ class LiveRoomController extends GetxController {
|
|||||||
String cover = '';
|
String cover = '';
|
||||||
late int roomId;
|
late int roomId;
|
||||||
var liveItem;
|
var liveItem;
|
||||||
|
late String heroTag;
|
||||||
|
|
||||||
MeeduPlayerController meeduPlayerController = MeeduPlayerController(
|
MeeduPlayerController meeduPlayerController = MeeduPlayerController(
|
||||||
colorTheme: Theme.of(Get.context!).colorScheme.primary,
|
colorTheme: Theme.of(Get.context!).colorScheme.primary,
|
||||||
@ -22,6 +23,7 @@ class LiveRoomController extends GetxController {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
if (Get.arguments != null) {
|
if (Get.arguments != null) {
|
||||||
var args = Get.arguments['liveItem'];
|
var args = Get.arguments['liveItem'];
|
||||||
|
heroTag = Get.arguments['heroTag'];
|
||||||
liveItem = args;
|
liveItem = args;
|
||||||
roomId = liveItem.roomId!;
|
roomId = liveItem.roomId!;
|
||||||
if (args.pic != null && args.pic != '') {
|
if (args.pic != null && args.pic != '') {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_meedu_media_kit/meedu_player.dart';
|
import 'package:flutter_meedu_media_kit/meedu_player.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@ -16,11 +18,29 @@ class LiveRoomPage extends StatefulWidget {
|
|||||||
class _LiveRoomPageState extends State<LiveRoomPage> {
|
class _LiveRoomPageState extends State<LiveRoomPage> {
|
||||||
final LiveRoomController _liveRoomController = Get.put(LiveRoomController());
|
final LiveRoomController _liveRoomController = Get.put(LiveRoomController());
|
||||||
MeeduPlayerController? _meeduPlayerController;
|
MeeduPlayerController? _meeduPlayerController;
|
||||||
|
StreamSubscription? _playerEventSubs;
|
||||||
|
|
||||||
|
bool isShowCover = true;
|
||||||
|
bool isPlay = true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_meeduPlayerController = _liveRoomController.meeduPlayerController;
|
_meeduPlayerController = _liveRoomController.meeduPlayerController;
|
||||||
|
_playerEventSubs = _meeduPlayerController!.onPlayerStatusChanged.listen(
|
||||||
|
(PlayerStatus status) {
|
||||||
|
if (status == PlayerStatus.playing) {
|
||||||
|
isShowCover = false;
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_meeduPlayerController!.dispose();
|
||||||
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -57,33 +77,11 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Stack(
|
|
||||||
children: [
|
|
||||||
Positioned(
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
child: NetworkImgLayer(
|
|
||||||
type: 'emote',
|
|
||||||
src: _liveRoomController.cover,
|
|
||||||
width: Get.size.width,
|
|
||||||
height: videoHeight + 45,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned.fill(
|
|
||||||
child: BackdropFilter(
|
|
||||||
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color:
|
|
||||||
Theme.of(context).colorScheme.background.withOpacity(0.1),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Scaffold(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
body: Column(
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Hero(
|
||||||
|
tag: _liveRoomController.heroTag,
|
||||||
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
AspectRatio(
|
AspectRatio(
|
||||||
aspectRatio: 16 / 9,
|
aspectRatio: 16 / 9,
|
||||||
@ -91,19 +89,37 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
|||||||
controller: _meeduPlayerController!,
|
controller: _meeduPlayerController!,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Visibility(
|
||||||
|
visible: isShowCover,
|
||||||
|
child: Positioned(
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
child: NetworkImgLayer(
|
||||||
|
type: 'emote',
|
||||||
|
src: _liveRoomController.liveItem.cover,
|
||||||
|
width: Get.size.width,
|
||||||
|
height: videoHeight,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
if (_liveRoomController.liveItem.watchedShow != null)
|
if (_liveRoomController.liveItem.watchedShow != null)
|
||||||
Container(
|
Container(
|
||||||
color: Theme.of(context).colorScheme.background,
|
|
||||||
height: 45,
|
height: 45,
|
||||||
padding: const EdgeInsets.only(left: 12, right: 12),
|
padding: const EdgeInsets.only(left: 12, right: 12),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
Text(_liveRoomController
|
Text(_liveRoomController.liveItem.watchedShow['text_large']),
|
||||||
.liveItem.watchedShow['text_large']),
|
|
||||||
]),
|
]),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).colorScheme.background,
|
||||||
|
border: Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Theme.of(context).dividerColor.withOpacity(0.1)),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
),
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user