I want to have a button of fixed width and height inside a container. But, for some reason button takes height and width of Container. I tried using SizedBox and ButtonTheme but they don't work as well.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
debugPaintSizeEnabled = true;
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
// home: EditorScreen(),
home: Scaffold(
body: SafeArea(
child: Container(
height: 65,
width: double.infinity,
color: Colors.black,
child: SizedBox(
height: 50,
width: 50,
child: ButtonTheme(
minWidth: 50,
height: 50,
child: FlatButton(
onPressed: () {},
color: Colors.red,
child: Text("Test"),
),
),
),
),
),
),
);
}
}
ButtonThemeis not necessary.