Как добавить Тень за Картой во Флаттере? - PullRequest
1 голос
/ 28 апреля 2020

Я пытаюсь получить тень, подобную этой,

enter image description here

Это моя попытка, но она не работает:

 SliverPadding(
            padding: const EdgeInsets.only(top: 20, left: 10, right: 10),
            sliver: SliverToBoxAdapter(
              child: ClipRRect(
                borderRadius: BorderRadius.all(Radius.circular(10.0)),
                child: Stack(
                  children: <Widget>[
                    Container(
                      decoration: BoxDecoration(
                        boxShadow: [
                          BoxShadow(
                            color: Colors.red,
                            blurRadius:
                                20.0, // has the effect of softening the shadow
                            spreadRadius:
                                5.0, // has the effect of extending the shadow
                            offset: Offset(
                              20.0, // horizontal, move right 10
                              100.0, // vertical, move down 10
                            ),
                          )
                        ],
                        color: Colors.black,
                      ),
                      height: 150,
                      width: MediaQuery.of(context).size.width,
                      child: Align(
                          alignment: Alignment.bottomRight,
                          child: Padding(
                            padding: const EdgeInsets.all(18.0),
                            child: Container(
                                child: Center(
                                  child: Text(
                                    'Withdraw Money',
                                    style: khomeStyle.copyWith(
                                      fontSize: 18,
                                      color: kWhite,
                                    ),
                                  ),
                                ),
                                decoration: BoxDecoration(
                                    color: Colors.red,
                                    borderRadius: BorderRadius.all(
                                        Radius.circular(14.0))),
                                height: 30,
                                width: 130),
                          )),
                    ),
                    //Container(height: 90, color: Colors.red),
                  ],
                ),
              ),
            ),
          );

Я не могу понять, почему это не работает, и вся тень идет за моей Stack. Надеясь, что кто-то может помочь мне с этой проблемой, я не мог найти решение в другом месте.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...