Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() => runApp(MaterialApp(
- home: Home(),
- ));
- class Home extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text(
- 'App bar',
- style: TextStyle(color: Colors.white),
- ),
- centerTitle: true,
- backgroundColor: Colors.red,
- ),
- //read about elevated button => https://stackoverflow.com/questions/66835173/how-to-change-background-color-of-elevated-button-in-flutter-from-function
- body: Center(
- child: ElevatedButton.icon(
- icon: Icon(
- Icons.mail,
- size: 24.0,
- ),
- label: Text('Send Mail'),
- onPressed: () {
- print('Pressed');
- },
- style : ElevatedButton.styleFrom(
- primary : Colors.amber,
- ),
- ),
- ),
- floatingActionButton: FloatingActionButton(
- child: Text('click me'),
- onPressed: null,
- backgroundColor: Colors.red,
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement