I tried create horizontal multiple floating action buttons on bottom center position but my buttons not centered in my case. How I can center my buttons?
Here is DartPad demo
Code
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
/// This is the main application widget.
class MyApp extends StatelessWidget {
static const String _title = 'Flutter multiple centered floating action buttons';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
home: MyStatelessWidget(),
);
}
}
/// This is the stateless widget that the main application instantiates.
class MyStatelessWidget extends StatelessWidget {
MyStatelessWidget({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Floating Action Buttons'),
),
body: Center(child: const Text('Multiple centered Floating Action Buttons')),
floatingActionButton: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
FloatingActionButton(
onPressed: null,
child: Icon(Icons.add, color: Colors.white),
backgroundColor: Colors.green,
heroTag: 'mapZoomIn',
),
FloatingActionButton(
onPressed: null,
child: Icon(Icons.remove, color: Colors.white),
backgroundColor: Colors.green,
heroTag: 'mapZoomOut',
),
FloatingActionButton(
onPressed: null,
child: Icon(Icons.place, color: Colors.white),
backgroundColor: Colors.green,
heroTag: 'showUserLocation',
),
FloatingActionButton(
onPressed: null,
child: Icon(Icons.home, color: Colors.white),
backgroundColor: Colors.green,
heroTag: 'mapGoToHome',
),
],
),
);
}
}
Screenshot

