-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
app_fab.dart
31 lines (27 loc) · 848 Bytes
/
app_fab.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import 'package:flutter/material.dart';
import '../../../common/extensions/scroll_controller_extensions.dart';
class AppFab extends StatelessWidget {
final ScrollController scrollController;
final AnimationController hideFabAnimController;
const AppFab({
Key key,
@required this.scrollController,
@required this.hideFabAnimController,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return FadeTransition(
opacity: hideFabAnimController,
child: ScaleTransition(
scale: hideFabAnimController,
child: FloatingActionButton(
backgroundColor: Theme.of(context).primaryColor,
mini: true,
onPressed: () => scrollController.goToTheTop(),
heroTag: null,
child: const Icon(Icons.arrow_upward),
),
),
);
}
}