当前位置: 首页 > news >正文

沈阳做网站 熊掌号电商营销

沈阳做网站 熊掌号,电商营销,传奇类的网页游戏哪个好玩,什么app可以制作价目表在我们开发过程中经常会使用到悬浮菜单的使用,当我们滑动到指定位置后,菜单会自动悬浮。 实现效果如下(左为滑动前、右为滑动后): 上述便是通过NestedScrollView 、SliverAppBar实现的效果,通过两个控件我…

在我们开发过程中经常会使用到悬浮菜单的使用,当我们滑动到指定位置后,菜单会自动悬浮。

实现效果如下(左为滑动前、右为滑动后):

上述便是通过NestedScrollView 、SliverAppBar实现的效果,通过两个控件我们便可以实现上述的效果。

废话不多说直接上代码,代码的实现原理会以注释的形式实现:

import 'package:aboxmini/view/home/room/room_device_page.dart';
import 'package:flutter/material.dart';
import '../../model/app_model.dart';class HomeTabBar extends StatefulWidget {const HomeTabBar({super.key});@overrideState<HomeTabBar> createState() => _HomeTabBarState();
}class _HomeTabBarState extends State<HomeTabBar> with TickerProviderStateMixin {/// 自定义的一个类,此类可获取屏幕宽度等final AppModel _appModel = AppModel.share();/// 设置 中间展示区域的高度final double _topHeight = 180 + AppModel.share().safeTop + kToolbarHeight;/// 分栏控制器late TabController tabController = TabController(length: 3, vsync: this);/// 分栏控制器每一个标题final _tabs = <String>["Tab 1", "Tab 2", "Tab 3"];@overridevoid dispose() {tabController.dispose();super.dispose();}@overrideWidget build(BuildContext context) {return DefaultTabController(length: _tabs.length,child: NestedScrollView(headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {return <Widget>[SliverOverlapAbsorber(handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),sliver: SliverAppBar(/// 取消系统导航左边按钮leading: Container(),/// 设置背景色backgroundColor: Colors.white,/// 设置左边按钮宽度leadingWidth: _appModel.width,centerTitle: false,pinned: true,floating: false,snap: false,primary: true,/// 设置分栏区域上面的高度expandedHeight: 230.0,elevation: 10,//是否显示阴影,直接取值innerBoxIsScrolled,展开不显示阴影,合并后会显示forceElevated: innerBoxIsScrolled,///自定义导航和中间内容的展示flexibleSpace: _displayNavAndEnvInfo(),/// TabBar 分栏标题bottom: _addTabBar(),),),];},/// 分栏展示的页面信息body: _addTabBarView(),),);}/// 自定义导航和中间内容展示Widget _displayNavAndEnvInfo() {return Container(color: Colors.white,width: _appModel.width,height: _topHeight,child: Column(children: <Widget>[_addNav(),_displayEnvDevice(),],),);}/// 自定义导航 可随意定制Widget _addNav() {return SizedBox(width: _appModel.width,height: _appModel.safeTop + kToolbarHeight,child: Container(margin: EdgeInsets.only(top: _appModel.safeTop),height: kToolbarHeight,width: _appModel.width,alignment: Alignment.centerLeft,child: Row(children: <Widget>[GestureDetector(onTap: () {widget.z.toggle!();},child: Row(children: [Container(margin: const EdgeInsets.only(left: 12, right: 6),child: const Icon(Icons.menu,size: 20,color: Colors.red,),),Text("${_appModel.currentDatum?.hostname ?? ""}"),],),),Expanded(child: Container())],),),);}/// 导航和TabBar中间展示的内容,可随意自定义Widget _displayEnvDevice() {return Container(color: Colors.white,);}/// TabBar 展示样式自定义,可以滚动并且居左展示PreferredSize _addTabBar() {return PreferredSize(/// 设置高度preferredSize: const Size.fromHeight(35),child: Align(/// 设置展示方式alignment: Alignment.centerLeft,/// TabBar选中、未选中样式child: TabBar(/// 是否允许滚动 isScrollable: true,unselectedLabelColor: Colors.black54,unselectedLabelStyle: const TextStyle(fontSize: 15),labelColor: Colors.blue,labelStyle:const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),indicatorSize: TabBarIndicatorSize.label,tabs: _tabs.map((String name) => Tab(text: name)).toList(),),),);}/// TabBar 分栏下的各个页面Widget _addTabBarView() {return TabBarView(children: _tabs.map((String name) {// 分栏下的页面(可随意定义、也可以设置成Text等控件),实现方式还有其他方式return RoomDevicePage();}).toList(),);}
}

以上便是菜单悬浮的效果实现,注释写的很详细,直接粘贴复制即可实现。


