简体   繁体   English

如何使图标在颤动时从容器中取出

[英]how to make a icon get out from container on flutter

Hi guys i'm try to make this on flutter: img大家好,我正在尝试在颤振上做这个: img

i'm try with that code, but work我正在尝试使用该代码,但是可以工作

    Container(
      child: Positioned(top:0, left:0)
    )```

as an option you can use Stack as container for card widget + image作为选项,您可以使用Stack作为卡片小部件 + 图像的容器

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Stack(
            children: <Widget>[
              Card(
                color: Colors.blueAccent,
                child: Container(
                  width: 300,
                  height: 80,
                ),
              ),
              FractionalTranslation(
                translation: Offset(0, -0.5),
                child: Icon(Icons.android, size: 48),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM