control_bottom_app_bar.dart 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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), topRight: Radius.circular(15)),
  17. color: Colors.grey[300]?.withOpacity(0.98),
  18. ),
  19. child: Column(
  20. children: [
  21. Padding(
  22. padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
  23. child: Row(
  24. mainAxisAlignment: MainAxisAlignment.center,
  25. children: [
  26. ControlBoxButton(
  27. iconData: Icons.delete_forever_rounded,
  28. label: "control_bottom_app_bar_delete".tr(),
  29. onPressed: () {
  30. showDialog(
  31. context: context,
  32. builder: (BuildContext context) {
  33. return const DeleteDialog();
  34. },
  35. );
  36. },
  37. ),
  38. ],
  39. ),
  40. )
  41. ],
  42. ),
  43. ),
  44. );
  45. }
  46. }
  47. class ControlBoxButton extends StatelessWidget {
  48. const ControlBoxButton(
  49. {Key? key,
  50. required this.label,
  51. required this.iconData,
  52. required this.onPressed})
  53. : super(key: key);
  54. final String label;
  55. final IconData iconData;
  56. final Function onPressed;
  57. @override
  58. Widget build(BuildContext context) {
  59. return SizedBox(
  60. width: 60,
  61. child: Column(
  62. mainAxisAlignment: MainAxisAlignment.start,
  63. crossAxisAlignment: CrossAxisAlignment.start,
  64. children: [
  65. IconButton(
  66. onPressed: () {
  67. onPressed();
  68. },
  69. icon: Icon(iconData, size: 30),
  70. ),
  71. Text(label)
  72. ],
  73. ),
  74. );
  75. }
  76. }