Skip to content

Commit 11d1b1f

Browse files
committed
Rename flutter_callkeep to calkeep.
1 parent de4f9e8 commit 11d1b1f

File tree

9 files changed

+42
-236
lines changed

9 files changed

+42
-236
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
## 0.0.1
1+
# Changelog
22

3-
* TODO: Describe initial release.
3+
[0.1.0] - 2020.09.15
4+
5+
* Initial release.
6+
* Support iOS 10+ and Android 6.0+.

analysis_options.yaml

Lines changed: 20 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -1,192 +1,24 @@
1-
# Specify analysis options.
2-
#
3-
# Until there are meta linter rules, each desired lint must be explicitly enabled.
4-
# See: https://github.com/dart-lang/linter/issues/288
5-
#
6-
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
7-
# See the configuration guide for more
8-
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
9-
#
10-
# There are other similar analysis options files in the flutter repos,
11-
# which should be kept in sync with this file:
12-
#
13-
# - analysis_options.yaml (this file)
14-
# - packages/flutter/lib/analysis_options_user.yaml
15-
# - https://github.com/flutter/plugins/blob/master/analysis_options.yaml
16-
# - https://github.com/flutter/engine/blob/master/analysis_options.yaml
17-
#
18-
# This file contains the analysis options used by Flutter tools, such as IntelliJ,
19-
# Android Studio, and the `flutter analyze` command.
20-
21-
analyzer:
22-
strong-mode:
23-
implicit-casts: false
24-
implicit-dynamic: false
25-
errors:
26-
# treat missing required parameters as a warning (not a hint)
27-
missing_required_param: warning
28-
# treat missing returns as a warning (not a hint)
29-
missing_return: warning
30-
# allow having TODOs in the code
31-
todo: ignore
32-
# allow self-reference to deprecated members (we do this because otherwise we have
33-
# to annotate every member in every test, assert, etc, when we deprecate something)
34-
deprecated_member_use_from_same_package: ignore
35-
# Ignore analyzer hints for updating pubspecs when using Future or
36-
# Stream and not importing dart:async
37-
# Please see https://github.com/flutter/flutter/pull/24528 for details.
38-
sdk_version_async_exported_from_core: ignore
39-
exclude:
40-
- "bin/cache/**"
41-
- "lib/generated/**"
1+
include: package:pedantic/analysis_options.yaml
422

