Skip to content

Commit

Permalink
Commit from GitHub Actions (Forui Presubmit)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Nov 11, 2024
1 parent 842e240 commit f1c3589
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
8 changes: 5 additions & 3 deletions forui/lib/src/foundation/focused_outline.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/foundation.dart';
import 'package:forui/forui.dart';

import 'package:meta/meta.dart';

import 'package:forui/forui.dart';

/// An outline around a focused widget that does not affect its layout.
///
/// See:
Expand Down Expand Up @@ -127,7 +129,7 @@ class FFocusedOutlineStyle with Diagnosticable {
required this.borderRadius,
this.width = 1,
this.spacing = 3,
}) : assert(0 < width, 'The width must be greater than 0.');
}) : assert(0 < width, 'The width must be greater than 0.');

/// Returns a copy of this style with the given properties replaced.
@useResult
Expand Down
1 change: 0 additions & 1 deletion forui/lib/src/foundation/tappable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ class _FTappableState extends State<FTappable> {
bool _hovered = false;
bool _touched = false;


@override
void initState() {
super.initState();
Expand Down
75 changes: 37 additions & 38 deletions forui/lib/src/widgets/resizable/divider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,49 +183,48 @@ class _VerticalDividerState extends State<VerticalDivider> {

@override
Widget build(BuildContext context) => Positioned(
top: widget.controller.regions[widget.left].offset.max - (widget.hitRegionExtent / 2),
child: widget.focusableActionDetector(
shortcuts: const {
SingleActivator(LogicalKeyboardKey.arrowUp): _Up(),
SingleActivator(LogicalKeyboardKey.arrowDown): _Down(),
},
onFocusChange: (focused) => setState(() => _focused = focused),
focused: _focused,
children: [
if (widget.type == FResizableDivider.divider || widget.type == FResizableDivider.dividerWithThumb)
ColoredBox(
color: widget.style.color,
child: SizedBox(
height: widget.style.width,
top: widget.controller.regions[widget.left].offset.max - (widget.hitRegionExtent / 2),
child: widget.focusableActionDetector(
shortcuts: const {
SingleActivator(LogicalKeyboardKey.arrowUp): _Up(),
SingleActivator(LogicalKeyboardKey.arrowDown): _Down(),
},
onFocusChange: (focused) => setState(() => _focused = focused),
focused: _focused,
children: [
if (widget.type == FResizableDivider.divider || widget.type == FResizableDivider.dividerWithThumb)
ColoredBox(
color: widget.style.color,
child: SizedBox(
height: widget.style.width,
width: widget.crossAxisExtent,
),
),
if (widget.type == FResizableDivider.dividerWithThumb)
_Thumb(
style: widget.style.thumbStyle,
icon: FAssets.icons.gripHorizontal,
),
SizedBox(
height: widget.hitRegionExtent,
width: widget.crossAxisExtent,
child: GestureDetector(
onVerticalDragUpdate: (details) {
if (details.delta.dy == 0.0) {
return;
}

widget.controller.update(widget.left, widget.right, details.delta.dy);
// TODO: haptic feedback
},
onVerticalDragEnd: (details) => widget.controller.end(widget.left, widget.right),
),
),
),
if (widget.type == FResizableDivider.dividerWithThumb)
_Thumb(
style: widget.style.thumbStyle,
icon: FAssets.icons.gripHorizontal,
),
SizedBox(
height: widget.hitRegionExtent,
width: widget.crossAxisExtent,
child: GestureDetector(
onVerticalDragUpdate: (details) {
if (details.delta.dy == 0.0) {
return;
}

widget.controller.update(widget.left, widget.right, details.delta.dy);
// TODO: haptic feedback
},
onVerticalDragEnd: (details) => widget.controller.end(widget.left, widget.right),
),
],
),
],
),
);
);
}


class _Thumb extends StatelessWidget {
final FResizableDividerThumbStyle style;
final SvgAsset icon;
Expand Down
2 changes: 1 addition & 1 deletion forui/test/src/foundation/focused_outline_test.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// ignore_for_file: invalid_use_of_protected_member

import 'package:flutter/material.dart';

import 'package:flutter_test/flutter_test.dart';

import 'package:forui/forui.dart';

import '../test_scaffold.dart';

void main() {
Expand Down

0 comments on commit f1c3589

Please sign in to comment.