privacy_agreement.dart 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import 'package:flutter/gestures.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import 'package:get/get.dart';
  5. import 'package:nomo/config/theme/theme_extensions/theme_extension.dart';
  6. import '../../utils/system_helper.dart';
  7. import '../../config/translations/strings_enum.dart';
  8. class PrivacyAgreement extends StatelessWidget {
  9. // final VoidCallback? onTermsTap;
  10. // final VoidCallback? onPrivacyTap;
  11. final double? fontSize;
  12. final Color? textColor;
  13. final Color? linkColor;
  14. final double? height;
  15. final EdgeInsetsGeometry? padding;
  16. const PrivacyAgreement({
  17. super.key,
  18. // this.onTermsTap,
  19. // this.onPrivacyTap,
  20. this.fontSize,
  21. this.textColor,
  22. this.linkColor,
  23. this.height,
  24. this.padding,
  25. });
  26. @override
  27. Widget build(BuildContext context) {
  28. return Padding(
  29. padding: padding ?? EdgeInsets.symmetric(horizontal: 50.w),
  30. child: Text.rich(
  31. TextSpan(
  32. children: [
  33. TextSpan(
  34. text: Strings.termsAgreementPrefix.tr,
  35. style: TextStyle(
  36. color: textColor ?? Get.reactiveTheme.hintColor,
  37. fontSize: fontSize ?? 12.sp,
  38. height: height ?? 1.5,
  39. ),
  40. ),
  41. TextSpan(
  42. text: Strings.terms.tr,
  43. style: TextStyle(
  44. color: linkColor ?? Colors.white,
  45. fontSize: fontSize ?? 12.sp,
  46. height: height ?? 1.5,
  47. fontWeight: FontWeight.w500,
  48. ),
  49. recognizer: TapGestureRecognizer()
  50. ..onTap = SystemHelper.openTermsOfService,
  51. ),
  52. TextSpan(
  53. text: Strings.termsAgreementConnector.tr,
  54. style: TextStyle(
  55. color: textColor ?? Get.reactiveTheme.hintColor,
  56. fontSize: fontSize ?? 12.sp,
  57. height: height ?? 1.5,
  58. ),
  59. ),
  60. TextSpan(
  61. text: Strings.privacy.tr,
  62. style: TextStyle(
  63. color: linkColor ?? Colors.white,
  64. fontSize: fontSize ?? 12.sp,
  65. height: height ?? 1.5,
  66. fontWeight: FontWeight.w500,
  67. ),
  68. recognizer: TapGestureRecognizer()
  69. ..onTap = SystemHelper.openPrivacyTerms,
  70. ),
  71. ],
  72. ),
  73. textAlign: TextAlign.center,
  74. ),
  75. );
  76. }
  77. }