control_bottom_app_bar.dart 2.3 KB

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