How to create a transparent UI in flutter? - user-interface

I want to create a tranparent UI in flutter.
Can you help me with the code?
Here is the link to the stuff I need.
https://dribbble.com/shots/3958928-Wikipedia-App/attachments/904403
https://dribbble.com/shots/1081917-WhereTO-App
https://dribbble.com/shots/1539644-App-Mockup
https://dribbble.com/shots/1254375-Events-More/attachments/171069

This example my help to resolve your problem
Code Snippet
Widget build(BuildContext context) {
List list = ['Introduction','Early life', 'Non-Film work', '2012-present', 'Controversy'];
return new Container(
child: new Stack(
fit: StackFit.expand,
children: <Widget>[
new Image.asset('assets/bg_img.jpg', fit: BoxFit.fitHeight,),
new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
elevation: 0.0,
backgroundColor: const Color(0xFFB4C56C).withOpacity(0.5),
),
backgroundColor: Colors.transparent,
body: new Center(
child: new Center(
child: new BackdropFilter(
filter: new ui.ImageFilter.blur(
sigmaX: 6.0,
sigmaY: 6.0,
),
child: new Container(
margin: EdgeInsets.all(20.0),
padding: EdgeInsets.all(20.0),
decoration: BoxDecoration(
color: const Color(0xFFB4C56C).withOpacity(0.01),
borderRadius: BorderRadius.all(Radius.circular(50.0)),
),
child: new Container(child: ListView.builder(itemBuilder: (contex, index){
return index == 0?new Container(
height: 50.0,
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 12.0),
decoration: BoxDecoration(
color: const Color(0xFFB4C56C).withOpacity(0.7),
borderRadius: BorderRadius.all(Radius.circular(25.0)),
boxShadow: [new BoxShadow(color: Colors.black12,offset: new Offset(2.0, 2.0), blurRadius: 2.0 )]
),child: new Row(children: <Widget>[
new Icon(Icons.info, color: Colors.white,),
new SizedBox(width: 8.0),
new Text(list[index], style: TextStyle(color: Colors.white70, fontSize: 18.0))
],),
):new ListTile(title: new Text(list[index], style: TextStyle(color: Colors.white),), leading: new Text('${index}',
style: TextStyle(color: const Color(0xFFB4C56C), fontSize: 18.0)),);
}, itemCount: list.length,),),
),
),
),
),
)
],),
);
}
Complete source code can be dowloaded from here blue_effect

You can override PageRoute like this
import 'package:flutter/cupertino.dart';
class TransparentRoute extends PageRoute<void> {
TransparentRoute({
#required this.builder,
RouteSettings settings,
}) : assert(builder != null),
super(settings: settings, fullscreenDialog: false);
final WidgetBuilder builder;
#override
bool get opaque => false;
#override
Color get barrierColor => null;
#override
String get barrierLabel => null;
#override
bool get maintainState => true;
#override
Duration get transitionDuration => Duration(milliseconds: 350);
#override
Widget buildPage(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
final result = builder(context);
return FadeTransition(
opacity: Tween<double>(begin: 0, end: 1).animate(animation),
child: Semantics(
scopesRoute: true,
explicitChildNodes: true,
child: result,
),
);
}
}
/// And you can push like this
Navigator.of(context).push(
TransparentRoute(
builder: (BuildContext
context) =>
TransParentView()));
///New container to push
class TransParentView extends StatelessWidget {
#override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black.withOpacity(0.6),
body: Padding(
padding: const EdgeInsets.all(27.0),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(5))),
height: 700,
width: MediaQuery.of(context).size.width,
child: SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
height: 60,
),
Container(
width: 160,
height: 100,
),
Container(
height: 290,
width: 250,
),
Container(
height: 150,
),
],
),
),
),
),
);
}
}
Hope this will help.

Just surround the widget or widget tree you want to make transparent with an Opacity widget and specify the opacity value from 0.0 to 1.0
For example:
0.0 means completely invisible,
0.5 means half way transparent,
1.0 means fully visible.

Related

How to display active textfields hidden by the front panel?

