|
|
import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:sonnat/core/extensions/context_extension.dart'; import 'package:sonnat/core/extensions/string_extension.dart'; import 'package:sonnat/core/utils/app_constants.dart';
class MainItemWidget extends StatelessWidget { final String icon; final String name;
const MainItemWidget({super.key, required this.icon, required this.name});
@override Widget build(BuildContext context) { return Container( width: context.width * 93 / AppConstants.instance.appWidth, height: context.width * 95 / AppConstants.instance.appWidth, decoration: BoxDecoration( color: const Color(0xff3733A1), borderRadius: BorderRadius.circular(22), ), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ SvgPicture.asset( icon.svgPath, height: 35, width: 35, ), SizedBox(height: context.height * 8 / AppConstants.instance.appHeight), Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Text( name, style: const TextStyle( color: Colors.white, fontSize: 14, ), maxLines: 1, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, ), ), ], ), ); } }
|