SliverAppBar внизу экрана (флаттер)

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


person Aquiko    schedule 09.12.2020    source источник


Ответы (2)


Кстати, я понял: D, используя это

bottomNavigationBar: BottomAppBar(
          child: Row(
            children: [
              IconButton(icon: Icon(Icons.menu), onPressed: () {}),
              Spacer(),
              IconButton(icon: Icon(Icons.search), onPressed: () {}),
              IconButton(icon: Icon(Icons.more_vert), onPressed: () {}),
            ],
          ),
        ),

внутри эшафота

Извините, я думал, что SliverAppBar такой же, как и все AppBar, NOOB здесь

person Aquiko    schedule 09.12.2020

Внутри SliverAppBar включите свойство плавающее true. Например:

CustomScrollView(
slivers: <Widget>[
 SliverAppBar(
   title: Text('Floating app bar'),
   // Allows the user to reveal the app bar if they begin scrolling back
   // up the list of items.
   floating: true,
   // Display a placeholder widget to visualize the shrinking size.
   flexibleSpace: Placeholder(),
   // Make the initial height of the SliverAppBar larger than normal.
   expandedHeight: 200,
 ),
],
);
person JahidRatul    schedule 09.12.2020
comment
Я хочу всегда показывать панель приложений, но вместо этого я хочу, чтобы она была внизу - person Aquiko; 09.12.2020