sliver_fab 0.1.0 copy "sliver_fab: ^0.1.0" to clipboard
sliver_fab: ^0.1.0 copied to clipboard

outdatedDart 1 only

A wrapper widget allowing to use FloatingActionButton on the edge of FlexibleSpacebar

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Sliver Fab Example',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Builder(
        builder: (context) =>
        new SliverFab(
          floatingActionButton: new FloatingActionButton(
            onPressed: () =>
                Scaffold.of(context).showSnackBar(
                    new SnackBar(content: new Text("You clicked FAB!"))),
            child: new Icon(Icons.add),
          ),
          expandedHeight: 256.0,
          slivers: <Widget>[
            new SliverAppBar(
              expandedHeight: 256.0,
              pinned: true,
              flexibleSpace: new FlexibleSpaceBar(
                title: new Text("SliverFab Example"),
                background: new Image.asset(
                  "img.jpg",
                  fit: BoxFit.cover,
                ),
              ),
            ),
            new SliverList(
              delegate: new SliverChildListDelegate(
                new List.generate(
                  30,
                      (int index) =>
                  new ListTile(title: new Text("Item $index")),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
77
likes
0
pub points
81%
popularity

Publisher

unverified uploader

A wrapper widget allowing to use FloatingActionButton on the edge of FlexibleSpacebar

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on sliver_fab