flutter_buttons 0.0.2 flutter_buttons: ^0.0.2 copied to clipboard
Ready-made various button styles for Flutter.
import 'package:flutter/material.dart';
import 'package:flutter_buttons/flutter_buttons.dart';
void main() => runApp(
FlutterButtonsDemo()
);
class FlutterButtonsDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Buttons Demo',
theme: ThemeData(primaryColor: Colors.red),
home: Scaffold(
appBar: AppBar(
title: Text('Buttons Demo'),
centerTitle: true,
),
body: Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
KRaisedButton(
radius: 30.0,
color: Colors.teal,
text: 'Raised Button',
textColor: Colors.white,
textFontWeight: FontWeight.bold,
onPressed: () => {},
),
KOutlineButton(
radius: 30.0,
borderColor: Colors.teal,
text: 'Outline Button',
textColor: Colors.teal,
textFontWeight: FontWeight.bold,
onPressed: () => {},
),
KFlatButton(
radius: 30.0,
color: Colors.teal,
text: 'Flat Button',
textColor: Colors.white,
textFontWeight: FontWeight.bold,
onPressed: () => {},
),
CustomButton(
buttonColorGradient: [ Colors.teal.shade100, Colors.teal.shade900 ],
buttonBorderColor: Colors.teal,
buttonText: 'Custom button',
buttonTextColor: Colors.white,
highlightColor: Colors.white30,
splashColor: Colors.white,
onPressed: () {},
)
],
),
),
),
);
}
}