Reputation: 294
Im using bottomNavigationBar Widget in Scaffold Widget but I have extra red Container that cover some area of Scaffold as you see in the attachment . How to remove red area of Container ? I tried to use Colors.transparent but its not work !
try it in codepen : Click Here
Attachment :
Full Code :
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: MyWidget(),
),
);
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xff2c3e50),
bottomNavigationBar: InkWell(
onTap: () {
print('Hi');
},
child: Container(
color:Colors.red,
width: 80,
height: 80,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 80,
height: 80,
decoration: BoxDecoration(
color: Color(
0xFF1D1E33,
),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(25),
bottomLeft: Radius.circular(2),
topRight: Radius.circular(2),
),
),
child: Icon(
Icons.add,
color: Colors.white,
),
)
],
),
),
),
body: Center(
child: Text(
'heello ? ',
style: Theme.of(context).textTheme.headline4,
),
),
);
}
}
Upvotes: 0
Views: 39
Reputation: 338
You must remove:
color:Colors.red,
in line 21.
Or replace this line to:
color:Colors.transparent,
Like this: https://codepen.io/Fudal/pen/YzqyVGE
Upvotes: 1