颤振:图像按钮被圈出

时间:2018-10-25 14:52:32

标签: flutter

image description here

我想将3个图像按钮集中在屏幕上,一个在另一个的顶部,每个按钮都按下,这是我的起始代码。

class Escolha extends StatelessWidget {
 @override
  Widget build(BuildContext context) {
   return MaterialApp(     
  home: Scaffold(
    appBar: AppBar(         
    ),
    body: Material(          
     elevation: 4.0,
       shape: CircleBorder(),
      color: Colors.transparent, 
       child: Ink.image(
        image: AssetImage('assets/logotipo.png'),
         fit: BoxFit.cover,
          width: 100.0,
           height: 120.0,
            child: InkWell(
               )    
                 )  
                   )
                ),
              );
           }
         }

1 个答案:

答案 0 :(得分:1)

我制作了您在链接中提到的图像的UI。这是工作代码。

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.black,
      child: Center(
        child: Row(
          children: <Widget>[
            Expanded(
              flex: 2,
              child: Container(
                height: 2.0,
                color: Colors.greenAccent,
              ),
            ),
            Expanded(flex: 2, child: Image.asset("assets/four.png"),),
            Expanded(
              flex: 1,
              child: Container(
                height: 2.0,
                color: Colors.greenAccent,
              ),
            ),
            Expanded(flex: 2, child: Image.asset("assets/three.png"),),
            Expanded(
              flex: 1,
              child: Container(
                height: 2.0,
                color: Colors.greenAccent,
              ),
            ),
            Expanded(flex: 2, child: Image.asset("assets/two.png"),),
            Expanded(
              flex: 1,
              child: Container(
                height: 2.0,
                color: Colors.greenAccent,
              ),
            ),
            Expanded(flex: 2, child: Image.asset("assets/one.png"),),
            Expanded(
              flex: 2,
              child: Container(
                height: 2.0,
                color: Colors.greenAccent,
              ),
            ),
          ],
        ),
      ),
    );
  }
}

这是输出。

enter image description here

相关问题