ios 为什么我的输出没有图像和标题在所有红色与双黄下划线沿着与黑色背景?

flseospp  于 2023-10-21  发布在  iOS
关注(0)|答案(3)|浏览(70)
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
为什么我的输出没有图像和标题在所有红色与双黄下划线沿着与黑色背景?我希望它出现与所有默认背景与标题的默认颜色没有下划线,我的图像必须呈现

9nvpjoqh

9nvpjoqh1#

因为你没有一个材质部件作为父部件。将其包裹在脚手架或材质构件中以获得正确的样式。

cyvaqqii

cyvaqqii2#

Scaffold Package 您的Container

return SafeArea(child: Scaffold(child:Container(...)
4ktjp1zp

4ktjp1zp3#

您必须在小部件树的顶部使用Scaffold小部件来将Material主题应用到子小部件。

Scaffold(
      appBar: // Your Appbar
      body: Scaffold(child:Container(children: [ ... ],),),
);

相关问题