Hello can someone help me with this. I try to code(on the image)
I am not sure if i should use cardbox or container here or anyother widget
import 'package:flutter/material.dart';
class AppHome extends StatefulWidget {
const AppHome({super.key});
@override
State<AppHome> createState() => _AppHomeState();
}
class _AppHomeState extends State<AppHome> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Center(child: Text('Cats')),
backgroundColor: Color(0xFF002804),
),
body: Container(
height: 300,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/1.jpg'),
fit: BoxFit.fill,
),
shape: BoxShape.rectangle,
),
));
}
}
2
Answers
I don’t understand correctly what you mean but if you’re talking about making something similar you can try this:
Or if you’re talking about the rendered image not fitting you can just add a width to your container like:
As per your provided image I have try below code and getting the provided image result, just change your image with my
Result: