How to create Gradient background for AppBar in Flutter

 How to create Gradient background for AppBar in Flutter

new Scaffold(
      appBar: AppBar(
        title: Center(child: Text('Gradient AppBar')),
        flexibleSpace: Container(
          decoration: new BoxDecoration(
            gradient: new LinearGradient(
                colors: [
                  const Color(0xFF3366FF),
                  const Color(0xFF00CCFF),
                ],
                begin: const FractionalOffset(0.0, 0.0),
                end: const FractionalOffset(1.0, 0.0),
                stops: [0.0, 1.0],
                tileMode: TileMode.clamp),
          ),
        ),
      ),
      body: ...,
    );

 


Subscribe For Daily Updates

Flutter Questions
Android Questions