import 'package:flutter/material.dart';
class SiginupPage extends StatefulWidget {
const SiginupPage({super.key});
@override
State<SiginupPage> createState() => _SiginupPageState();
}
class _SiginupPageState extends State<SiginupPage> {
@override
Widget build(BuildContext context) {
return SafeArea(child: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height,
padding: const EdgeInsets.symmetric(horizontal: 30,vertical: 30),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
'Get Started',
style: TextStyle(fontWeight: FontWeight.bold,fontSize: 40),
),
const SizedBox(height: 30,),
Text('Hey lets get started with this journey to development',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey[700],
fontSize: 15
),
),
],
),
Container(
height: MediaQuery.of(context).size.height/3,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('lib/assets/image/1stbg.png')
),
),
)
],
),
));
}
}
Why my output have no Image and heading in all red with double yellow underline along with black background ?i want it to appear with all default background with default color of heading with no underline and my image must render
3
Answers
Because you don’t have a Material widget as a parent. Wrap it inside a Scaffold or a Material widget for the correct styling.
Wrap your
Container
withScaffold
You must use a
Scaffold
widget on top of your widget tree to apply the Material theme to your child widgets.