setting_list_element.dart 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. class SettingListElement extends StatelessWidget {
  4. final Widget leading;
  5. final List<Widget>? actions;
  6. final VoidCallback? onTap;
  7. const SettingListElement({super.key, required this.leading, this.actions, this.onTap});
  8. @override
  9. Widget build(BuildContext context) {
  10. final style1 = (context.textTheme.titleLarge ?? const TextStyle())
  11. .copyWith(fontSize: 17.42, color: const Color(0xff333333));
  12. final style2 = style1.copyWith(fontSize: 15.24, color: const Color(0xff818181));
  13. return GestureDetector(
  14. onTap: onTap,
  15. child: Container(
  16. margin: const EdgeInsets.only(top: 7),
  17. color: Colors.white,
  18. height: 74,
  19. width: context.width,
  20. child: (actions ?? []).isEmpty
  21. ? Center(
  22. child: DefaultTextStyle(style: style1, child: leading),
  23. )
  24. : Padding(
  25. padding: const EdgeInsets.only(left: 33.76, right: 29.65),
  26. child: Row(
  27. crossAxisAlignment: CrossAxisAlignment.center,
  28. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  29. children: [
  30. DefaultTextStyle(style: style1, child: leading),
  31. DefaultTextStyle(style: style2, child: Row(
  32. crossAxisAlignment: CrossAxisAlignment.center,
  33. mainAxisSize: MainAxisSize.min,
  34. children: actions!,
  35. ))
  36. ],
  37. ))),
  38. );
  39. }
  40. }
  41. const _secondColor = Color(0xffc6c6c6);
  42. class SettingsRightArrow extends StatelessWidget {
  43. const SettingsRightArrow({super.key});
  44. @override
  45. Widget build(BuildContext context) {
  46. return const Icon(Icons.arrow_forward_ios,size: 20, color: _secondColor);
  47. }
  48. }