disableFAB function

void disableFAB({
  1. required ScrollController scrollController,
  2. required AnimationController animationController,
})

To launch URL use url launcher package for this method. To hide the Floating Action Button when scroll control is at the top on the screen.

Implementation

/*
  Future<void> openUrlLink(String url) async {
    if (await canLaunchUrl(Uri.parse(url))) {
      await launchUrl(
        Uri.parse(url),
      );
    } else {
      throw 'Could not launch $url';
    }
  }
*/

/// To hide the Floating Action Button when scroll control is at the top on the screen.
void disableFAB({
  required ScrollController scrollController,
  required AnimationController animationController,
}) {
  scrollController.addListener(() {
    if (scrollController.position.pixels ==
        scrollController.position.minScrollExtent) {
      animationController.reverse();
    }
  });
}