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')
),
),
)
],
),
));
}
}
enter image description here
为什么我的输出没有图像和标题在所有红色与双黄下划线沿着与黑色背景?我希望它出现与所有默认背景与标题的默认颜色没有下划线,我的图像必须呈现
3条答案
按热度按时间9nvpjoqh1#
因为你没有一个材质部件作为父部件。将其包裹在脚手架或材质构件中以获得正确的样式。
cyvaqqii2#
用
Scaffold
Package 您的Container
4ktjp1zp3#
您必须在小部件树的顶部使用
Scaffold
小部件来将Material主题应用到子小部件。