Skip to content

Commit 32b7b79

Browse files
authored
[v0.9.5] (#23)
* chore: lint rules; bump some deps; fix analysis warnings; * chore: bump github action versions; * chore: print currently used flutter version; * chore: update README w/ deprecation; * chore: switch license to MIT; * chore: bump version '0.9.4' -> '0.9.5'; * chore: update changelog;
1 parent d4517a2 commit 32b7b79

13 files changed

+285
-994
lines changed

.github/workflows/on_pull_request.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Check out the code
15-
uses: actions/checkout@v2.3.4
15+
uses: actions/checkout@v3
1616
- name: Set up Flutter
17-
uses: subosito/flutter-action@v1.4.0
17+
uses: subosito/flutter-action@v2
1818
with:
1919
channel: stable
20+
- name: Print the Flutter version
21+
run: flutter --version
2022
- name: Install dependencies
2123
run: flutter pub get
2224
- name: Analyze code style
@@ -30,7 +32,7 @@ jobs:
3032
- name: Run the tests (with coverage)
3133
run: flutter test --coverage
3234
- name: Upload code coverage report to Codecov
33-
uses: codecov/codecov-action@v1.2.2
35+
uses: codecov/codecov-action@v3
3436
with:
3537
token: "${{ secrets.CODECOV_TOKEN }}"
3638
- name: Add PR comment with code coverage report
@@ -39,7 +41,7 @@ jobs:
3941
github-token: "${{ secrets.GITHUB_TOKEN }}"
4042
lcov-file: "./coverage/lcov.info"
4143
- name: Fail if code coverage has regressed
42-
uses: VeryGoodOpenSource/very_good_coverage@v1.1.1
44+
uses: VeryGoodOpenSource/very_good_coverage@v2
4345
with:
4446
min_coverage: 100
4547
path: "./coverage/lcov.info"

.github/workflows/publish_codecov.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Check out the code
15-
uses: actions/checkout@v2.3.4
15+
uses: actions/checkout@v3
1616
- name: Set up Flutter
17-
uses: subosito/flutter-action@v1.4.0
17+
uses: subosito/flutter-action@v2
1818
with:
1919
channel: stable
20+
- name: Print the Flutter version
21+
run: flutter --version
2022
- name: Install dependencies
2123
run: flutter pub get
2224
- name: Ensure code coverage checks correct files
@@ -26,6 +28,6 @@ jobs:
2628
- name: Run the tests (with coverage)
2729
run: flutter test --coverage
2830
- name: Upload code coverage report to Codecov
29-
uses: codecov/codecov-action@v1.2.2
31+
uses: codecov/codecov-action@v3
3032
with:
3133
token: "${{ secrets.CODECOV_TOKEN }}"

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [0.9.5] - 2023/03/11
2+
3+
* Add deprecation notice in README
4+
* Switch to MIT license
5+
* Bump project dependencies
6+
* Switch to standard Flutter lint rules
7+
* Fix static analysis warnings
8+
19
## [0.9.4] - 2022/04/17
210

311
* Update project dependencies

LICENSE

Lines changed: 21 additions & 674 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# DEPRECATED
2+
3+
**_This package is no longer maintained._**
4+
5+
TapCanvas was originally added because Flutter did not provide a way to detect taps outside of a widget.
6+
This has since been [added to Flutter](https://github.com/flutter/flutter/pull/107262) in the form of `TapRegion`.
7+
8+
The core use case of TapCanvas was to dismiss focus for text fields on desktop and web, when the user tapped/clicked outside of them.
9+
Both Material and Cupertino text fields, now provide this behaviour out of the box, which you can override if you wish to change.
10+
11+
This package is now rendered pointless by the Flutter framework.
12+
13+
<br>
14+
15+
---
16+
117
# 🚰 TapCanvas
218

319
Detect taps outside the currently defined widget and provide a callback when taps occur.
@@ -11,7 +27,7 @@ Detect taps outside the currently defined widget and provide a callback when tap
1127

1228
```dart
1329
class MyApp extends StatelessWidget {
14-
const MyApp({Key? key}) : super(key: key);
30+
const MyApp({super.key});
1531
1632
@override
1733
Widget build(BuildContext context) => MaterialApp(
@@ -26,7 +42,7 @@ class MyApp extends StatelessWidget {
2642

2743
```dart
2844
class TapOutsideAwareWidget extends StatelessWidget {
29-
const TapOutsideAwareWidget({Key? key}) : super(key: key);
45+
const TapOutsideAwareWidget({super.key});
3046
3147
@override
3248
Widget build(BuildContext context) => TapOutsideDetectorWidget(

analysis_options.yaml

Lines changed: 8 additions & 196 deletions
Original file line numberDiff line numberDiff line change
@@ -1,203 +1,15 @@
11
---
2+
include: package:flutter_lints/flutter.yaml
3+
24
analyzer:
35
errors:
4-
missing_required_param: error
6+
# Allow State classes of StatefulWidgets to be private.
7+
library_private_types_in_public_api: ignore
8+
9+
# Desirable, but experimental.
10+
use_build_context_synchronously: ignore
511

612
linter:
713
rules:
8-
- always_declare_return_types
9-
- always_put_control_body_on_new_line
10-
- always_put_required_named_parameters_first
11-
- always_require_non_null_named_parameters
12-
# May review this on in future for the sake of readability
13-
# - always_specify_types
14-
- always_use_package_imports
15-
- annotate_overrides
16-
- avoid_annotating_with_dynamic
17-
# May review this on in future if not possible to infer all types
18-
# - avoid_as
19-
- avoid_bool_literals_in_conditional_expressions
20-
- avoid_catches_without_on_clauses
21-
- avoid_catching_errors
22-
- avoid_classes_with_only_static_members
23-
- avoid_double_and_int_checks
24-
- avoid_empty_else
25-
- avoid_equals_and_hash_code_on_mutable_classes
26-
- avoid_escaping_inner_quotes
27-
- avoid_field_initializers_in_const_classes
28-
- avoid_function_literals_in_foreach_calls
29-
- avoid_implementing_value_types
30-
- avoid_init_to_null
31-
- avoid_js_rounded_ints
32-
- avoid_null_checks_in_equality_operators
33-
- avoid_positional_boolean_parameters
34-
# Don't want to include logger as dependency
35-
# - avoid_print
36-
- avoid_private_typedef_functions
37-
- avoid_redundant_argument_values
38-
- avoid_relative_lib_imports
39-
- avoid_renaming_method_parameters
40-
- avoid_return_types_on_setters
41-
- avoid_returning_null
42-
- avoid_returning_null_for_future
43-
- avoid_returning_null_for_void
44-
- avoid_returning_this
45-
- avoid_setters_without_getters
46-
- avoid_shadowing_type_parameters
47-
- avoid_single_cascade_in_expression_statements
48-
- avoid_slow_async_io
49-
- avoid_type_to_string
50-
- avoid_types_as_parameter_names
51-
- avoid_types_on_closure_parameters
52-
- avoid_unnecessary_containers
53-
- avoid_unused_constructor_parameters
54-
- avoid_void_async
55-
- avoid_web_libraries_in_flutter
56-
- await_only_futures
57-
- camel_case_extensions
58-
- camel_case_types
59-
- cancel_subscriptions
60-
- cascade_invocations
61-
# Experimental lint rule (null-safety)
62-
# - cast_nullable_to_non_nullable
63-
- close_sinks
64-
- comment_references
65-
- constant_identifier_names
66-
- control_flow_in_finally
67-
- curly_braces_in_flow_control_structures
68-
# Overkill for the implementation for the diagnostics
69-
# - diagnostic_describe_all_properties
7014
- directives_ordering
71-
- do_not_use_environment
72-
- empty_catches
73-
- empty_constructor_bodies
74-
- empty_statements
75-
- exhaustive_cases
76-
- file_names
77-
# It forces an assignee to each TODO
78-
# - flutter_style_todos
79-
- hash_and_equals
80-
- implementation_imports
81-
- invariant_booleans
82-
- iterable_contains_unrelated_type
83-
- join_return_with_assignment
84-
- leading_newlines_in_multiline_strings
85-
- library_names
86-
- library_prefixes
87-
- lines_longer_than_80_chars
88-
- list_remove_unrelated_type
89-
- literal_only_boolean_expressions
90-
- missing_whitespace_between_adjacent_strings
91-
- no_adjacent_strings_in_list
92-
# Experimental lint rule
93-
# - no_default_cases
94-
- no_duplicate_case_values
95-
- no_logic_in_create_state
96-
- no_runtimeType_toString
97-
- non_constant_identifier_names
98-
# Experimental lint rule (null-safety)
99-
# - null_check_on_nullable_type_parameter
100-
- null_closures
101-
# May review this on in future for the sake of readability
102-
- omit_local_variable_types
103-
# Don't see the value in this one
104-
# - one_member_abstracts
105-
- only_throw_errors
106-
- overridden_fields
107-
- package_api_docs
108-
- package_names
109-
- package_prefixed_library_names
110-
- parameter_assignments
111-
- prefer_adjacent_string_concatenation
112-
- prefer_asserts_in_initializer_lists
113-
# Overkill
114-
# - prefer_asserts_with_message
115-
- prefer_collection_literals
116-
- prefer_conditional_assignment
117-
- prefer_const_constructors
118-
- prefer_const_constructors_in_immutables
119-
- prefer_const_declarations
120-
- prefer_const_literals_to_create_immutables
121-
- prefer_constructors_over_static_methods
122-
- prefer_contains
123-
# General Flutter practice is single quotes
124-
# - prefer_double_quotes
125-
- prefer_equal_for_default_values
126-
- prefer_expression_function_bodies
127-
- prefer_final_fields
128-
- prefer_final_in_for_each
129-
- prefer_final_locals
130-
- prefer_for_elements_to_map_fromIterable
131-
- prefer_foreach
132-
- prefer_function_declarations_over_variables
133-
- prefer_generic_function_type_aliases
134-
- prefer_if_elements_to_conditional_expressions
135-
- prefer_if_null_operators
136-
- prefer_initializing_formals
137-
- prefer_inlined_adds
138-
- prefer_int_literals
139-
- prefer_interpolation_to_compose_strings
140-
- prefer_is_empty
141-
- prefer_is_not_empty
142-
- prefer_is_not_operator
143-
- prefer_iterable_whereType
144-
- prefer_mixin
145-
- prefer_null_aware_operators
146-
# Prefer fully qualified package imports
147-
# - prefer_relative_imports
148-
- prefer_single_quotes
149-
- prefer_spread_collections
150-
- prefer_typing_uninitialized_variables
151-
- prefer_void_to_null
152-
- provide_deprecation_message
153-
# Not every class has a reason to have comprehensive documentation
154-
# - public_member_api_docs
155-
- recursive_getters
156-
- sized_box_for_whitespace
157-
- slash_for_doc_comments
158-
- sort_child_properties_last
159-
- sort_constructors_first
160-
- sort_pub_dependencies
161-
- sort_unnamed_constructors_first
162-
- test_types_in_equals
163-
- throw_in_finally
164-
- tighten_type_of_initializing_formals
165-
- type_annotate_public_apis
166-
- type_init_formals
167-
- unawaited_futures
168-
- unnecessary_await_in_return
169-
- unnecessary_brace_in_string_interps
170-
- unnecessary_const
171-
# With this linter, it is advised to use var, instead of final but it can break the immutability approach
172-
# - unnecessary_final
173-
- unnecessary_getters_setters
174-
- unnecessary_lambdas
175-
- unnecessary_new
176-
- unnecessary_null_aware_assignments
177-
# Experimental lint rule (null-safety)
178-
# - unnecessary_null_checks
179-
- unnecessary_null_in_if_null_operators
180-
# Experimental lint rule (null-safety)
181-
# - unnecessary_nullable_for_final_variable_declarations
182-
- unnecessary_overrides
183-
- unnecessary_parenthesis
184-
- unnecessary_raw_strings
185-
- unnecessary_statements
186-
- unnecessary_string_escapes
187-
- unnecessary_string_interpolations
188-
- unnecessary_this
189-
- unrelated_type_equality_checks
190-
- unsafe_html
191-
- use_full_hex_values_for_flutter_colors
192-
- use_function_type_syntax_for_parameters
193-
- use_is_even_rather_than_modulo
194-
- use_key_in_widget_constructors
195-
# Experimental lint rule (null-safety)
196-
# - use_late_for_private_fields_and_variables
197-
- use_raw_strings
198-
- use_rethrow_when_possible
199-
- use_setters_to_change_properties
200-
- use_string_buffers
201-
- use_to_and_as_if_applicable
202-
- valid_regexps
203-
- void_checks
15+
- flutter_style_todos

example/lib/main.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class DemoPageState extends State<DemoPage> {
3838
super.initState();
3939
_focusNode.addListener(() {
4040
if (_focusNode.hasFocus) {
41-
print('FOCUS GAINED');
41+
debugPrint('FOCUS GAINED');
4242
} else {
43-
print('FOCUS LOST');
43+
debugPrint('FOCUS LOST');
4444
}
4545
});
4646
}
@@ -65,11 +65,11 @@ class DemoPageState extends State<DemoPage> {
6565
child: Center(
6666
child: TapOutsideDetectorWidget(
6767
onTappedOutside: () {
68-
print('OUTSIDE TAPPED');
68+
debugPrint('OUTSIDE TAPPED');
6969
_focusNode.unfocus();
7070
},
7171
onTappedInside: () {
72-
print('INSIDE TAPPED');
72+
debugPrint('INSIDE TAPPED');
7373
_focusNode.requestFocus();
7474
},
7575
child: Container(

0 commit comments

Comments
 (0)