Skip to content

Commit

Permalink
Migrate to null safety (flutter#110)
Browse files Browse the repository at this point in the history
- *Breaking* The `Font.merge` and `BoxEdge.merge` factory constructors
  are now static methods since a factory constructor can't return null,
  but that was the entire point of these constructors.
- Add nullable return types on methods that have a branch returning
  `null`.
- Add a lot of `?` on parameters that can't provably be non-null.
- Add a lot of `!`.
- Add overrides of `TreeNode.clone` to tighten the return type in a few
  places and allow some skipped explicit casts.
- Remove some dead code on conditional branches that never would have
  been followed, even before the migration, but weren't obvious
  statically.
- Add explicit casts.
  • Loading branch information
natebosch authored Aug 28, 2020
1 parent 1e96b6c commit 7759c1d
Show file tree
Hide file tree
Showing 30 changed files with 617 additions and 671 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
## 0.16.3-dev
## 0.17.0-nullsafety-dev

- `Font.merge` and `BoxEdge.merge` are now static methods instead of factory
constructors.

## 0.16.2

- Added support for escape codes in identifiers.

## 0.16.1

- Fixed a crash caused by parsing certain calc() expressions and variables names that contain numbers.

## 0.16.0
Expand Down
2 changes: 1 addition & 1 deletion example/call_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const _default = css.PreprocessorOptions(
/// CSS will allow any property/value pairs regardless of validity; all of our
/// tests (by default) will ensure that the CSS is really valid.
StyleSheet parseCss(String cssInput,
{List<css.Message> errors, css.PreprocessorOptions opts}) {
{List<css.Message>? errors, css.PreprocessorOptions? opts}) {
return css.parse(cssInput, errors: errors, options: opts ?? _default);
}

Expand Down
Loading

0 comments on commit 7759c1d

Please sign in to comment.