Трепещущий нижний лист, как Календарь Google

#flutter

#трепетание

Вопрос:

Как создать нижний лист, как календарь Google? (изображение ниже), у меня проблемы с созданием фотографий профиля, которые торчат, как на картинке. Кто-нибудь может мне помочь, спасибо..

введите описание изображения здесь

Ответ №1:

Это может быть достигнуто с помощью виджета стека

 class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: RaisedButton(
          onPressed: () {
            _settingModalBottomSheet();
          },
          child: Text('Show Bottom Sheet'),
        ),
      ),
    );
  }

  void _settingModalBottomSheet() {
    final double imageRadius = 50;
    showModalBottomSheet(
      context: context,
      backgroundColor: Colors.transparent,
      builder: (BuildContext bc) {
        return Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Stack(
              children: [
                Container(
                  margin: EdgeInsets.only(top: imageRadius),
                  padding: EdgeInsets.only(top: imageRadius),
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.only(
                      topLeft: Radius.circular(16),
                      topRight: Radius.circular(16),
                    ),
                    color: Colors.white,
                  ),
                  child: Column(
                    children: [
                      Text('asdfsdf asdfasdf'),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          IconButton(
                            icon: Icon(Icons.message),
                            onPressed: () {},
                          ),
                          SizedBox(
                            width: 16,
                          ),
                          IconButton(
                            icon: Icon(Icons.message),
                            onPressed: () {},
                          ),
                          SizedBox(
                            width: 16,
                          ),
                          IconButton(
                            icon: Icon(Icons.message),
                            onPressed: () {},
                          )
                        ],
                      ),
                    ],
                  ),
                ),
                Align(
                  alignment: Alignment.topCenter,
                  child: CircleAvatar(
                    radius: imageRadius,
                  ),
                ),
              ],
            )
          ],
        );
      },
    );
  }
}