Skip to content

Instantly share code, notes, and snippets.

@manofi21
Created August 31, 2019 02:35
Show Gist options
  • Save manofi21/a413ca79df7c073303aaf7d213ed2a5e to your computer and use it in GitHub Desktop.
Save manofi21/a413ca79df7c073303aaf7d213ed2a5e to your computer and use it in GitHub Desktop.
how to show button in flutter
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: ListView(
children: <Widget>[
Container(
margin: EdgeInsets.symmetric(horizontal: 100),
child: new ConstrainedBox(
constraints: const BoxConstraints(minWidth: double.infinity),
child: new RaisedButton(
color: Colors.blue,
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
splashColor: Colors.blueAccent,
onPressed: () {},
child: Text(
"Apply this buttom",
style: TextStyle(fontSize: 15),
)
),
),
)
],
)
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment