v0.3.2opscroll_web
一个为 Flutter Web 提供单页滚动功能的库。轻松快速地创建单页着陆页面,还提供其他滚动动画,如淡入淡出、下落和水波纹效果。
Flutter Web 的单页滚动包
以下为英文项目原文快照,最新内容请访问 GitHub。
https://media.giphy.com/media/UjyBgiG2NjM4nYghBh/giphy.gif?cid=790b761177a01e756ce8a2f4e90dc103b29ddc59d2eb0581&rid=giphy.gif&ct=g
A simple and easy to use library that creates OnePage sites for Flutter Web Developers! Make a beautiful and smooth landing pages with OPScroll with in minutes. Try out our Web Demo App.
Add this to your package's pubspec.yaml file:
dependencies:
opscroll_web: ^0.0.2
You can install packages from the command line:
with pub:
$ pub get
with Flutter:
$ flutter pub get
Now in your Dart code, you can use:
import 'package:opscroll_web/opscroll_web.dart';
OPScroll is a Stateful Widget that produces OnePage scroll mechanicsm for your
Flutter Web Projects.
Include it in your build method like:
OpscrollWeb({
onePageChildren:[],
pageController:PageController(),
scrollCurve : Curves.easeIn,
scrollSpeed : const Duration(milliseconds: 900),
floatingButtonBackgroundColor :Colors.white,
floatingButtonSplashColor : Colors.white,
isFloatingButtonActive : false,
isTouchScrollingActive : false,
scrollingAnimationOptions: ScrollingAnimationOptions.Default,
scrollDirection = Axis.vertical,
})
You can allow to scrolling by tapping.Just give the true value to isTouchScrollingActive
isTouchScrollingActive=true,
You can allow to scrolling by Floating Action Button.Just give the true value to isFloatingButtonActive
Also you can change background & splash colors.
isTouchScrollingActive=true, //Optional
floatingButtonBackgroundColor :Colors.white, //Optional
floatingButtonSplashColor : Colors.white, //Optional
There are 4 scrolling options for OPScroll.
enum ScrollingAnimationOptions { Fading, Drop, Circle, Default }
You can only choice 1 scrolling animation options.
OpscrollWeb(
isFloatingButtonActive: true,
isTouchScrollingActive: true,
pageController: pageController,
scrollingAnimationOptions: ScrollingAnimationOptions.Fading,
scrollSpeed: const Duration(milliseconds: 900,
onePageChildren:[]),
OpscrollWeb(
isFloatingButtonActive: true,
isTouchScrollingActive: true,
pageController: pageController,
scrollingAnimationOptions: ScrollingAnimationOptions.Circle,
scrollSpeed: const Duration(milliseconds: 600,
onePageChildren:[]),
OpscrollWeb(
isFloatingButtonActive: true,
isTouchScrollingActive: true,
pageController: pageController,
scrollingAnimationOptions: ScrollingAnimationOptions.Drop,
scrollSpeed: const Duration(milliseconds: 600,
onePageChildren:[]),