mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
SP-1661-fe-enhance-the-landing-page-to-be-responsive-and-look-like-design_again (#266)
<!-- Thanks for contributing! Provide a description of your changes below and a general summary in the title Please look at the following checklist to ensure that your PR can be accepted quickly: --> ## Jira Ticket [sp:1661](https://syncrow.atlassian.net/browse/SP-1661) ## Description enhance UI in landing page ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [ ] ✨ New feature (non-breaking change which adds functionality) - [x] 🛠️ Bug fix (non-breaking change which fixes an issue) - [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🧹 Code refactor - [ ] ✅ Build configuration change - [ ] 📝 Documentation - [ ] 🗑️ Chore
This commit is contained in:
@ -34,17 +34,9 @@ class HomeCard extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Flexible(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Text(
|
||||
name,
|
||||
style: const TextStyle(
|
||||
fontSize: 30,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: SpliteNameHelperWidget(
|
||||
name: name,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -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,
|
||||
// ),
|
||||
// )
|
||||
|
@ -92,7 +92,7 @@ class _HomeWebPageState extends State<HomeWebPage> {
|
||||
flex: 4,
|
||||
child: SizedBox(
|
||||
height: size.height * 0.6,
|
||||
width: size.width * 0.68,
|
||||
width: size.width * 0.8,
|
||||
child: GridView.builder(
|
||||
itemCount: homeBloc.homeItems.length,
|
||||
gridDelegate:
|
||||
|
Reference in New Issue
Block a user