Floating Action Button
Complete Code For Floating Action Button In Flutter
main.dart
import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { void calling() { print('Floating Action Button Clicked'); } @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( appBar: AppBar( backgroundColor: Colors.red, title: Text('Floating Action Button') ), body: Center( child: Text('Floating Action Button', style: TextStyle(fontSize: 22),) ), floatingActionButton: FloatingActionButton( child: Icon(Icons.add), onPressed: () => calling(), backgroundColor: Colors.red, ), ) ); } }