enhance it Done and yazan has watched it

This commit is contained in:
raf-dev1
2025-06-18 12:49:58 +03:00
parent f5500dfe50
commit e942957a47
2 changed files with 73 additions and 12 deletions

View File

@ -34,17 +34,9 @@ class HomeCard extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Flexible( Expanded(
child: FittedBox( child: SpliteNameHelperWidget(
fit: BoxFit.scaleDown, name: name,
child: Text(
name,
style: const TextStyle(
fontSize: 30,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
), ),
), ),
], ],
@ -63,3 +55,72 @@ class HomeCard extends StatelessWidget {
); );
} }
} }
class SpliteNameHelperWidget extends StatelessWidget {
final String name;
const SpliteNameHelperWidget({
super.key,
required this.name,
});
@override
Widget build(BuildContext context) {
List<String> parts = name.split(' ');
if (parts.length == 2) {
// Two-word string
return Padding(
padding: const EdgeInsetsGeometry.only(top: 10, left: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
parts[0],
style: const TextStyle(
fontSize: 30,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
Expanded(
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
parts[1],
style: const TextStyle(
fontSize: 30,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
);
} else {
// One-word string
return Text(
name,
style: const TextStyle(
fontSize: 30,
color: Colors.white,
fontWeight: FontWeight.bold,
),
);
}
}
}
// Text(
// name,
// style: const TextStyle(
// fontSize: 32,
// color: Colors.white,
// fontWeight: FontWeight.bold,
// ),
// )

View File

@ -92,7 +92,7 @@ class _HomeWebPageState extends State<HomeWebPage> {
flex: 4, flex: 4,
child: SizedBox( child: SizedBox(
height: size.height * 0.6, height: size.height * 0.6,
width: size.width * 0.68, width: size.width * 0.8,
child: GridView.builder( child: GridView.builder(
itemCount: homeBloc.homeItems.length, itemCount: homeBloc.homeItems.length,
gridDelegate: gridDelegate: