sticky_float_button

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

sticky float button

Sticky Float Button #
A Flutter implementation of sticky float button.

Getting started #
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
...
sticky_float_button:
copied to clipboard
In your library add the following import:
import 'package:sticky_float_button/sticky_float_button.dart';
copied to clipboard
For help getting started with Flutter, view the online documentation.
Example #
import 'package:flutter/material.dart';
import 'package:sticky_float_button/sticky_float_button.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Sticky Float Button',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const StickyFloatExample(),
);
}
}

class StickyFloatExample extends StatefulWidget {
const StickyFloatExample({Key? key}) : super(key: key);

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

class _StickyFloatExampleState extends State<StickyFloatExample> {
AppBar _appBar() {
return AppBar(
title: const Text("Sticky Float Example"),
);
}

Widget _body() {
return Center(
child: GestureDetector(onTap: () {}, child: const Text("Sticky")),
);
}

Widget _floatButton() {
return const CircleAvatar(
backgroundColor: Colors.grey,
child: Icon(
Icons.add,
color: Colors.white,
),
);
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: _appBar(),
body: StickyBuilder(
stickyButton: _floatButton(),
child: _body(),
),
);
}
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.