control_bottom_app_bar.dart 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import 'package:flutter/material.dart';
  2. import 'package:immich_mobile/modules/home/ui/delete_diaglog.dart';
  3. class ControlBottomAppBar extends StatelessWidget {
  4. const ControlBottomAppBar({Key? key}) : super(key: key);
  5. @override
  6. Widget build(BuildContext context) {
  7. return Positioned(
  8. bottom: 0,
  9. left: 0,
  10. child: Container(
  11. width: MediaQuery.of(context).size.width,
  12. height: MediaQuery.of(context).size.height * 0.15,
  13. decoration: BoxDecoration(
  14. borderRadius: const BorderRadius.only(
  15. topLeft: Radius.circular(15), topRight: Radius.circular(15)),
  16. color: Colors.grey[300]?.withOpacity(0.98),
  17. ),
  18. child: Column(
  19. children: [
  20. Padding(
  21. padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
  22. child: Row(
  23. mainAxisAlignment: MainAxisAlignment.center,
  24. children: [
  25. ControlBoxButton(
  26. iconData: Icons.delete_forever_rounded,
  27. label: "Delete",
  28. onPressed: () {
  29. showDialog(
  30. context: context,
  31. builder: (BuildContext context) {
  32. return const DeleteDialog();
  33. },
  34. );
  35. },
  36. ),
  37. ],
  38. ),
  39. )
  40. ],
  41. ),
  42. ),
  43. );
  44. }
  45. }
  46. class ControlBoxButton extends StatelessWidget {
  47. const ControlBoxButton(
  48. {Key? key,
  49. required this.label,
  50. required this.iconData,
  51. required this.onPressed})
  52. : super(key: key);
  53. final String label;
  54. final IconData iconData;
  55. final Function onPressed;
  56. @override
  57. Widget build(BuildContext context) {
  58. return SizedBox(
  59. width: 60,
  60. child: Column(
  61. mainAxisAlignment: MainAxisAlignment.start,
  62. crossAxisAlignment: CrossAxisAlignment.start,
  63. children: [
  64. IconButton(
  65. onPressed: () {
  66. onPressed();
  67. },
  68. icon: Icon(iconData, size: 30),
  69. ),
  70. Text(label)
  71. ],
  72. ),
  73. );
  74. }
  75. }