在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):fysoul17/flutter_speed_dial_material_design开源软件地址(OpenSource Url):https://github.com/fysoul17/flutter_speed_dial_material_design开源编程语言(OpenSource Language):Dart 96.1%开源软件介绍(OpenSource Introduction):Flutter Speed dial of Material Design styleFlutter package which applies Material design Speed dial PreviewThere are several packages that provide fancy speed dial. However, as most of those do not work properly on docked FAB using notch, I referenced Andrea Bizzoto and Matt Carroll's idea/code specified here to make it work fine with notch as well. Truly appreciate to Andrea and Matt for sharing such an awesome idea and codes. UsageBasic usageWidget build(BuildContext context) {
return Scaffold(
body: SafeArea(child: _buildBody()),
floatingActionButton: _buildFloatingActionButton(),
floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
bottomNavigationBar: _buildBottomBar(),
);
}
Widget _buildFloatingActionButton() {
final icons = [
SpeedDialAction(child: Icon(Icons.mode_edit)),
SpeedDialAction(child: Icon(Icons.date_range)),
SpeedDialAction(child: Icon(Icons.list)),
];
return SpeedDialFloatingActionButton(
actions: icons,
// Make sure one of child widget has Key value to have fade transition if widgets are same type.
childOnFold: Icon(Icons.event_note, Key: UniqueKey()),
childOnUnfold: Icon(Icons.add),
useRotateAnimation: true,
onAction: _onSpeedDialAction,
);
}
_onSpeedDialAction(int selectedActionIndex) {
print('$selectedActionIndex Selected');
} Using controllerSpeedDialController _controller = SpeedDialController();
SpeedDialFloatingActionButton(
controller: _controller,
...
);
// Use anywhere to mannually unfold
_controller.unfold(); Fade Transition animation between child widgetsIn order to apply fade transition between [childOnFold] and [childOnUnfold], make sure one of those has Key field. (eg. ValueKey(value) or UniqueKey()). As we using AnimatedSwitcher for transition animation, no key with same type of child will perform no animation. It is AnimatedSwitcher's behaviour. TO-DOs
ContributingAny pull requests for implementing To-Do functions are always welcome! Other useful packages you might be instrestedFirebase Auth Simplify Google Maps Place Picker SupportIf the package was useful or saved your time, please do not hesitate to buy me a cup of coffee! ;) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论