Show channel info and a follow control between video and chat in portrait, reusing the shared GQL follow path. Co-authored-by: Cursor <cursoragent@cursor.com>
63 lines
2 KiB
Dart
63 lines
2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_mobx/flutter_mobx.dart';
|
|
import 'package:frosty/screens/channel/video/stream_info_bar.dart';
|
|
import 'package:frosty/screens/channel/video/video_player_interface.dart';
|
|
import 'package:frosty/screens/settings/stores/auth_store.dart';
|
|
import 'package:frosty/widgets/follow_button.dart';
|
|
|
|
/// Channel metadata + follow control shown under the player (portrait).
|
|
class ChannelInfoHeader extends StatelessWidget {
|
|
final VideoPlayerInterface videoStore;
|
|
final AuthStore authStore;
|
|
final String userId;
|
|
final String displayName;
|
|
final bool isInSharedChatMode;
|
|
|
|
const ChannelInfoHeader({
|
|
super.key,
|
|
required this.videoStore,
|
|
required this.authStore,
|
|
required this.userId,
|
|
required this.displayName,
|
|
this.isInSharedChatMode = false,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Material(
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
|
child: Padding(
|
|
padding: const EdgeInsets.fromLTRB(12, 8, 12, 8),
|
|
child: Observer(
|
|
builder: (context) {
|
|
final streamInfo = videoStore.streamInfo;
|
|
final offline = streamInfo == null;
|
|
|
|
return Row(
|
|
spacing: 8,
|
|
children: [
|
|
Expanded(
|
|
child: StreamInfoBar(
|
|
streamInfo: streamInfo,
|
|
offlineChannelInfo: videoStore.offlineChannelInfo,
|
|
displayName: displayName,
|
|
isCompact: true,
|
|
isOffline: offline,
|
|
isInSharedChatMode: isInSharedChatMode,
|
|
showTextShadows: false,
|
|
tooltipTriggerMode: TooltipTriggerMode.longPress,
|
|
),
|
|
),
|
|
FollowButton(
|
|
authStore: authStore,
|
|
userId: userId,
|
|
displayName: displayName,
|
|
),
|
|
],
|
|
);
|
|
},
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|