form_floating_action_button 2.1.1 form_floating_action_button: ^2.1.1 copied to clipboard
A Floating Action Button that can be used in forms to provide loading and validation feedback
import 'package:flutter/material.dart';
import 'src/page_form_validate.dart';
import 'src/page_on_validate.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({
super.key,
});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Form FAB Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Form FAB Example'),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return const PageOnValidate();
},
),
);
},
child: const Text('On Validate Example'),
),
const SizedBox(height: 16.0),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return const PageFormValidate();
},
),
);
},
child: const Text('Form Validate Example'),
),
],
),
),
);
}
}