show_hide_fab 0.0.1 copy "show_hide_fab: ^0.0.1" to clipboard
show_hide_fab: ^0.0.1 copied to clipboard

outdated

A flutter package that provides easy methods to show and hide a FAB attached to a Scaffold.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:show_hide_fab/show_hide_fab.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ShowHideFAB Demo',
      theme: ThemeData(
        primarySwatch: Colors.green,
      ),
      home: MyHomePage(title: 'ShowHideFAB Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  final String title;

  MyHomePage({this.title});

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool show = true;
  String text = 'HIDE FAB';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: RaisedButton(
          onPressed: () {
            setState(() {
              show = !show;
              text = 'SHOW FAB';
            });
          },
          color: Colors.green,
          child: Text(text),
        ),
      ),
      floatingActionButton: ShowHideFAB(
        shouldShow: show,
        animationDuration: Duration(milliseconds: 500),
        fab: FloatingActionButton(
          backgroundColor: Colors.green,
          child: Icon(Icons.add, color: Colors.white),
          onPressed: () {},
        ),
      ),
    );
  }
}
5
likes
0
points
29
downloads

Publisher

verified publisherakora-ingdkb.me

Weekly Downloads

A flutter package that provides easy methods to show and hide a FAB attached to a Scaffold.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on show_hide_fab