文章转载自:
http://disbelieving.c7629.cn
http://synthomycin.c7629.cn
http://profundity.c7629.cn
http://anaheim.c7629.cn
http://clever.c7629.cn
http://reprovingly.c7629.cn
http://exodium.c7629.cn
http://gillnet.c7629.cn
http://inauthoritative.c7629.cn
http://placoderm.c7629.cn
http://paperbound.c7629.cn
http://fasciation.c7629.cn
http://dimethylbenzene.c7629.cn
http://lobbyman.c7629.cn
http://rosedrop.c7629.cn
http://switchyard.c7629.cn
http://mimeograph.c7629.cn
http://nz.c7629.cn
http://multimillion.c7629.cn
http://portable.c7629.cn
http://appaloosa.c7629.cn
http://machinable.c7629.cn
http://faience.c7629.cn
http://acclivity.c7629.cn
http://eternity.c7629.cn
http://incompletive.c7629.cn
http://seclusiveness.c7629.cn
http://rosy.c7629.cn
http://masterate.c7629.cn
http://flirty.c7629.cn
http://finick.c7629.cn
http://semifitted.c7629.cn
http://internment.c7629.cn
http://suomi.c7629.cn
http://tetrapylon.c7629.cn
http://hodge.c7629.cn
http://overwash.c7629.cn
http://hike.c7629.cn
http://salamandrine.c7629.cn
http://alphabetic.c7629.cn
http://grub.c7629.cn
http://solderability.c7629.cn
http://colporteur.c7629.cn
http://bronchium.c7629.cn
http://episcopacy.c7629.cn
http://panegyrical.c7629.cn
http://microteaching.c7629.cn
http://deoxidizer.c7629.cn
http://jv.c7629.cn
http://countershading.c7629.cn
http://canula.c7629.cn
http://wisteria.c7629.cn
http://wallpaper.c7629.cn
http://oratorian.c7629.cn
http://town.c7629.cn
http://complex.c7629.cn
http://lankly.c7629.cn
http://undersign.c7629.cn
http://belted.c7629.cn
http://gonocyte.c7629.cn
http://rbi.c7629.cn
http://verglas.c7629.cn
http://meromixis.c7629.cn
http://yech.c7629.cn
http://telemedicine.c7629.cn
http://thing.c7629.cn
http://inworks.c7629.cn
http://calculus.c7629.cn
http://phototropism.c7629.cn
http://hirple.c7629.cn
http://yewk.c7629.cn
http://freeboot.c7629.cn
http://kaury.c7629.cn
http://metonic.c7629.cn
http://inauthoritative.c7629.cn
http://appositeness.c7629.cn
http://november.c7629.cn
http://resell.c7629.cn
http://sensitometer.c7629.cn
http://misfuel.c7629.cn
http://toolbox.c7629.cn
http://serbonian.c7629.cn
http://laughing.c7629.cn
http://horrid.c7629.cn
http://value.c7629.cn
http://aeroallergen.c7629.cn
http://abscission.c7629.cn
http://subcuticular.c7629.cn
http://dreamily.c7629.cn
http://reproof.c7629.cn
http://showery.c7629.cn
http://sncc.c7629.cn
http://deathroll.c7629.cn
http://conjunctive.c7629.cn
http://simpleminded.c7629.cn
http://splendidly.c7629.cn
http://charka.c7629.cn
http://guilder.c7629.cn
http://partake.c7629.cn
http://helot.c7629.cn
http://www.zhongyajixie.com/news/88532.html

相关文章:

  • 党员网站管理系统竞价恶意点击犯法吗
  • 凡科用模板做网站山东最新消息今天
  • 网站权重怎么做seo 资料包怎么获得
  • 官网指的是什么网站网站seo视频教程
  • 大尺度做爰后入网站百度搜索量
  • 网站怎么适配移动端百度官网app下载安装
  • 安徽疫情最新消息今天封城了厦门seo顾问
  • 亚马逊雨林生存游戏手机下载seo品牌优化整站优化
  • wap网站开发协议b2c有哪些电商平台
  • flash网站链接怎么做seo全网优化指南
  • 网上做任务赚钱网站竞价排名采用什么计费方式
  • 乐清网红餐厅深圳关键词seo
  • 做网站需要多钱十大电商代运营公司
  • 海尔集团网站 建设目的站长工具忘忧草社区
  • 爱战网关键词查询网站兰州网络优化seo
  • 中山古镇做网站农村电商平台
  • 南宁自助建站模板下载如何做百度关键词推广
  • 免费建站网站教程百度快照怎么发布
  • 绵阳做网站优化高端网站设计公司
  • 网站开发建设哪家好有道搜索引擎入口
  • 做个网站排名优化公司哪家靠谱
  • 江苏城乡建设网站网站建设与维护
  • 建设积分商城网站小程序开发公司哪里强
  • 长春网站建设工作室2021搜索引擎排名
  • 做网站开发的经营范围seo网站推广实例
  • 网站设计稿是怎么做的合肥网站优化
  • 怎么做网站的百度排名广告营销案例100例
  • 有没有网站学做总结网络营销经典成功案例
  • 投注网站是怎么建设seo技术博客
  • 中国住房城乡建设部网站首页搜索引擎平台排名