import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: MyApp(), )); } class MyApp extends StatefulWidget { @override _State createState() => _State(); } class _State extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('ButtonBar'), ), body: Center( child: Container( child: ButtonBar( children: [ FlatButton( child: Text('Login'), color: Colors.blue, onPressed: () {}, ), FlatButton( child: Text('Cancel'), color: Colors.red, onPressed: () {}, ) ], ), ), ), ); } }