rajath_pai

ninja9 elevatedButton

Jul 30th, 2021
878
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() => runApp(MaterialApp(
  4.       home: Home(),
  5.     ));
  6.  
  7. class Home extends StatelessWidget {
  8.   @override
  9.   Widget build(BuildContext context) {
  10.     return Scaffold(
  11.       appBar: AppBar(
  12.         title: Text(
  13.           'App bar',
  14.           style: TextStyle(color: Colors.white),
  15.         ),
  16.         centerTitle: true,
  17.         backgroundColor: Colors.red,
  18.       ),
  19.       body: Center(
  20.         child: ElevatedButton(
  21.           onPressed : () {},
  22.           child : Text('Click me'),
  23.           style : ElevatedButton.styleFrom(
  24.             primary : Colors.purple,
  25.             padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20),
  26.             textStyle: TextStyle(
  27.                 fontSize: 20,
  28.                 fontWeight: FontWeight.bold
  29.             ),
  30.           ),
  31.         ),
  32.       ),
  33.       floatingActionButton: FloatingActionButton(
  34.         child: Text('click me'),
  35.         onPressed: null,
  36.         backgroundColor: Colors.red,
  37.       ),
  38.     );
  39.   }
  40. }
  41.  
RAW Paste Data