I have been trying to display backdrop with searching fiture. but when I tap the textfield is hidden by front panel. how to front panel not hidden the search textfield ?
import 'package:flutter/material.dart';
import 'content_isi.dart';
class Panel extends StatefulWidget {
final AnimationController controller;
Panel({this.controller});
#override
_PanelState createState() => new _PanelState();
}
class _PanelState extends State<Panel> {
static const header_height = 200.0;
Animation<RelativeRect> getPanelAnimation(BoxConstraints constraints) {
final height = constraints.biggest.height;
final backPanelHeight = height - header_height;
final frontPanelHeight = -header_height;
return new RelativeRectTween(
begin: new RelativeRect.fromLTRB(
0.0, backPanelHeight, 0.0, frontPanelHeight),
end: new RelativeRect.fromLTRB(0.0, 0.0, 0.0, 0.0))
.animate(new CurvedAnimation(
parent: widget.controller, curve: Curves.linear));
}
Widget bothPanels(BuildContext context, BoxConstraints constraints) {
final ThemeData theme = Theme.of(context);
return new Container(
child: new Stack(
children: <Widget>[
new Container(
color: Colors.white,
child: Column(
children: <Widget>[
TextField(
decoration:
_buildInputDecoration(Icons.tune, 'Jenis Peraturan'),
),
Divider(
height: 0.0,
color: Colors.grey,
),
TextField(
decoration: _buildInputDecoration(Icons.pages, 'Nomor'),
),
Divider(
height: 0.0,
color: Colors.grey,
),
TextField(
decoration: _buildInputDecoration(Icons.pages, 'Tahun'),
),
Divider(
height: 0.0,
color: Colors.grey,
),
TextField(
decoration:
_buildInputDecoration(Icons.help_outline, 'Tentang'),
),
Container(
padding: EdgeInsets.only(left: 5.0, right: 5.0),
width: double.infinity,
child: FlatButton(
onPressed: () {},
child: Text(
'Cari',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16),
),
color: Colors.blue,
),
),
],
),
),
new PositionedTransition(
rect: getPanelAnimation(constraints),
child: new Material(
elevation: 12.0,
child: ListView(
children: <Widget>[
ContentIsi(
no: '11',
th: '2020',
jnsperaturan: 'Peraturan BBB',
judul:
'Perubahan Keempat Atas Peraturan Nomor 1 Tahun 2017 tentang Pelimpahan Kewenangan Penandatanganan Perizinan dan Non Perizinan Kepada Kepala Dinas Penanaman Modal dan Pelayanan Terpadu Satu Pintu',
onPressed: null,
)
],
),
),
)
],
),
);
}
#override
Widget build(BuildContext context) {
return new LayoutBuilder(
builder: bothPanels,
);
}
InputDecoration _buildInputDecoration(IconData icon, String hintText) {
return InputDecoration(
prefixIcon: Padding(
padding: const EdgeInsets.only(right: 32.0, left: 16.0),
child: Icon(icon),
),
hintText: hintText,
contentPadding: const EdgeInsets.symmetric(vertical: 16.0),
border: InputBorder.none,
);
}
}
I'm the beginner of flutter. so i hope you can help me about it.
the gif image in the below :
in the image gif the textfield hidden by front pannel (listview) when I tap the textfield. how to fix it ????

Flutter :- Align a icon to the right bottom of a container

