How to make Floating Action Button background Gradient?

后端 未结 7 2055
长情又很酷
长情又很酷 2020-12-30 12:00

The code for FAB:



        
7条回答
  •  天涯浪人
    2020-12-30 12:31

    floatingActionButton: FloatingActionButton(
        child: Container(
            width: double.infinity,
            height: double.infinity,
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(30),
              gradient: LinearGradient(
                  begin: Alignment.bottomLeft,
                  end: Alignment.topRight,
                  colors: [
                    Color.fromRGBO(55, 59, 68, 1),
                    Color.fromRGBO(66, 134, 244, 1)
                  ]),
            ),
            child: Icon(Icons.add)),
        onPressed: () => _startAddNewTransaction(context),
      ),
    

    Here is the image of the FloatingActionButton

提交回复
热议问题