-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsheet_handle.dart
More file actions
31 lines (28 loc) · 1.05 KB
/
Copy pathsheet_handle.dart
File metadata and controls
31 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import 'package:flutter/material.dart';
/// Drag handle shown at the top of every modal bottom sheet in this app
/// (filter sheets, festival selector, settings, theme selector).
///
/// [handleKey] is applied to the inner [Container] rather than to this widget,
/// so callers that key the drag handle for tests keep finding a [Container]
/// with that key — matching the pre-refactor widget tree, where the key lived
/// directly on the hand-rolled `Container`. Keying the widget itself via [key]
/// remains available and behaves normally.
class SheetHandle extends StatelessWidget {
const SheetHandle({this.handleKey, super.key});
/// Key applied to the inner container, for tests locating the handle.
final Key? handleKey;
@override
Widget build(BuildContext context) {
return Center(
child: Container(
key: handleKey,
width: 32,
height: 4,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.onSurfaceVariant,
borderRadius: BorderRadius.circular(2),
),
),
);
}
}