mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
@ -34,9 +34,17 @@ class HomeCard extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: SpliteNameHelperWidget(
|
||||
name: name,
|
||||
Flexible(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text(
|
||||
name,
|
||||
style: const TextStyle(
|
||||
fontSize: 30,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -55,72 +63,3 @@ 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,
|
||||
// ),
|
||||
// )
|
||||
|
@ -92,7 +92,7 @@ class _HomeWebPageState extends State<HomeWebPage> {
|
||||
flex: 4,
|
||||
child: SizedBox(
|
||||
height: size.height * 0.6,
|
||||
width: size.width * 0.8,
|
||||
width: size.width * 0.68,
|
||||
child: GridView.builder(
|
||||
itemCount: homeBloc.homeItems.length,
|
||||
gridDelegate:
|
||||
|
Reference in New Issue
Block a user