Skip to content

Commit

Permalink
remove web_socket_channel_connect
Browse files Browse the repository at this point in the history
  • Loading branch information
jpeiffer committed Jan 3, 2024
1 parent 93219bf commit c323195
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 189 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.0.1] - January 3rd, 2024

* Removed unnecessary `web_socket_channel_connect` dependency


## [1.0.0+28] - December 5, 2023

* Automated dependency updates
Expand Down
53 changes: 2 additions & 51 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,21 @@
include: package:flutter_lints/flutter.yaml

linter:
rules:
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_empty_else
- avoid_equals_and_hash_code_on_mutable_classes
- avoid_escaping_inner_quotes
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_print
- avoid_relative_lib_imports
- avoid_return_types_on_setters
- avoid_shadowing_type_parameters
- avoid_slow_async_io
- avoid_types_as_parameter_names
- avoid_unnecessary_containers
- avoid_unused_constructor_parameters
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- close_sinks
- curly_braces_in_flow_control_structures
- directives_ordering
- empty_catches
- empty_constructor_bodies
- implementation_imports
- library_names
- library_prefixes
- no_duplicate_case_values
- null_closures
- omit_local_variable_types
- package_names
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_const_constructors
- prefer_final_fields
- prefer_final_locals
- prefer_for_elements_to_map_fromIterable
- prefer_generic_function_type_aliases
- prefer_if_null_operators
- prefer_interpolation_to_compose_strings
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_single_quotes
- prefer_spread_collections
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- recursive_getters
- slash_for_doc_comments
- sort_child_properties_last
- sort_constructors_first
- sort_pub_dependencies
- sort_unnamed_constructors_first
- type_init_formals
- unawaited_futures
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_new
- unnecessary_null_in_if_null_operators
- unnecessary_this
- unrelated_type_equality_checks
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible
- valid_regexps
- void_checks
53 changes: 2 additions & 51 deletions examples/receiver/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,21 @@
include: package:flutter_lints/flutter.yaml

linter:
rules:
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_empty_else
- avoid_equals_and_hash_code_on_mutable_classes
- avoid_escaping_inner_quotes
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_print
- avoid_relative_lib_imports
- avoid_return_types_on_setters
- avoid_shadowing_type_parameters
- avoid_slow_async_io
- avoid_types_as_parameter_names
- avoid_unnecessary_containers
- avoid_unused_constructor_parameters
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- close_sinks
- curly_braces_in_flow_control_structures
- directives_ordering
- empty_catches
- empty_constructor_bodies
- implementation_imports
- library_names
- library_prefixes
- no_duplicate_case_values
- null_closures
- omit_local_variable_types
- package_names
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_const_constructors
- prefer_final_fields
- prefer_final_locals
- prefer_for_elements_to_map_fromIterable
- prefer_generic_function_type_aliases
- prefer_if_null_operators
- prefer_interpolation_to_compose_strings
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_single_quotes
- prefer_spread_collections
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- recursive_getters
- slash_for_doc_comments
- sort_child_properties_last
- sort_constructors_first
- sort_pub_dependencies
- sort_unnamed_constructors_first
- type_init_formals
- unawaited_futures
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_new
- unnecessary_null_in_if_null_operators
- unnecessary_this
- unrelated_type_equality_checks
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible
- valid_regexps
- void_checks
2 changes: 2 additions & 0 deletions examples/receiver/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ environment:
dependencies:
flutter:
sdk: flutter
logging: '^1.2.0'
screen_streamer:
path: ../../

dev_dependencies:
flutter_lints: '^3.0.1'
flutter_test:
sdk: flutter

Expand Down
53 changes: 2 additions & 51 deletions examples/sender/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,21 @@
include: package:flutter_lints/flutter.yaml

linter:
rules:
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_empty_else
- avoid_equals_and_hash_code_on_mutable_classes
- avoid_escaping_inner_quotes
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_print
- avoid_relative_lib_imports
- avoid_return_types_on_setters
- avoid_shadowing_type_parameters
- avoid_slow_async_io
- avoid_types_as_parameter_names
- avoid_unnecessary_containers
- avoid_unused_constructor_parameters
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- close_sinks
- curly_braces_in_flow_control_structures
- directives_ordering
- empty_catches
- empty_constructor_bodies
- implementation_imports
- library_names
- library_prefixes
- no_duplicate_case_values
- null_closures
- omit_local_variable_types
- package_names
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_const_constructors
- prefer_final_fields
- prefer_final_locals
- prefer_for_elements_to_map_fromIterable
- prefer_generic_function_type_aliases
- prefer_if_null_operators
- prefer_interpolation_to_compose_strings
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_single_quotes
- prefer_spread_collections
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- recursive_getters
- slash_for_doc_comments
- sort_child_properties_last
- sort_constructors_first
- sort_pub_dependencies
- sort_unnamed_constructors_first
- type_init_formals
- unawaited_futures
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_new
- unnecessary_null_in_if_null_operators
- unnecessary_this
- unrelated_type_equality_checks
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible
- valid_regexps
- void_checks
2 changes: 2 additions & 0 deletions examples/sender/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ environment:
dependencies:
flutter:
sdk: flutter
logging: '^1.2.0'
screen_streamer:
path: ../../

dev_dependencies:
flutter_lints: '^3.0.1'
flutter_test:
sdk: flutter

Expand Down
41 changes: 21 additions & 20 deletions lib/src/web_rtc/screen_select_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:logging/logging.dart';

/// Dialog to select what screen or window to stream.
class ScreenSelectDialog extends Dialog {
const ScreenSelectDialog({super.key});

@override
Widget build(BuildContext context) {
return Material(
Expand Down Expand Up @@ -56,9 +58,9 @@ class _ScreenSelectContainerState extends State<_ScreenSelectContainer> {
@override
void dispose() {
_timer?.cancel();
_subscriptions.forEach((element) {
for (var element in _subscriptions) {
element.cancel();
});
}

_subscriptions.clear();

Expand All @@ -67,9 +69,9 @@ class _ScreenSelectContainerState extends State<_ScreenSelectContainer> {

void _cancel(context) async {
_timer?.cancel();
_subscriptions.forEach((element) {
element.cancel();
});
for (var element in _subscriptions) {
await element.cancel();
}
_subscriptions.clear();

if (mounted) {
Expand All @@ -80,19 +82,19 @@ class _ScreenSelectContainerState extends State<_ScreenSelectContainer> {
Future<void> _getSources() async {
try {
final sources = await desktopCapturer.getSources(types: [_sourceType]);
sources.forEach((element) {
for (var element in sources) {
_logger.finer(
'name: ${element.name}, id: ${element.id}, type: ${element.type}',
);
});
}
_timer?.cancel();
_timer = Timer.periodic(const Duration(seconds: 3), (timer) {
desktopCapturer.updateSources(types: [_sourceType]);
});
_sources.clear();
sources.forEach((element) {
for (var element in sources) {
_sources[element.id] = element;
});
}
_stateSetter?.call(() {});
} catch (e, stack) {
_logger.severe(
Expand All @@ -105,9 +107,9 @@ class _ScreenSelectContainerState extends State<_ScreenSelectContainer> {

void _ok(context) async {
_timer?.cancel();
_subscriptions.forEach((element) {
element.cancel();
});
for (var element in _subscriptions) {
await element.cancel();
}
Navigator.pop<DesktopCapturerSource>(context, _selectedSource);
}

Expand Down Expand Up @@ -166,13 +168,13 @@ class _ScreenSelectContainerState extends State<_ScreenSelectContainer> {
: SourceType.Window;
_getSources();
}),
tabs: [
const Tab(
tabs: const [
Tab(
child: Text(
'Entire Screen',
style: TextStyle(color: Colors.black54),
)),
const Tab(
Tab(
child: Text(
'Window',
style: TextStyle(color: Colors.black54),
Expand Down Expand Up @@ -235,7 +237,7 @@ class _ScreenSelectContainerState extends State<_ScreenSelectContainer> {
),
),
),
Container(
SizedBox(
width: double.infinity,
child: ButtonBar(
children: <Widget>[
Expand Down Expand Up @@ -268,11 +270,10 @@ class _ScreenSelectContainerState extends State<_ScreenSelectContainer> {

class _ThumbnailWidget extends StatefulWidget {
const _ThumbnailWidget({
Key? key,
required this.onTap,
required this.selected,
required this.source,
}) : super(key: key);
});

final Function(DesktopCapturerSource) onTap;
final bool selected;
Expand All @@ -298,9 +299,9 @@ class _ThumbnailWidgetState extends State<_ThumbnailWidget> {

@override
void deactivate() {
_subscriptions.forEach((element) {
for (var element in _subscriptions) {
element.cancel();
});
}
super.deactivate();
}

Expand Down
Loading

0 comments on commit c323195

Please sign in to comment.