"Refactor AI and Home views, remove delayed function calls, and update video player controller initialization"
This commit is contained in:
parent
b0d6566ac3
commit
e4c9c1f369
|
|
@ -31,16 +31,8 @@ class _AiState extends State<Ai> {
|
|||
@override
|
||||
void initState() {
|
||||
final state = context.read<HistoryAiChatState>();
|
||||
Future.delayed(
|
||||
Duration.zero,
|
||||
() {
|
||||
if (state.refresh) {
|
||||
|
||||
state.getBots();
|
||||
state.refresh = false;
|
||||
}
|
||||
state.getBots();
|
||||
},
|
||||
);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -552,7 +552,9 @@ class _AiChatPageState extends State<AiChatPage> {
|
|||
),
|
||||
),
|
||||
),
|
||||
if (message.file != null && !Platform.isIOS)
|
||||
if (message.file != null &&
|
||||
!kIsWeb &&
|
||||
!Platform.isIOS)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: InkWell(
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class _HoshanDrawerState extends State<HoshanDrawer> {
|
|||
slivers: [
|
||||
SliverStateHandler(
|
||||
state: state,
|
||||
centerEmptyState: true,
|
||||
centerEmptyState: false,
|
||||
emptyState: const EmptyList(),
|
||||
// enableEmptyState: state.chats.isEmpty,
|
||||
placeholder: chatRowPlaceholder(),
|
||||
|
|
|
|||
|
|
@ -139,11 +139,11 @@ class _HomeState extends State<Home>
|
|||
state.tabController = _tabController;
|
||||
_tabController.addListener(() {
|
||||
state.currentPageIndex = _tabController.index;
|
||||
if (_tabController.index == 2) {
|
||||
homeScaffKey.currentState!.closeDrawer();
|
||||
// if (_tabController.index == 2) {
|
||||
// homeScaffKey.currentState!.closeDrawer();
|
||||
|
||||
context.read<HistoryAiChatState>().getBots();
|
||||
}
|
||||
// context.read<HistoryAiChatState>().getBots();
|
||||
// }
|
||||
});
|
||||
if (!kIsWeb) {
|
||||
Future.delayed(Duration.zero, () {
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ class _ChatVideoPlayerState extends State<ChatVideoPlayer> {
|
|||
}
|
||||
|
||||
Future<void> _handleVideoPlayback() async {
|
||||
_videoPlayerController = VideoPlayerController.network(widget.src,
|
||||
httpHeaders: {'Authorization': 'Bearer ${RequestService.token}'});
|
||||
_videoPlayerController = VideoPlayerController.network(
|
||||
'${widget.src}?accessToken=${RequestService.token}');
|
||||
|
||||
await _videoPlayerController.initialize().then((_) {
|
||||
setState(() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue