Here is my code. and the design i am trying to code. I did it with lots of padding but I am looking for better solutions. Can anyone help me to complete the spacing here? with image and other companens same as the picture? Text font sizes etc. Is not important but spacing with other widgets where i am having problems
import 'package:flutter/material.dart';
class MainPage extends StatefulWidget {
const MainPage({super.key});
@override
State<MainPage> createState() => _MainPageState();
}
class _MainPageState extends State<MainPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar(backgroundColor: Colors.transparent),
body: Column(
children: [
Image.asset(
'images/cat.jpg',
fit: BoxFit.fill,
),
Text('Cats are beautiful'),
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore us vel facilisis. '),
ElevatedButton(
child: Text('Next'),
onPressed: () {},
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
),
backgroundColor: Colors.black,
foregroundColor: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 40, vertical: 20),
textStyle:
TextStyle(fontSize: 16, fontWeight: FontWeight.normal)),
),
],
),
);
}
}
2
Answers
Try this and update the fonts, expected margins and colors