Флаттер с прозрачным фоном - PullRequest
0 голосов
/ 12 апреля 2019

Я пытаюсь сделать свою карту прозрачной, чтобы показать объект в фоновом режиме.

Я пытался установить свойство цвета карты на прозрачный, но это серый фон с непрозрачностью.

Result

Я также пытаюсь использовать белый цвет с различной непрозрачностью, но в результате получается не чистый белый цвет с прозрачным.

   Card(
      color: Colors.transparent,
      child: Padding(
        padding: const EdgeInsets.all(16),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            CardLabelSmall("Current Premix Plan Document"),
            Expanded(child: PremixPlanDocList()),
            Row(
              children: <Widget>[
                Expanded(
                  child: RaisedButton(
                    onPressed: () async {
                      homeBloc.retrieveCurrentMrfPremixPlan();
                    },
                    child: const Text("Retrieve Premix Plan"),
                  ),
                ),
              ],
            ),
          ],
        ),
      ),
    );

другой белый цвет, но все жесовсем не белый

color: Colors.white70,
color: Colors.white54,
color: Colors.white30,

Как мне добиться чистого белого фона с прозрачным?

Ответы [ 2 ]

1 голос
/ 12 апреля 2019

попробуйте установить elevation в 0, оно должно работать

Card(
      elevation: 0,
      color: Colors.transparent,
      child: Padding(
        padding: const EdgeInsets.all(16),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            CardLabelSmall("Current Premix Plan Document"),
            Expanded(child: PremixPlanDocList()),
            Row(
              children: <Widget>[
                Expanded(
                  child: RaisedButton(
                    onPressed: () async {
                      homeBloc.retrieveCurrentMrfPremixPlan();
                    },
                    child: const Text("Retrieve Premix Plan"),
                  ),
                ),
              ],
            ),
          ],
        ),
      ),
    );
0 голосов
/ 12 апреля 2019

Вы можете попробовать что-то вроде этого.

  new Container(
                height: 300.0,
                color: Colors.blue,
                child: new Card(
                    color: Colors.transparent,
                    child: new Center(
                      child: new Text("Hi modal sheet"),
                    )),
              ),

enter image description here

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