form_floating_action_button 1.0.1 form_floating_action_button: ^1.0.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(MyApp());
class MyApp extends StatelessWidget {
MyApp({
Key key,
}) : super(
key: key,
);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Form FAB Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Form FAB Example'),
);
}
}
class MyHomePage extends StatelessWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return PageOnValidate();
},
),
);
},
child: Text('On Validate Example'),
),
SizedBox(height: 16.0),
RaisedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return PageFormValidate();
},
),
);
},
child: Text('Form Validate Example'),
),
],
),
),
);
}
}