mirror of
https://github.com/koloideal/Casha.git
synced 2026-08-08 17:51:14 +03:00
step
This commit is contained in:
@@ -226,32 +226,6 @@ class _AccountEditorOverlayState extends State<AccountEditorOverlay> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: cardTop - 28,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Center(
|
||||
child: _HeightHandle(
|
||||
onDrag: (delta) {
|
||||
final newHeight = cardHeight - delta * 2;
|
||||
ref.read(cardHeightProvider.notifier).set(newHeight);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: cardTop + cardHeight + 6,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Center(
|
||||
child: _HeightHandle(
|
||||
onDrag: (delta) {
|
||||
final newHeight = cardHeight + delta * 2;
|
||||
ref.read(cardHeightProvider.notifier).set(newHeight);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: editorPanelTop,
|
||||
left: 20,
|
||||
@@ -495,36 +469,3 @@ class _AccountEditorOverlayState extends State<AccountEditorOverlay> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _HeightHandle extends StatefulWidget {
|
||||
final ValueChanged<double> onDrag;
|
||||
|
||||
const _HeightHandle({required this.onDrag});
|
||||
|
||||
@override
|
||||
State<_HeightHandle> createState() => _HeightHandleState();
|
||||
}
|
||||
|
||||
class _HeightHandleState extends State<_HeightHandle> {
|
||||
bool _active = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return GestureDetector(
|
||||
onVerticalDragStart: (_) => setState(() => _active = true),
|
||||
onVerticalDragUpdate: (details) => widget.onDrag(details.delta.dy),
|
||||
onVerticalDragEnd: (_) => setState(() => _active = false),
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 150),
|
||||
width: _active ? 56 : 44,
|
||||
height: _active ? 6 : 4,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.onSurface.withOpacity(_active ? 0.5 : 0.25),
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user