Flutter’da FloatingActionButton (FAB), Scaffold widget’ının içinde oluşturulur ve Scaffold‘un “floatingActionButton” özelliği ile ilişkilendirilebilir.
FloatingActionButton(
onPressed: () {
// FAB'a tıklandığında yapılacak işlemler buraya yazılabilir
},
backgroundColor: Colors.pink,
child: const Icon(Icons.add),
)import 'package:flutter/material.dart';
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Title"),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
// FAB'a tıklandığında yapılacak işlemler buraya yazılabilir
},
backgroundColor: Colors.pink,
child: const Icon(Icons.add),
),
);
}
}
