I am trying to create button widget from scratch and here is the code I have:
import 'package:flutter/material.dart';
class Button extends StatelessWidget {
String _number;
static const double _buttonMargin = 20.0;
Button(this._number);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(border: Border.all()),
height: 50.0,
width: 50.0,
margin: const EdgeInsets.all(_buttonMargin),
child: Text(
_number,
textAlign: TextAlign.center,
));
}
}
I would like to know how can I align the numbers to be exactly in the middle of the container? The screenshot of what it looks like is attached.