What I want to achieve is the following image:
I tried resizing the appbar but it didn’t work:
appBar: PreferredSize( preferredSize: Size.fromHeight(60.0), child: Container( margin: EdgeInsets.all(8.0), child: AppBar( title: Text('Login'), ), ), ),
2
Try like this:
appBar: PreferredSize( preferredSize: const Size.fromHeight(60.0), child: ClipRRect( borderRadius: const BorderRadius.vertical( bottom: Radius.circular(50), ), child: AppBar( title: const Text('Login'), backgroundColor: Colors.red, ), ), )
Result:
Try below code:
Using AppBar: AppBar
appBar: AppBar( backgroundColor: Colors.orangeAccent, centerTitle: true, title: Text('Appoinments'), leading: IconButton( onPressed: () {}, icon: Icon(Icons.menu), ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( bottom: Radius.circular(30), ), ), actions: [ IconButton( onPressed: () {}, icon: Icon(Icons.date_range), ), ], ),
Using PreferredSize: PreferredSize
appBar: PreferredSize( preferredSize: const Size.fromHeight(50.0), child: ClipRRect( borderRadius: const BorderRadius.vertical( bottom: Radius.circular(30), ), child: AppBar( backgroundColor: Colors.orangeAccent, centerTitle: true, title: Text('Appoinments'), leading: IconButton( onPressed: () {}, icon: Icon(Icons.menu), ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( bottom: Radius.circular(30), ), ), actions: [ IconButton( onPressed: () {}, icon: Icon(Icons.date_range), ), ], ), ), ),
Click here to cancel reply.
2
Answers
Try like this:
Result:
Try below code:
Using AppBar: AppBar
Result:
Using PreferredSize: PreferredSize