Skip to content

Commit 834054b

Browse files
committed
Prep 1.1.0 release
1 parent 4efdf57 commit 834054b

File tree

6 files changed

+16
-173
lines changed

6 files changed

+16
-173
lines changed

.github/workflows/dart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
container:
11-
image: google/dart:2.12-dev
11+
image: google/dart:2.12
1212

1313
steps:
1414
- uses: actions/checkout@v1

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.0
2+
3+
- Stable release w/ null safety for Dart 2.12+
4+
15
## 1.1.0-nullsafety.1
26

37
- fix pub score and tweak pub details

analysis_options.yaml

Lines changed: 1 addition & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1 @@
1-
analyzer:
2-
3-
# ALL lint rules are included and the ones not in use are commented
4-
# out with a reason. An up to date list of all options is here
5-
# http://dart-lang.github.io/linter/lints/options/options.html
6-
# Descriptions of each rule is here http://dart-lang.github.io/linter/lints/
7-
#
8-
# To ignore a lint rule on a case by case basic in code just add a comment
9-
# above it like so: // ignore: <linter rule>
10-
# example: // ignore: invalid_assignment, const_initialized_with_non_constant_value
11-
#
12-
# More info about config lint config options is here
13-
# https://www.dartlang.org/guides/language/analysis-options#excluding-lines-within-a-file
14-
linter:
15-
rules:
16-
# Style: Declare method return types.
17-
# override with // ignore: always_declare_return_types
18-
- always_declare_return_types
19-
20-
# Style: Specify type annotations.
21-
- always_specify_types # really annoying for local vars
22-
23-
# Style: Annotate overridden members
24-
- annotate_overrides
25-
26-
# Style: Avoid using as.
27-
- avoid_as
28-
29-
# Error: Avoid empty else statements.
30-
- avoid_empty_else
31-
32-
# Style: Don't explicitly initialize variables to null
33-
- avoid_init_to_null
34-
35-
# Style: Avoid return types on setters.
36-
- avoid_return_types_on_setters
37-
38-
# Style: Await only futures.
39-
- await_only_futures
40-
41-
# Style: Name types using UpperCamelCase.
42-
- camel_case_types
43-
44-
# Error: Cancel instances of dart.async.StreamSubscription.
45-
- cancel_subscriptions
46-
47-
# Error: Close instances of dart.core.Sink.
48-
- close_sinks
49-
50-
# Error: Only reference in scope identifiers in doc comments.
51-
- comment_references
52-
53-
# Style: Prefer using lowerCamelCase for constant names.
54-
- constant_identifier_names
55-
56-
# Error: Avoid control flow in finally block.
57-
- control_flow_in_finally
58-
59-
# Style: Avoid empty catch blocks.
60-
- empty_catches
61-
62-
# Style: Use ; instead of {} for empty constructor bodies.
63-
- empty_constructor_bodies
64-
65-
# Error: Avoid empty statements.
66-
- empty_statements
67-
68-
# Error: Always override hashCode if overriding ==
69-
- hash_and_equals
70-
71-
# Style: Don't import implementation files from another package.
72-
- implementation_imports
73-
74-
# Error: Conditions should not unconditionally evaluate to "TRUE" or to "FALSE"
75-
- invariant_booleans
76-
77-
# Error: Invocation of Iterable.contains with references of unrelated types.
78-
- iterable_contains_unrelated_type
79-
80-
# Style: Name libraries and source files using lowercase_with_underscores.
81-
- library_names
82-
83-
# Style: Use lowercase_with_underscores when specifying a library prefix.
84-
- library_prefixes
85-
86-
# Error: Invocation of List.remove with references of unrelated types.
87-
- list_remove_unrelated_type
88-
89-
# Error: Conditions should not unconditionally evaluate to "TRUE" or to "FALSE"
90-
- literal_only_boolean_expressions
91-
92-
# Style: Name non-constant identifiers using lowerCamelCase.
93-
- non_constant_identifier_names # UiFactories will lint
94-
95-
# Style: Avoid defining a one-member abstract class when a simple function will do.
96-
- one_member_abstracts
97-
98-
# Style: Only throw instances of classes extending either Exception or Error
99-
- only_throw_errors
100-
101-
# Style: Do not override fields.
102-
- overridden_fields
103-
104-
# Style: Provide doc comments for all public APIs
105-
- package_api_docs
106-
107-
# Pub: Use lowercase_with_underscores for package names.
108-
- package_names
109-
110-
# Style: Prefix library names with the package name and a dot-separated path.
111-
- package_prefixed_library_names
112-
113-
# Style: Don't reassign references to parameters of functions or methods.
114-
- parameter_assignments
115-
116-
# Style: Private field could be final.
117-
- prefer_final_fields
118-
119-
# Style: Prefer final for variable declaration if reference is not reassigned.
120-
# - prefer_final_locals # Noisy, people use var a lot
121-
122-
# Style: Use isNotEmpty for Iterables and Maps.
123-
- prefer_is_not_empty
124-
125-
# Style: Document all public members
126-
- public_member_api_docs
127-
128-
# Style: Prefer to use /// for doc comments
129-
- slash_for_doc_comments
130-
131-
# Style: Sort constructor declarations before method declarations.
132-
- sort_constructors_first
133-
134-
# Style: Sort unnamed constructor declarations first
135-
- sort_unnamed_constructors_first
136-
137-
# Error: Test type arguments in operator ==(Object other).
138-
- test_types_in_equals
139-
140-
# Error: Avoid throw in finally block.
141-
- throw_in_finally
142-
143-
# Style: Type annotate public APIs.
144-
- type_annotate_public_apis # render can return either ReactElement or false
145-
146-
# Style: Don't type annotate initializing formals.
147-
- type_init_formals
148-
149-
# Style: Await for future expression statements inside async function bodies.
150-
- unawaited_futures
151-
152-
# Style: Avoid using braces in interpolation when not needed.
153-
# - unnecessary_brace_in_string_interp # preference
154-
155-
# Style: Avoid wrapping fields in getters and setters just to be "safe".
156-
- unnecessary_getters_setters
157-
158-
# Error: Equality operator (==) invocation with references of unrelated types.
159-
- unrelated_type_equality_checks
160-
161-
# Error: Use valid regular expression syntax.
162-
- valid_regexps
1+
include: package:pedantic/analysis_options.yaml

