Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 当我改变文本的字体大小时,圆圈边距也在改变,为什么会发生这种情况?_Flutter - Fatal编程技术网

Flutter 当我改变文本的字体大小时,圆圈边距也在改变,为什么会发生这种情况?

Flutter 当我改变文本的字体大小时,圆圈边距也在改变,为什么会发生这种情况?,flutter,Flutter,当我改变文本的字体大小时,圆圈边距也在改变,为什么会发生这种情况 代码: home: Scaffold( backgroundColor: Colors.teal, body: SafeArea( child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ CircleAvatar(

当我改变文本的字体大小时,圆圈边距也在改变,为什么会发生这种情况

代码:

 home: Scaffold(
      backgroundColor: Colors.teal,
      body: SafeArea(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,

          children: [
            CircleAvatar(
              radius: 50.0,
              backgroundImage: AssetImage('images/pic.jpg'),
            ),
            Text(
              'michael scofield',
              style: TextStyle(
                fontFamily: 'pacifico',
                fontSize: 40.0,
                color: Colors.white,
                fontWeight: FontWeight.bold,
              ),
            ),
          ],
        ),
      ),
    )

这是因为您没有使用crossAxisAlignment。它被自动设置为默认中心。使用以下代码将其设置为向左对齐

Scaffold(
          backgroundColor: Colors.teal,
          body: SafeArea(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                CircleAvatar(
                  radius: 50.0,
                  backgroundImage: AssetImage('images/pic.jpg'),
                ),
                Text(
                  'michael scofield',
                  style: TextStyle(
                    fontFamily: 'pacifico',
                    fontSize: 60.0,
                    color: Colors.white,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ],
            ),
          ),
        )

这是因为您没有使用crossAxisAlignment。它被自动设置为默认中心。使用以下代码将其设置为向左对齐

Scaffold(
          backgroundColor: Colors.teal,
          body: SafeArea(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                CircleAvatar(
                  radius: 50.0,
                  backgroundImage: AssetImage('images/pic.jpg'),
                ),
                Text(
                  'michael scofield',
                  style: TextStyle(
                    fontFamily: 'pacifico',
                    fontSize: 60.0,
                    color: Colors.white,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ],
            ),
          ),
        )

请添加一些上下文来解释代码部分(或者检查您是否将所有问题都错误地格式化为代码)。当我尝试post code.its时显示此错误?这真的让我很沮丧。请告诉我wqhat是否可以添加一些上下文来解释代码部分(或者检查您是否将所有问题的格式都错误地设置为代码)。当我尝试post code.its时显示此错误?这真让我失望。请告诉我怎么办