433
linter:
444
rules:
45-
# these rules are documented on and in the same order as
46-
# the Dart Lint rules page to make maintenance easier
47-
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
485
- always_declare_return_types
49-
- always_put_control_body_on_new_line
50-
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
51-
- always_require_non_null_named_parameters
52-
- always_specify_types
53-
- annotate_overrides
54-
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
55-
# - avoid_as # required for implicit-casts: true
56-
- avoid_bool_literals_in_conditional_expressions
57-
# - avoid_catches_without_on_clauses # we do this commonly
58-
# - avoid_catching_errors # we do this commonly
59-
- avoid_classes_with_only_static_members
60-
# - avoid_double_and_int_checks # only useful when targeting JS runtime
616
- avoid_empty_else
62-
- avoid_equals_and_hash_code_on_mutable_classes
63-
- avoid_field_initializers_in_const_classes
64-
- avoid_function_literals_in_foreach_calls
65-
# - avoid_implementing_value_types # not yet tested
66-
- avoid_init_to_null
67-
# - avoid_js_rounded_ints # only useful when targeting JS runtime
68-
- avoid_null_checks_in_equality_operators
69-
# - avoid_positional_boolean_parameters # not yet tested
70-
# - avoid_print # not yet tested
71-
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
72-
# - avoid_redundant_argument_values # not yet tested
73-
- avoid_relative_lib_imports
74-
- avoid_renaming_method_parameters
75-
- avoid_return_types_on_setters
76-
# - avoid_returning_null # there are plenty of valid reasons to return null
77-
# - avoid_returning_null_for_future # not yet tested
78-
- avoid_returning_null_for_void
79-
# - avoid_returning_this # there are plenty of valid reasons to return this
80-
# - avoid_setters_without_getters # not yet tested
81-
# - avoid_shadowing_type_parameters # not yet tested
82-
- avoid_single_cascade_in_expression_statements
83-
- avoid_slow_async_io
84-
- avoid_types_as_parameter_names
85-
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
86-
# - avoid_unnecessary_containers # not yet tested
87-
- avoid_unused_constructor_parameters
88-
- avoid_void_async
89-
# - avoid_web_libraries_in_flutter # not yet tested
907
- await_only_futures
8+
- avoid_returning_null_for_void
919
- camel_case_extensions
9210
- camel_case_types
9311
- cancel_subscriptions
94-
# - cascade_invocations # not yet tested
95-
# - close_sinks # not reliable enough
96-
# - comment_references # blocked on https://github.com/flutter/flutter/issues/20765
97-
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
98-
- control_flow_in_finally
99-
# - curly_braces_in_flow_control_structures # not yet tested
100-
# - diagnostic_describe_all_properties # not yet tested
10112
- directives_ordering
102-
- empty_catches
103-
- empty_constructor_bodies
104-
- empty_statements
105-
# - file_names # not yet tested
10613
- flutter_style_todos
107-
- hash_and_equals
108-
- implementation_imports
109-
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
110-
- iterable_contains_unrelated_type
111-
# - join_return_with_assignment # not yet tested
112-
- library_names
113-
- library_prefixes
114-
# - lines_longer_than_80_chars # not yet tested
115-
- list_remove_unrelated_type
116-
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
117-
# - missing_whitespace_between_adjacent_strings # not yet tested
118-
- no_adjacent_strings_in_list
119-
- no_duplicate_case_values
120-
# - no_logic_in_create_state # not yet tested
121-
# - no_runtimeType_toString # not yet tested
122-
- non_constant_identifier_names
123-
# - null_closures # not yet tested
124-
# - omit_local_variable_types # opposite of always_specify_types
125-
# - one_member_abstracts # too many false positives
126-
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
127-
- overridden_fields
128-
- package_api_docs
129-
- package_names
130-
- package_prefixed_library_names
131-
# - parameter_assignments # we do this commonly
132-
- prefer_adjacent_string_concatenation
133-
- prefer_asserts_in_initializer_lists
134-
# - prefer_asserts_with_message # not yet tested
135-
- prefer_collection_literals
136-
- prefer_conditional_assignment
137-
- prefer_const_constructors
138-
- prefer_const_constructors_in_immutables
139-
- prefer_const_declarations
140-
- prefer_const_literals_to_create_immutables
141-
# - prefer_constructors_over_static_methods # not yet tested
142-
- prefer_contains
143-
# - prefer_double_quotes # opposite of prefer_single_quotes
144-
- prefer_equal_for_default_values
145-
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
146-
- prefer_final_fields
147-
- prefer_final_in_for_each
148-
- prefer_final_locals
149-
- prefer_for_elements_to_map_fromIterable
150-
- prefer_foreach
151-
# - prefer_function_declarations_over_variables # not yet tested
152-
- prefer_generic_function_type_aliases
153-
# - prefer_if_elements_to_conditional_expressions
154-
- prefer_if_null_operators
155-
- prefer_initializing_formals
156-
- prefer_inlined_adds
157-
# - prefer_int_literals # not yet tested
158-
# - prefer_interpolation_to_compose_strings # not yet tested
159-
- prefer_is_empty
160-
- prefer_is_not_empty
161-
- prefer_is_not_operator
162-
- prefer_iterable_whereType
163-
# - prefer_mixin # https://github.com/dart-lang/language/issues/32
164-
# - prefer_null_aware_operators # disable until NNBD, see https://github.com/flutter/flutter/pull/32711#issuecomment-492930932
165-
# - prefer_relative_imports # not yet tested
166-
- prefer_single_quotes
167-
- prefer_spread_collections
168-
- prefer_typing_uninitialized_variables
169-
- prefer_void_to_null
170-
# - provide_deprecation_message # not yet tested
171-
# - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml
172-
- recursive_getters
173-
- slash_for_doc_comments
174-
# - sort_child_properties_last # not yet tested
17514
- sort_constructors_first
176-
- sort_pub_dependencies
17715
- sort_unnamed_constructors_first
178-
- test_types_in_equals
179-
- throw_in_finally
180-
# - type_annotate_public_apis # subset of always_specify_types
16+
- sort_pub_dependencies
18117
- type_init_formals
182-
# - unawaited_futures # too many false positives
183-
# - unnecessary_await_in_return # not yet tested
18418
- unnecessary_brace_in_string_interps
18519
- unnecessary_const
186-
# - unnecessary_final # conflicts with prefer_final_locals
187-
- unnecessary_getters_setters
188-
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
18920
- unnecessary_new
21+
- unnecessary_getters_setters
19022
- unnecessary_null_aware_assignments
19123
- unnecessary_null_in_if_null_operators
19224
- unnecessary_overrides
@@ -195,13 +27,22 @@ linter:
19527
- unnecessary_string_interpolations
19628
- unnecessary_this
19729
- unrelated_type_equality_checks
198-
# - unsafe_html # not yet tested
199-
- use_full_hex_values_for_flutter_colors
200-
# - use_function_type_syntax_for_parameters # not yet tested
201-
# - use_key_in_widget_constructors # not yet tested
20230
- use_rethrow_when_possible
203-
# - use_setters_to_change_properties # not yet tested
204-
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
205-
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
20631
- valid_regexps
20732
- void_checks
33+
34+
analyzer:
35+
errors:
36+
# treat missing required parameters as a warning (not a hint)
37+
missing_required_param: warning
38+
# treat missing returns as a warning (not a hint)
39+
missing_return: warning
40+
# allow having TODOs in the code
41+
todo: ignore
42+
# allow self-reference to deprecated members (we do this because otherwise we have
43+
# to annotate every member in every test, assert, etc, when we deprecate something)
44+
deprecated_member_use_from_same_package: ignore
45+
# Ignore analyzer hints for updating pubspecs when using Future or
46+
# Stream and not importing dart:async
47+
# Please see https://github.com/flutter/flutter/pull/24528 for details.
48+
sdk_version_async_exported_from_core: ignore
File renamed without changes.

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'dart:async';
22

