Another ButtonBar Widget in Flutter


Here is the simple program for printing the another buttonbar widget in Flutter.

Source Code

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<MyApp> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('ButtonBar'),
      ),
      body: Center(
        child: Container(
          child: ButtonBar(
            children: <Widget>[
              FlatButton(
                child: Text('Login'),
                color: Colors.blue,
                onPressed: () {},
              ),
              FlatButton(
                child: Text('Cancel'),
                color: Colors.red,
                onPressed: () {},
              )
            ],
          ),
        ),
      ),
    );
  }
}
To download raw file Click Here

Learn All in Tamil © Designed & Developed By Tutor Joes