Sonnat Project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_svg/flutter_svg.dart';
  3. import 'package:sonnat/core/extensions/context_extension.dart';
  4. import 'package:sonnat/core/extensions/string_extension.dart';
  5. import 'package:sonnat/core/utils/app_constants.dart';
  6. class MainItemWidget extends StatelessWidget {
  7. final String icon;
  8. final String name;
  9. const MainItemWidget({super.key, required this.icon, required this.name});
  10. @override
  11. Widget build(BuildContext context) {
  12. return Container(
  13. width: context.width * 93 / AppConstants.instance.appWidth,
  14. height: context.width * 95 / AppConstants.instance.appWidth,
  15. decoration: BoxDecoration(
  16. color: const Color(0xff3733A1),
  17. borderRadius: BorderRadius.circular(22),
  18. ),
  19. child: Column(
  20. mainAxisAlignment: MainAxisAlignment.center,
  21. children: [
  22. SvgPicture.asset(
  23. icon.svgPath,
  24. height: 35,
  25. width: 35,
  26. ),
  27. SizedBox(height: context.height * 8 / AppConstants.instance.appHeight),
  28. Padding(
  29. padding: const EdgeInsets.symmetric(horizontal: 16),
  30. child: Text(
  31. name,
  32. style: const TextStyle(
  33. color: Colors.white,
  34. fontSize: 14,
  35. ),
  36. maxLines: 1,
  37. overflow: TextOverflow.ellipsis,
  38. textAlign: TextAlign.center,
  39. ),
  40. ),
  41. ],
  42. ),
  43. );
  44. }
  45. }