example/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import 'package:resize_observer/resize_observer.dart' as ro;
66
bool observing = true;
77

88
Future<void> main() async {
9-
Element textarea = document.getElementById('textarea')!;
10-
Element obsEl = document.getElementById('observing')!;
9+
final textarea = document.getElementById('textarea')!;
10+
final obsEl = document.getElementById('observing')!;
1111

1212
ro.ResizeObserver.observe(textarea, _onResize);
1313
obsEl.innerHtml = observing.toString();

lib/resize_observer.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import 'dart:html';
22
import 'dart:js';
33

44
/// A callback for ResizeObserver must conform to this signature
5-
typedef void ResizeObserverCallback(Element element, num x, num y, num width,
6-
num height, num top, num bottom, num left, num right);
5+
typedef ResizeObserverCallback = void Function(Element element, num x, num y,
6+
num width, num height, num top, num bottom, num left, num right);
77

88
/// Resize Observer
99
abstract class ResizeObserver {
@@ -17,8 +17,7 @@ abstract class ResizeObserver {
1717

1818
static JsObject? _initResizeObserver() {
1919
if (supported) {
20-
return JsObject(
21-
context['ResizeObserver'], <dynamic>[_dispatchResizes]);
20+
return JsObject(context['ResizeObserver'], <dynamic>[_dispatchResizes]);
2221
}
2322
return null;
2423
}
@@ -34,7 +33,7 @@ abstract class ResizeObserver {
3433
return;
3534
}
3635

37-
ResizeObserverCallback? callback = _callbackMap[target!];
36+
var callback = _callbackMap[target!];
3837
if (callback != null) {
3938
JsObject? rect = entry['contentRect'];
4039
if (rect != null) {

pubspec.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: resize_observer
2-
version: 1.1.0-nullsafety.1
3-
description: A Dart wrapper for the ResizeObserver API
2+
version: 1.1.0
3+
description: A Dart wrapper for the ResizeObserver API that uses JS interop and a single observer
44
homepage: https://github.com/robrbecker/resize_observer
55

66
environment:
7-
sdk: '>=2.12.0-0 <3.0.0'
7+
sdk: '>=2.12.0 <3.0.0'
88

99
dev_dependencies:
10+
pedantic:
1011
build_runner:
1112
build_web_compilers:

0 commit comments

Comments
 (0)