Skip to content

Commit

Permalink
Fix lints, support Flutter 2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
pingbird committed Aug 16, 2023
1 parent e952077 commit 0730a72
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 18 deletions.
3 changes: 3 additions & 0 deletions boxy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [2.1.0]
* Support for Flutter 2.13

## [2.0.9]
* Skipped calls to buildScope as a minor performance improvement

Expand Down
9 changes: 4 additions & 5 deletions boxy/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors:
missing_required_param: warning
missing_return: warning
language:
strict-casts: true
strict-raw-types: true

linter:
rules:
Expand Down Expand Up @@ -82,14 +82,13 @@ linter:
- flutter_style_todos
- hash_and_equals
- implementation_imports
- iterable_contains_unrelated_type
- collection_methods_unrelated_type
# - join_return_with_assignment # not required by flutter style
- leading_newlines_in_multiline_strings
- library_names
- library_prefixes
- library_private_types_in_public_api
# - lines_longer_than_80_chars # not required by flutter style
- list_remove_unrelated_type
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/linter/issues/453
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
Expand Down
2 changes: 1 addition & 1 deletion boxy/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'pages/tree_view.dart';
void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
Expand Down
6 changes: 3 additions & 3 deletions boxy/example/lib/pages/boxy_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ class BoxyRowPageState extends State<BoxyRowPage> {
label: 'BoxyRow',
child: BoxyRow(
mainAxisSize: MainAxisSize.min,
children: [
const ChildCard(text: 'Child 1', color: Colors.red),
children: const [
ChildCard(text: 'Child 1', color: Colors.red),
Dominant(
child: LabelBox(
label: 'Dominant',
child: LabelBox(
label: 'Column',
child: Column(
mainAxisSize: MainAxisSize.min,
children: const [
children: [
ChildCard(
text: 'Child 2', color: Colors.lightGreen),
ChildCard(text: 'Child 3', color: Colors.blue),
Expand Down
2 changes: 1 addition & 1 deletion boxy/example/lib/pages/product_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class SeebTitle extends StatefulWidget {
}

class SeebTitleState extends State<SeebTitle> {
late StreamSubscription subscription;
late StreamSubscription<void> subscription;
late bool expanded;

@override
Expand Down
2 changes: 1 addition & 1 deletion boxy/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.0.0
homepage: https://github.com/PixelToast/boxy

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=2.18.0 <3.0.0'

dependencies:
boxy: ^2.0.6+2
Expand Down
8 changes: 4 additions & 4 deletions boxy/lib/src/boxy_flex.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BoxyFlex extends MultiChildRenderObjectWidget {
/// to be necessary to decide which direction to lay the children in or to
/// disambiguate `start` or `end` values for the main or cross axis
/// directions, the [textDirection] must not be null.
BoxyFlex({
const BoxyFlex({
super.key,
required this.direction,
this.mainAxisAlignment = MainAxisAlignment.start,
Expand Down Expand Up @@ -267,7 +267,7 @@ class BoxyRow extends BoxyFlex {
/// unless the row has no children or only one child) or to disambiguate
/// `start` or `end` values for the [mainAxisAlignment], the [textDirection]
/// must not be null.
BoxyRow({
const BoxyRow({
super.key,
super.mainAxisAlignment,
super.mainAxisSize,
Expand Down Expand Up @@ -309,7 +309,7 @@ class BoxyColumn extends BoxyFlex {
/// any. If there is no ambient directionality, and a text direction is going
/// to be necessary to disambiguate `start` or `end` values for the
/// [crossAxisAlignment], the [textDirection] must not be null.
BoxyColumn({
const BoxyColumn({
super.key,
super.mainAxisAlignment,
super.mainAxisSize,
Expand Down Expand Up @@ -438,7 +438,7 @@ class BoxyFlexible extends ParentDataWidget<FlexParentData> {
}

if (needsLayout) {
final AbstractNode? targetParent = renderObject.parent;
final targetParent = renderObject.parent;
if (targetParent is RenderObject) {
targetParent.markNeedsLayout();
}
Expand Down
2 changes: 1 addition & 1 deletion boxy/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: boxy
description: Overcome limitations of built-in layouts, advanced flex, custom multi-child layouts, slivers, and more!
version: 2.0.9
version: 2.1.0
homepage: https://github.com/PixelToast/boxy
documentation: https://boxy.wiki

Expand Down
4 changes: 2 additions & 2 deletions boxy/test/boxy_state_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ void main() {
inflatedNames: inflated.toList(),
),
children: [
for (var nm in children)
for (final nm in children)
StateTestChild(key: GlobalObjectKey(nm)),
],
),
],
),
for (var nm in outside)
for (final nm in outside)
StateTestChild(key: GlobalObjectKey(nm)),
],
),
Expand Down

0 comments on commit 0730a72

Please sign in to comment.