Flutter align button to bottom of Drawer

后端 未结 6 604
慢半拍i
慢半拍i 2021-02-03 21:29

I\'m trying to have a Widget align to the bottom of my NavDrawer while still keeping a DrawerHeader and a list at the top of the Drawer. Here\'s what I\'m trying:



        
6条回答
  •  一个人的身影
    2021-02-03 22:23

    here is my solution of a vertical Row with icons in the end of the drawer.

    @override
      Widget build(BuildContext context) {
        return Drawer(
          child: Column(
            children: [
              Expanded(
                child: ListView(
                  children: [
                    DrawerHeader(
                      padding: const EdgeInsets.all(7),
                      decoration: BoxDecoration(
                        color: AppColors.menuHeaderColor,
                      ),
                      child: buildHeader(),
                    ),
                    AccountDrawerRow(),
                    ListTile(
                      leading: Icon(Icons.directions_car),
                      title: Text(translations.button.vehicles),
                    ),
                    ListTile(
                      leading: Icon(Icons.calendar_today),
                      title: Text(translations.button.appointments,),
                    ),
                  ],
                ),
              ),
              Container(
                child: Align(
                  alignment: FractionalOffset.bottomCenter,
                  child: Container(
                    padding: EdgeInsets.all(15.0),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceAround,
                      children: [
                        InkWell(
                            onTap: () => Navigator.of(context).push(MaterialPageRoute(
                                builder: (context) => SettingsPage())),
                            child: Icon(Icons.settings)),
                        Icon(Icons.help),
                        Icon(Icons.info),
                      ],
                    ),
                  ),
                ),
              ),
            ],
          ),
        );
      }
    

提交回复
热议问题