I tried a column with an aligned icon but it didn't display correctly
If anyone has any idea to help. It would be greatly appreciated. Thank you
This is my code that i tried
List<Widget> temp = [];
listAirline.map((airline) {
listAirlineName.map((item) {
if (airline.name == item) {
temp.add(
Column(
children: <Widget>[
Container(
height: 20,
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.all(Radius.elliptical(100.0, 60.0)),
),
child: Image.asset(
"images/Airlines/" + airline.id + ".jpg",
fit: BoxFit.fitWidth,
),
),
Align(
alignment: Alignment.bottomRight,
child: Icon(
Icons.remove_circle,
color: Colors.white,
),
)
],
),
);
}
}).toList();
}).toList();
return temp;
}```
You need to use the Stack widget for it, i have done similar task with the use of the Stack widget,please check thee below solution
class HomeScreen extends StatefulWidget {
#override
State<StatefulWidget> createState() {
// TODO: implement createState
return _HomeScreen();
}
}
class _HomeScreen extends State<HomeScreen> {
#override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
appBar: AppBar(
title: Text("Home"),
),
body: Container(
height: 100.0,
child: Align(
alignment: Alignment.topCenter,
child: Stack(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 20.0),
height: MediaQuery.of(context).size.width*0.15,
width: MediaQuery.of(context).size.width*0.4,
child: Container(
margin: EdgeInsets.all(5.0),
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.all(Radius.elliptical(20.0, 20.0)),
),
),
)
,
Positioned(
right: 5.0,
bottom: 0.0,
child:
Icon(
Icons.remove_circle,
color: Colors.red,
),
)
],
),
)));
}
}
And output of the above code is as follow

Dialog with stroked round background in Flutter

I want to create a dialog having round cornered background and this background has a 3 pixel stroke, like attached image. I used code below for rounded corners, but how can I add stroke to background?
showDialog(
context: context,
builder: (BuildContext context) {
return Dialog(
backgroundColor: pinkBackground,
shape: RoundedRectangleBorder(borderRadius:
BorderRadius.all(Radius.circular(10.0))),
child: Text(
"title",
style: getBodyTextStyle(),
)
);
},
);
try to add Container as your Dialog child and declareBoxDecoration in it
showDialog(
context: context,
builder: (BuildContext context) {
return Dialog(
backgroundColor: AppColors.colorGreen,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.all(Radius.circular(10.0))),
child: Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.blueAccent,width: 2),
borderRadius:
BorderRadius.all(Radius.circular(10.0))),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
"title",
),
),
));
},
);
Output
Apply locally:
showDialog(
context: context,
builder: (context) {
return Dialog(
backgroundColor: Colors.grey,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
side: BorderSide(width: 3.0, color: Colors.black),
),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
"title",
style: getBodyTextStyle(),
),
),
);
},
);
Apply globally:
class Application extends StatelessWidget {
#override
Widget build(BuildContext context) {
final baseThemeData = ThemeData.light();
final themeData = baseThemeData.copyWith(
dialogTheme: baseThemeData.dialogTheme.copyWith(
backgroundColor: Colors.grey,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
side: BorderSide(width: 3.0, color: Colors.black),
),
),
);
return MaterialApp(
themeMode: ThemeMode.light,
theme: themeData,
...
);
}
void _openDialog(BuildContext context) {
showDialog(
context: context,
builder: (context) {
return Dialog(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
"title",
style: getBodyTextStyle(),
),
),
);
},
);
}
}
The result for both variants:
you can add a container as child of another container, and put margin for inner container:
child: Container(
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.only(
topLeft: const Radius.circular(20.0),
topRight: const Radius.circular(20.0),
bottomLeft: const Radius.circular(20.0),
bottomRight: const Radius.circular(20.0)
)
),
child: Container(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20.0),
topRight: Radius.circular(20.0),
bottomLeft: Radius.circular(20.0),
bottomRight: Radius.circular(20.0)
)
),
margin: EdgeInsets.all(1.0),
child:Padding(
padding: EdgeInsets.all(16),
child:Container(height:50,width:100))

How to increase width and height of image in Flutter's carousel slider without giving the carouselSlider a height

I need to build a carousel slider with an image and text below the image and the image constraints need to be 250 x 250. I have the image and text inside a column but they are getting cut off saying that there was an overflow in the bottom. It works if I give the CarouselSlider widget a height but I shouldn't do that because the text varies and giving a height wont be consistent.Tried several other methods like Wrap,Expanded but none seem to work
This is how I am doing it::
final List<String> imgList = [
'https://images.unsplash.com/photo-1520342868574-5fa3804e551c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=6ff92caffcdd63681a35134a6770ed3b&auto=format&fit=crop&w=1951&q=80',
'https://images.unsplash.com/photo-1522205408450-add114ad53fe?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=368f45b0888aeb0b7b08e3a1084d3ede&auto=format&fit=crop&w=1950&q=80',
];
Widget build(BuildContext context) {
return Container(
child: CarouselSlider(
//height: 350, //giving this a height fixes it but I shouldn't be doing it
items: imgList.map((i) {
return
Column(
children: [
Container(
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(16.0),
child: Image.network(i, height: 250, width: 250)),
),
Text(i)
],
);
}).toList(),
viewportFraction: 1.0,
)
Wrap Container with FittedBox and Wrap with Flexible has different effect
you can see demo picture and use in your case
Column(
children: <Widget>[
FittedBox(
child: Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration(
color: Colors.green,
),
child: Image.network(
imageUrl.sponsorlogo,
height: 250,
width: 250,
//fit: BoxFit.fill,
),
),
),
Text(imageUrl.toString()),
],
);
Wrap with Flexible
return Column(
children: <Widget>[
Flexible(
child: Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration(
color: Colors.green,
),
child: Image.network(
imageUrl.sponsorlogo,
height: 250,
width: 250,
//fit: BoxFit.fill,
),
),
),
Text(imageUrl.toString()),
],
);
full test code
import 'package:flutter/material.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:http/http.dart' as http;
//
// final payload = payloadFromJson(jsonString);
import 'dart:convert';
List<Payload> payloadFromJson(String str) =>
List<Payload>.from(json.decode(str).map((x) => Payload.fromJson(x)));
String payloadToJson(List<Payload> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Payload {
String sponsorlogo;
Payload({
this.sponsorlogo,
});
factory Payload.fromJson(Map<String, dynamic> json) => Payload(
sponsorlogo: json["sponsorlogo"] == null ? null : json["sponsorlogo"],
);
Map<String, dynamic> toJson() => {
"sponsorlogo": sponsorlogo == null ? null : sponsorlogo,
};
}
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
),
home: SponsorSlider(),
);
}
}
class SponsorSlider extends StatefulWidget {
#override
_SponsorSliderState createState() => _SponsorSliderState();
}
class _SponsorSliderState extends State<SponsorSlider> {
Future<List<Payload>> getSponsorSlide() async {
//final response = await http.get("getdata.php");
//return json.decode(response.body);
String response =
'[{"sponsorlogo":"https://images.unsplash.com/photo-1520342868574-5fa3804e551c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=6ff92caffcdd63681a35134a6770ed3b&auto=format&fit=crop&w=1951&q=80"},{"sponsorlogo":"https://images.unsplash.com/photo-1522205408450-add114ad53fe?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=368f45b0888aeb0b7b08e3a1084d3ede&auto=format&fit=crop&w=1950&q=80"},{"sponsorlogo":"https://images.unsplash.com/photo-1519125323398-675f0ddb6308?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=94a1e718d89ca60a6337a6008341ca50&auto=format&fit=crop&w=1950&q=80"}]';
var payloadList = payloadFromJson(response);
return payloadList;
}
#override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Card(
child: new FutureBuilder<List<Payload>>(
future: getSponsorSlide(),
builder: (context, snapshot) {
if (snapshot.hasError) print(snapshot.error);
return snapshot.hasData
? new SponsorList(
list: snapshot.data,
)
: new Center(child: new CircularProgressIndicator());
},
),
),
),
);
}
}
class SponsorList extends StatefulWidget {
final List<Payload> list;
SponsorList({this.list});
#override
_SponsorListState createState() => _SponsorListState();
}
class _SponsorListState extends State<SponsorList> {
int _current = 0;
int index = 1;
#override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
CarouselSlider(
//height: 200.0,
initialPage: 0,
onPageChanged: (index) {
setState(() {
_current = index;
});
},
autoPlay: true,
autoPlayInterval: Duration(seconds: 2),
reverse: false,
items: widget.list.map((imageUrl) {
return Builder(builder: (BuildContext context) {
return Column(
children: <Widget>[
Flexible(
child: Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration(
color: Colors.green,
),
child: Image.network(
imageUrl.sponsorlogo,
height: 250,
width: 250,
//fit: BoxFit.fill,
),
),
),
Text(imageUrl.toString()),
],
);
});
}).toList(),
)
],
),
);
}
}
try to do this and use this package with it for a nicer show: https://pub.dev/packages/shimmer
CarouselSlider(
options: CarouselOptions(
enlargeCenterPage: true,
height: MediaQuery.of(context).size.height / 3.5,
),
items: _imgList
.map(
(item) => Container(
margin: EdgeInsets.all(4),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: CachedNetworkImage(
filterQuality: FilterQuality.low,
fit: BoxFit.cover,
imageUrl: item,
placeholder: (context, url) =>
Shimmer.fromColors(
baseColor: Colors.grey[300],
highlightColor: Colors.white,
child: Container(
color: Colors.white,
),
),
errorWidget: (context, url, error) =>
Text('Unknown image type !'),
),
),
),
)
.toList(),
),

Change Flutter Drawer Background Color

How can I change the background color of a flutter nav drawer?
There doesn't seem to be a color or background-color property.
When you build your ListView in the child property of your Drawer, you can wrap your different sections of the Drawer inside a Container and use the color property of the Container.
drawer: new Drawer(
child: new ListView(
children: <Widget>[
new Container(child: new DrawerHeader(child: new CircleAvatar()),color: Colors.tealAccent,),
new Container (
color: Colors.blueAccent,
child: new Column(
children: new List.generate(4, (int index){
return new ListTile(
leading: new Icon(Icons.info),
);
}),
),
)
],
),
),
A better alternative if you already have a consistent coloring design in your mind, is to define your ThemeData under the theme property of the root of your app, the DrawerHeader and the body will follow your canvasColor, so you need to override the value of one of them to change the color:
return new MaterialApp(
....
theme: new ThemeData(
canvasColor: Colors.redAccent,
....),
)
Best way to wrap Drawer with Theme,
For example:
#override
Widget build(BuildContext context) {
return Scaffold(
//other scaffold items
drawer: Theme(
data: Theme.of(context).copyWith(
canvasColor: Colors.blue, //This will change the drawer background to blue.
//other styles
),
child: Drawer(
child: Column(
children: <Widget>[
//drawer stuffs
],
),
),
);
}
The easiest way would probably be to just wrap the ListView inside a Container and specify its color like following:
drawer: Drawer(
child: Container(color: Colors.red,
child: new ListView(
...
)
)
)
For changing Drawer Header color use blow code
UserAccountsDrawerHeader(
accountName: Text("Ashish Rawat"),
accountEmail: Text("ashishrawat2911#gmail.com"),
decoration: BoxDecoration(
color: const Color(0xFF00897b),
),
currentAccountPicture: CircleAvatar(
backgroundColor: Theme.of(ctxt).platform == TargetPlatform.iOS
? const Color(0xFF00897b)
: Colors.white,
child: Text(
"A",
style: TextStyle(fontSize: 40.0),
),
),
),
You can just use this code;
drawer: Drawer(
child: Container(
//child: Your widget,
color: Colors.red,
width: double.infinity,
height: double.infinity,
),
)
PLAIN BACKGROUND
Just set your desired theme color using primarySwatch: Colors.brown property in ThemeData
class MyApp extends StatelessWidget {
final appTitle = 'Drawer Demo';
#override
Widget build(BuildContext context) {
return MaterialApp(
title: appTitle,
theme: new ThemeData(
primarySwatch: Colors.brown, // Your app THEME-COLOR
),
home: MyHomePage(title: appTitle),
);
}
}
GRADIENT BACKGROUND
Add the gradient property to AppBar.
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("profyl.org",
style: TextStyle(color: Colors.white),
textDirection: TextDirection.ltr),
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: HomeListPage(),
drawer: DrawerPage());
}
Try This.
#override
Widget build(BuildContext context) {
return Drawer(
child: Container(
color: Colors.black,
child: ListView(
padding: const EdgeInsets.all(0),
children: [
],
),
),
);
}
}
This will help
drawer: Drawer(
child: Container(
color: Colors.blueAccent,
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
UserAccountsDrawerHeader(
decoration: BoxDecoration(
color: Color(0xFF56ccf2),
),
accountName: Text("User Name Goes"),
accountEmail: Text("emailaddress#gmail.com"),
currentAccountPicture: CircleAvatar(
backgroundColor:
Theme.of(context).platform == TargetPlatform.iOS
? Color(0xFF56ccf2)
: Colors.white,
child: Text("TK",
style: TextStyle(fontSize: 50,
color: Colors.lightGreenAccent,),),
),
),
ListTile(
title: Text('Home',
style: TextStyle(
color: Colors.white,
fontSize: 18,
)),
contentPadding: EdgeInsets.fromLTRB(20, 5, 0, 5),
trailing: Icon(Icons.arrow_right,
color: Colors.white,),
onTap: () {
Navigator.of(context).pop();
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => HomeScreen()));
},
),
],
),
),
),
The simplest way:
Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
decoration: BoxDecoration(color:Theme.of(context).bottomAppBarColor),
)],
),
)
You can wrap whatever you have in your drawer with a container wrapped with expanded widget. Thus you can change the color of the container there. Something like this will work.
Drawer(
child: Expanded(
child: Container(
color: Colors.red,
child: Text('Tabs'),
),
),
)

Resources