keyboard_top_button.dart 1.5 KB

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