Skip to content

Commit

Permalink
clean the unused parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainaamr committed Jan 27, 2024
1 parent 780ae1b commit 63b3794
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 20 deletions.
2 changes: 0 additions & 2 deletions lib/views/chat_view/chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import 'package:gocast_mobile/views/chat_view/chat_view_state.dart';


class ChatView extends ConsumerStatefulWidget {
final bool isActive;
final Int64? streamID;

const ChatView({
super.key,
required this.isActive,
this.streamID,
});

Expand Down
5 changes: 0 additions & 5 deletions lib/views/chat_view/chat_view_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class ChatViewState extends ConsumerState<ChatView> {
@override
Widget build(BuildContext context) {
final chatState = ref.watch(chatViewModelProvider);
var suggestedStreams = ref.watch(videoViewModelProvider).streams ?? [];
suggestedStreams = suggestedStreams.where((element) => element.id != widget.streamID).toList();
suggestedStreams.sort((a, b) => a.start.toDateTime().compareTo(b.start.toDateTime()));
bool isIOS = Theme.of(context).platform == TargetPlatform.iOS;
if(chatState.isRateLimitReached){
WidgetsBinding.instance.addPostFrameCallback((_) {
Expand All @@ -66,8 +63,6 @@ class ChatViewState extends ConsumerState<ChatView> {
});
}
return buildActiveChat(isIOS);
//return widget.isActive ? buildActiveChat(isIOS) :
//buildInactiveChatOverlay(isIOS, suggestedStreams);
}

Widget buildActiveChat(bool isIOS) {
Expand Down
2 changes: 0 additions & 2 deletions lib/views/chat_view/inactive_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import 'package:gocast_mobile/views/video_view/video_player.dart';
import 'package:gocast_mobile/base/networking/api/gocast/api_v2.pb.dart';

class InactiveView extends ConsumerStatefulWidget {
final bool isActive;
final Int64? streamID;

const InactiveView({
super.key,
required this.isActive,
this.streamID,
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import 'package:fixnum/fixnum.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import 'package:gocast_mobile/views/poll_view/poll_view_state.dart';
import 'package:gocast_mobile/views/chat_view/poll_view_state.dart';

class PollView extends ConsumerStatefulWidget {
final bool isActive;
final Int64? streamID;

const PollView({
super.key,
required this.isActive,
this.streamID,
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:gocast_mobile/views/poll_view/poll_view.dart';
import 'package:gocast_mobile/views/chat_view/poll_view.dart';

class PollViewState extends ConsumerState<PollView> {
@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:gocast_mobile/models/error/error_model.dart';
import 'package:gocast_mobile/providers.dart';
import 'package:gocast_mobile/views/chat_view/chat_view.dart';
import 'package:gocast_mobile/views/chat_view/inactive_view.dart';
import 'package:gocast_mobile/views/video_view/offline_video_player/offline_video_player_controller.dart';
import 'package:shared_preferences/shared_preferences.dart';

Expand All @@ -31,7 +31,7 @@ class OfflineVideoPlayerPageState
return Column(
children: <Widget>[
Expanded(child: _controllerManager.buildVideoPlayer()),
const Expanded(child: ChatView(isActive: false)),
const Expanded(child: InactiveView()),
],
);
}
Expand Down
12 changes: 7 additions & 5 deletions lib/views/video_view/video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:gocast_mobile/models/error/error_model.dart';
import 'package:gocast_mobile/providers.dart';
import 'package:gocast_mobile/views/chat_view/chat_view.dart';
import 'package:gocast_mobile/views/chat_view/inactive_view.dart';
import 'package:gocast_mobile/views/chat_view/poll_view.dart';
import 'package:gocast_mobile/views/video_view/utils/custom_video_control_bar.dart';
import 'package:gocast_mobile/views/video_view/utils/video_player_handler.dart';
import 'package:gocast_mobile/views/video_view/video_player_controller.dart';
Expand Down Expand Up @@ -46,13 +47,14 @@ class VideoPlayerPageState extends ConsumerState<VideoPlayerPage> {
isChatActive: _isChatActive,
isPollActive: _isPollActive,
isPollVisible: _isPollsVisible,
onDownload: (type) => _downloadVideo(widget.stream,type),
onDownload: (type) => _downloadVideo(widget.stream, type),
),
Expanded(
child: _isChatVisible
? ChatView(isActive: _isChatVisible, streamID: widget.stream.id)
: InactiveView(
isActive: !_isChatVisible, streamID: widget.stream.id),
child: _isChatVisible
? ChatView(streamID: widget.stream.id)
: _isPollsVisible
? PollView(streamID: widget.stream.id)
: InactiveView(streamID: widget.stream.id),
),
],
);
Expand Down

0 comments on commit 63b3794

Please sign in to comment.