'How do I create a spacing between two elevated buttons in bottomBar Navigation?
Solution 1:[1]
Add mainAxisAlignment: MainAxisAlignment.spaceAround, inside the Row() widget, this will make sure that the children have same space around them.
Solution 2:[2]
use SizedBox between 2 Widgets
const SizedBox(width: 16.0),
or one Widget wrap with Padding and give one side padding like left or Right
const Padding(padding: EdgeInsets.only(right: 16.0)),
or use Spacer between 2 Widgets
const Spacer(),
or you can use in Row Widgets
Row(
// you can use anyone of them, this properties space given equally according properties
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text("Text 1"),
Text("Text 2"),
Text("Text 3"),
]
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Samia Ashraf |
| Solution 2 |

