Ad
How To Remove The Space Under The Elevated Button At The Bottom Of The Screen?
import 'package:flutter/material.dart';
class AddPlaceScreen extends StatefulWidget {
static const routeName = '/add-place';
@override
_AddPlaceScreenState createState() => _AddPlaceScreenState();
}
class _AddPlaceScreenState extends State<AddPlaceScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Add new Place data'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text('User Inputs'),
ElevatedButton.icon(
onPressed: () {},
icon: Icon(Icons.add),
label: Text('Add Place'),
),
],
),
);
}
}
Here I am getting a space under the elevated button located at the bottom of the page please provide any solution to remove it.
Ad
Answer
Please refer below code
Add this piece of code inside ElevatedButton.icon Widget
style: ButtonStyle( tapTargetSize: MaterialTapTargetSize .shrinkWrap, /* Please add this to avoid padding */ ),
class AddPlaceScreen extends StatefulWidget {
static const routeName = '/add-place';
@override
_AddPlaceScreenState createState() => _AddPlaceScreenState();
}
class _AddPlaceScreenState extends State<AddPlaceScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Add new Place data'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text('User Inputs'),
ElevatedButton.icon(
style: ButtonStyle(
tapTargetSize: MaterialTapTargetSize
.shrinkWrap, /* Please add this to avoid padding */
),
onPressed: () {},
icon: Icon(Icons.add),
label: Text('Add Place'),
),
],
),
);
}
}
Ad
source: stackoverflow.com
Related Questions
- → How do you create a 12 or 24 mnemonics code for multiple cryptocurrencies (ETH, BTC and so on..)
- → Flutter: input text field don't work properly in a simple example..... where am I wrong?
- → Can I customize the code formatting of Dart code in Atom?
- → Is it possible to develop iOS apps with Flutter on a Linux virtual machine?
- → Display SnackBar in Flutter
- → JSON ObjectMapper in Flutter
- → Material flutter app source code
- → TabBarSelection No such method error
- → How do I set the animation color of a LinearProgressIndicator?
- → Add different routes/screens to Flutter app
- → Is there a way to get the size of an existing widget?
- → How to share a file using flutter
- → Is there an easy way to find particular text built from RichText in a Flutter test?
Ad