Scaffold widget provides floatingActionButton property. You can just use FloatingActionButton() as value.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
//body: Container(),
floatingActionButton: FloatingActionButton(
backgroundColor: Colors.blue,
child: Icon(Icons.add),
onPressed: () {},
),
),
);
}
}
This will print a FloatingActionButton.