keyboard_top_button.dart 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:photos/theme/ente_theme.dart';
  4. class KeyboardTopButton extends StatelessWidget {
  5. final VoidCallback? onDoneTap;
  6. final VoidCallback? onCancelTap;
  7. final String doneText;
  8. final String cancelText;
  9. const KeyboardTopButton({
  10. super.key,
  11. this.doneText = "Done",
  12. this.cancelText = "Cancel",
  13. this.onDoneTap,
  14. this.onCancelTap,
  15. });
  16. @override
  17. Widget build(BuildContext context) {
  18. final enteTheme = getEnteTextTheme(context);
  19. final colorScheme = getEnteColorScheme(context);
  20. return Container(
  21. width: double.infinity,
  22. decoration: BoxDecoration(
  23. border: Border(
  24. top: BorderSide(width: 1.0, color: colorScheme.strokeFaint),
  25. bottom: BorderSide(width: 1.0, color: colorScheme.strokeFaint),
  26. ),
  27. color: colorScheme.backgroundElevated2,
  28. ),
  29. child: Padding(
  30. padding: const EdgeInsets.symmetric(horizontal: 10.0),
  31. child: Row(
  32. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  33. children: [
  34. CupertinoButton(
  35. padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 14),
  36. onPressed: onCancelTap,
  37. child: Text(cancelText, style: enteTheme.bodyBold),
  38. ),
  39. CupertinoButton(
  40. padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 14),
  41. onPressed: onDoneTap,
  42. child: Text(doneText, style: enteTheme.bodyBold),
  43. ),
  44. ],
  45. ),
  46. ),
  47. );
  48. }
  49. }