Linter: fix curly_braces_in_flow_control_structures issue
This commit is contained in:
parent
15b50f53d3
commit
bb2d27b1f3
6 changed files with 23 additions and 13 deletions
|
@ -30,6 +30,7 @@ analyzer:
|
|||
errors:
|
||||
avoid_empty_else: error
|
||||
exhaustive_cases: error
|
||||
curly_braces_in_flow_control_structures: error
|
||||
unused_import: warning
|
||||
prefer_is_empty: warning
|
||||
use_rethrow_when_possible: info
|
||||
|
|
|
@ -146,8 +146,9 @@ class _ExpansionTileState extends State<ExpansionCard>
|
|||
}
|
||||
PageStorage.of(context)?.writeState(context, _isExpanded);
|
||||
});
|
||||
if (widget.onExpansionChanged != null)
|
||||
if (widget.onExpansionChanged != null) {
|
||||
widget.onExpansionChanged(_isExpanded);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildChildren(BuildContext context, Widget child) {
|
||||
|
|
|
@ -112,14 +112,16 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
|
|||
}
|
||||
|
||||
Widget buildKeyboard() {
|
||||
if (defaultTargetPlatform == TargetPlatform.windows)
|
||||
if (defaultTargetPlatform == TargetPlatform.windows) {
|
||||
return RawKeyboardListener(
|
||||
focusNode: FocusNode(),
|
||||
onKey: keyHandler,
|
||||
child: buildThumb(),
|
||||
);
|
||||
else
|
||||
} else {
|
||||
return buildThumb();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Widget buildThumb() => Container(
|
||||
|
@ -188,26 +190,27 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
|
|||
|
||||
void keyHandler(RawKeyEvent value) {
|
||||
if (value.runtimeType == RawKeyDownEvent) {
|
||||
if (value.logicalKey == LogicalKeyboardKey.arrowDown)
|
||||
if (value.logicalKey == LogicalKeyboardKey.arrowDown) {
|
||||
onDragUpdate(DragUpdateDetails(
|
||||
globalPosition: Offset.zero,
|
||||
delta: Offset(0, 2),
|
||||
));
|
||||
else if (value.logicalKey == LogicalKeyboardKey.arrowUp)
|
||||
} else if (value.logicalKey == LogicalKeyboardKey.arrowUp) {
|
||||
onDragUpdate(DragUpdateDetails(
|
||||
globalPosition: Offset.zero,
|
||||
delta: Offset(0, -2),
|
||||
));
|
||||
else if (value.logicalKey == LogicalKeyboardKey.pageDown)
|
||||
} else if (value.logicalKey == LogicalKeyboardKey.pageDown) {
|
||||
onDragUpdate(DragUpdateDetails(
|
||||
globalPosition: Offset.zero,
|
||||
delta: Offset(0, 25),
|
||||
));
|
||||
else if (value.logicalKey == LogicalKeyboardKey.pageUp)
|
||||
} else if (value.logicalKey == LogicalKeyboardKey.pageUp) {
|
||||
onDragUpdate(DragUpdateDetails(
|
||||
globalPosition: Offset.zero,
|
||||
delta: Offset(0, -25),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,12 +105,15 @@ class HugeListViewState<T> extends State<HugeListView<T>> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (error != null && widget.errorBuilder != null)
|
||||
if (error != null && widget.errorBuilder != null) {
|
||||
return widget.errorBuilder(context, error);
|
||||
if (widget.totalCount == -1 && widget.waitBuilder != null)
|
||||
}
|
||||
if (widget.totalCount == -1 && widget.waitBuilder != null) {
|
||||
return widget.waitBuilder(context);
|
||||
if (widget.totalCount == 0 && widget.emptyResultBuilder != null)
|
||||
}
|
||||
if (widget.totalCount == 0 && widget.emptyResultBuilder != null) {
|
||||
return widget.emptyResultBuilder(context);
|
||||
}
|
||||
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
|
|
|
@ -329,10 +329,11 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
|
|||
.value;
|
||||
|
||||
_expanded = !widget.active;
|
||||
if (_expanded)
|
||||
if (_expanded) {
|
||||
expandController.reverse();
|
||||
else
|
||||
} else {
|
||||
expandController.forward();
|
||||
}
|
||||
|
||||
Widget icon = widget.leading ??
|
||||
Icon(
|
||||
|
|
|
@ -141,8 +141,9 @@ class _VideoControlsState extends State<VideoControls> {
|
|||
setState(() {
|
||||
_hideStuff = true;
|
||||
});
|
||||
} else
|
||||
} else {
|
||||
_cancelAndRestartTimer();
|
||||
}
|
||||
} else {
|
||||
_playPause();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue