2023-01-11 22:54:12 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2024-01-15 17:26:13 +02:00
|
|
|
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
2023-01-11 22:54:12 +02:00
|
|
|
|
|
|
|
class CustomDraggingHandle extends StatelessWidget {
|
|
|
|
const CustomDraggingHandle({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
2024-01-15 17:26:13 +02:00
|
|
|
height: 4,
|
2023-01-11 22:54:12 +02:00
|
|
|
width: 30,
|
|
|
|
decoration: BoxDecoration(
|
2024-01-15 17:26:13 +02:00
|
|
|
color: context.themeData.dividerColor,
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
2023-01-11 22:54:12 +02:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class ControlBoxButton extends StatelessWidget {
|
|
|
|
const ControlBoxButton({
|
2024-01-27 18:14:32 +02:00
|
|
|
super.key,
|
2023-01-11 22:54:12 +02:00
|
|
|
required this.label,
|
|
|
|
required this.iconData,
|
2023-05-17 19:36:02 +02:00
|
|
|
this.onPressed,
|
2024-01-18 23:01:38 +02:00
|
|
|
this.onLongPressed,
|
2024-01-27 18:14:32 +02:00
|
|
|
});
|
2023-01-11 22:54:12 +02:00
|
|
|
|
|
|
|
final String label;
|
|
|
|
final IconData iconData;
|
2023-05-17 19:36:02 +02:00
|
|
|
final void Function()? onPressed;
|
2024-01-18 23:01:38 +02:00
|
|
|
final void Function()? onLongPressed;
|
2023-01-11 22:54:12 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialButton(
|
|
|
|
padding: const EdgeInsets.all(10),
|
|
|
|
shape: const CircleBorder(),
|
2023-05-17 19:36:02 +02:00
|
|
|
onPressed: onPressed,
|
2024-01-18 23:01:38 +02:00
|
|
|
onLongPress: onLongPressed,
|
2023-11-13 18:19:51 +02:00
|
|
|
minWidth: 75.0,
|
2023-01-11 22:54:12 +02:00
|
|
|
child: Column(
|
2024-01-17 05:28:23 +02:00
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
2023-01-11 22:54:12 +02:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Icon(iconData, size: 24),
|
2024-01-17 05:28:23 +02:00
|
|
|
const SizedBox(height: 8),
|
2023-01-11 22:54:12 +02:00
|
|
|
Text(
|
|
|
|
label,
|
|
|
|
style: const TextStyle(fontSize: 12.0),
|
2024-01-17 05:28:23 +02:00
|
|
|
maxLines: 2,
|
|
|
|
textAlign: TextAlign.center,
|
2023-01-11 22:54:12 +02:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|