33
import 'package:flutter/material.dart';
44

5-
import 'package:flutter_callkeep/flutter_callkeep.dart';
5+
import 'package:callkeep/callkeep.dart';
66
import 'package:uuid/uuid.dart';
77

88
void main() {

example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ dependencies:
1212
flutter:
1313
sdk: flutter
1414

15-
flutter_callkeep:
15+
callkeep:
1616
# When depending on this package from a real application you should use:
17-
# flutter_callkeep: ^x.y.z
17+
# callkeep: ^x.y.z
1818
# See https://dart.dev/tools/pub/dependencies#version-constraints
1919
# The example app is bundled with the plugin so we use a path dependency on
2020
# the parent directory to use the current plugin's version.
File renamed without changes.

lib/src/api.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import 'package:flutter/material.dart'
1111
Text,
1212
Widget;
1313
import 'package:flutter/services.dart' show MethodChannel;
14-
import 'package:flutter_callkeep/src/actions.dart';
1514

15+
import 'actions.dart';
1616
import 'event.dart';
1717

1818
bool get isIOS => Platform.isIOS;
@@ -64,8 +64,8 @@ class FlutterCallkeep extends EventManager {
6464
}
6565

6666
Future<void> _hasDefaultPhoneAccount(Map<String, dynamic> options) async {
67-
final bool hasDefault = await _checkDefaultPhoneAccount();
68-
final bool shouldOpenAccounts = await _alert(options, hasDefault);
67+
final hasDefault = await _checkDefaultPhoneAccount();
68+
final shouldOpenAccounts = await _alert(options, hasDefault);
6969
if (shouldOpenAccounts) {
7070
await _openPhoneAccounts();
7171
}
@@ -269,9 +269,9 @@ class FlutterCallkeep extends EventManager {
269269

270270
Future<bool> _setupAndroid(Map<String, dynamic> options) async {
271271
await _channel.invokeMethod<void>('setup', {'options': options});
272-
final bool showAccountAlert = await _checkPhoneAccountPermission(
272+
final showAccountAlert = await _checkPhoneAccountPermission(
273273
options['additionalPermissions'] as List<String> ?? <String>[]);
274-
final bool shouldOpenAccounts = await _alert(options, showAccountAlert);
274+
final shouldOpenAccounts = await _alert(options, showAccountAlert);
275275

276276
if (shouldOpenAccounts) {
277277
await _openPhoneAccounts();

lib/src/event.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class EventManager {
2525

2626
/// returns true if there are any listeners associated with the EventType for this instance of EventManager
2727
bool hasListeners(EventType event) {
28-
final List<dynamic> targets = listeners[event.runtimeType];
28+
final targets = listeners[event.runtimeType];
2929
if (targets != null) {
3030
return targets.isNotEmpty;
3131
}
@@ -55,7 +55,7 @@ class EventManager {
5555
assert(listener != null, 'Null listener');
5656
assert(runtimeType != null, 'Null runtimeType');
5757
try {
58-
List<dynamic> targets = listeners[runtimeType];
58+
var targets = listeners[runtimeType];
5959
if (targets == null) {
6060
targets = <dynamic>[];
6161
listeners[runtimeType] = targets;
@@ -79,7 +79,7 @@ class EventManager {
7979

8080
void remove<T extends EventType>(
8181
T eventType, void Function(T event) listener) {
82-
final List<dynamic> targets = listeners[eventType.runtimeType];
82+
final targets = listeners[eventType.runtimeType];
8383
if (targets == null) {
8484
return;
8585
}
@@ -93,11 +93,11 @@ class EventManager {
9393
void emit<T extends EventType>(T event) {
9494
event.sanityCheck();
9595
// ignore: always_specify_types
96-
final List targets = listeners[event.runtimeType];
96+
final targets = listeners[event.runtimeType];
9797

9898
if (targets != null) {
9999
// avoid concurrent modification
100-
final List<dynamic> copy = List<dynamic>.from(targets);
100+
final copy = List<dynamic>.from(targets);
101101
// ignore: avoid_function_literals_in_foreach_calls
102102
copy.forEach((dynamic target) {
103103
try {

pubspec.yaml

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: flutter_callkeep
2-
description: A new flutter plugin project.
3-
version: 0.0.1
1+
name: callkeep
2+
description: iOS CallKit framework and Android ConnectionService for Flutter.
3+
version: 0.1.0
44
55
homepage: https://github.com/flutter-webrtc/callkeep
66

@@ -11,56 +11,18 @@ environment:
1111
dependencies:
1212
flutter:
1313
sdk: flutter
14-
events2: '^0.1.3'
1514

1615
dev_dependencies:
1716
flutter_test:
1817
sdk: flutter
1918

20-
# For information on the generic Dart part of this file, see the
21-
# following page: https://dart.dev/tools/pub/pubspec
19+
pedantic: ^1.9.0
2220

23-
# The following section is specific to Flutter.
2421
flutter:
25-
# This section identifies this Flutter project as a plugin project.
26-
# The 'pluginClass' and Android 'package' identifiers should not ordinarily
27-
# be modified. They are used by the tooling to maintain consistency when
28-
# adding or updating assets for this project.
2922
plugin:
3023
platforms:
3124
android:
3225
package: com.github.cloudwebrtc.flutter_callkeep
3326
pluginClass: FlutterCallkeepPlugin
3427
ios:
3528
pluginClass: FlutterCallkeepPlugin
36-
37-
# To add assets to your plugin package, add an assets section, like this:
38-
# assets:
39-
# - images/a_dot_burr.jpeg
40-
# - images/a_dot_ham.jpeg
41-
#
42-
# For details regarding assets in packages, see
43-
# https://flutter.dev/assets-and-images/#from-packages
44-
#
45-
# An image asset can refer to one or more resolution-specific "variants", see
46-
# https://flutter.dev/assets-and-images/#resolution-aware.
47-
48-
# To add custom fonts to your plugin package, add a fonts section here,
49-
# in this "flutter" section. Each entry in this list should have a
50-
# "family" key with the font family name, and a "fonts" key with a
51-
# list giving the asset and other descriptors for the font. For
52-
# example:
53-
# fonts:
54-
# - family: Schyler
55-
# fonts:
56-
# - asset: fonts/Schyler-Regular.ttf
57-
# - asset: fonts/Schyler-Italic.ttf
58-
# style: italic
59-
# - family: Trajan Pro
60-
# fonts:
61-
# - asset: fonts/TrajanPro.ttf
62-
# - asset: fonts/TrajanPro_Bold.ttf
63-
# weight: 700
64-
#
65-
# For details regarding fonts in packages, see
66-
# https://flutter.dev/custom-fonts/#from-packages

0 commit comments

Comments
 (0)