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

做建材去什么网站营销策划推广公司

做建材去什么网站,营销策划推广公司,外贸网站的域名,做什么软件做网站效率最好要解决 PageView 内嵌套 TabBarView 的滑动冲突,并在 TabBarView 滑动到边界时将滑动事件提交给上一级的 PageView,可以使用 NotificationListener 和自定义的 TabBarView 来实现滑动事件的传递。以下是具体的实现方法: import package:flut…

要解决 PageView 内嵌套 TabBarView 的滑动冲突,并在 TabBarView 滑动到边界时将滑动事件提交给上一级的 PageView,可以使用 NotificationListener 和自定义的 TabBarView 来实现滑动事件的传递。以下是具体的实现方法:

import 'package:flutter/material.dart';
import '../../util/theme_util.dart';///主体框架---- 筛选工单状态
class WorkTabBarPage extends StatefulWidget {late PageController? _pageController;WorkTabBarPage(this._pageController, {Key? key,}) : super(key: key);_WorkTabBarState createState() => _WorkTabBarState();
}class _WorkTabBarState extends State<WorkTabBarPage>with SingleTickerProviderStateMixin {late TabController _tabController;int _currentIndex = 0;List<Map<String, dynamic>> _tabData = [{'title': '全部订单', 'count': 0},{'title': '待提交', 'count': 5},{'title': '已提交', 'count': 3},{'title': '待处理', 'count': 2},{'title': '已处理', 'count': 5},{'title': '已完成', 'count': 3},];void initState() {super.initState();_tabController = TabController(length: _tabData.length, vsync: this);_tabController.addListener(_handleTabSelection);}void _handleTabSelection() {if (_tabController.indexIsChanging) {setState(() {_currentIndex = _tabController.index;});}}void dispose() {_tabController.dispose();super.dispose();}Widget build(BuildContext context) {return Scaffold(backgroundColor: ThemeUtils.getBgProminent(context),appBar: AppBar(backgroundColor: ThemeUtils.getBgProminent(context),title: TabBar(isScrollable: true,// 设置标题栏可滚动indicator: UnderlineTabIndicator(borderSide: BorderSide(width: 2.0, color: ThemeUtils.getThemeColor(context)),// 设置选中下的横线颜色和宽度insets: EdgeInsets.symmetric(horizontal: 10.0),),dividerColor: Colors.transparent,indicatorSize: TabBarIndicatorSize.label,// 设置下划线的长度为标签的宽度labelColor: ThemeUtils.getThemeColor(context),// 设置选中标签的颜色unselectedLabelColor: ThemeUtils.getTextDeepColor(context),labelStyle: TextStyle(fontSize: 16.0, // 选中时的字体大小fontWeight: FontWeight.bold, // 选中时的字体加粗),unselectedLabelStyle: TextStyle(fontSize: 14.0, // 未选中时的字体大小fontWeight: FontWeight.normal, // 未选中时的字体加粗),controller: _tabController,tabAlignment: TabAlignment.start,tabs: _tabData.map((tab) {return Tab(child: Row(children: [Text(tab['title']),if (tab['count'] > 0)Container(padding: EdgeInsets.all(2),decoration: BoxDecoration(color: Colors.red,borderRadius: BorderRadius.circular(8),),constraints: BoxConstraints(minWidth: 14,minHeight: 14,),child: Text(tab['count'].toString(),style: TextStyle(color: Colors.white,fontSize: 10,),textAlign: TextAlign.center,),),],),);}).toList(),),),body: _buildCustomTabBarView(),);}Widget _buildCustomTabBarView() {return NotificationListener<ScrollNotification>(onNotification: (ScrollNotification notification) {if (notification is ScrollEndNotification) {// Check if the TabBarView has reached the beginning or endif (_tabController.index <= 0) {print('cexxxxx001 ${_tabController.index}  extentBefore ${notification.metrics.extentBefore}  extentAfter ${notification.metrics.extentAfter}');// Reached the beginning, pass the left swipe to the PageViewif (notification.metrics.extentBefore == 0) {widget. _pageController!.previousPage(duration: const Duration(milliseconds: 300),curve: Curves.ease,);print('cexxxxx001');}} else if (_tabController.index >= _tabData.length - 1) {print('cexxxxx002 ${_tabController.index}  extentAfter ${notification.metrics.extentAfter} extentBefore ${notification.metrics.extentBefore}');// Reached the end, pass the right swipe to the PageViewif (notification.metrics.extentAfter == 0) {widget._pageController!.nextPage(duration: const Duration(milliseconds: 300),curve: Curves.ease,);print('cexxxxx002');}}}return false;},child: TabBarView(controller: _tabController,children: _tabData.map((tab) {return Container(child: Center(child: Text('这里是${tab['title']}页面内容'),),);}).toList(),),);}
}
http://www.dtcms.com/wzjs/428609.html

相关文章:

  • 公司网站建设合同书外贸网站建设 google
  • 查公司的口碑和评价的网站网站排名优化教程
  • 菜鸟移动端网站开发网络营销软件下载
  • 机关公文写作网站怎么办网站平台
  • 国栋建设网站seo点击优化
  • 官方网站建设 省心磐石网络百度seo排名主要看啥
  • 河北衡水建设网站公司电话快速排名点击工具
  • 做网站图片处理问题今日重大国际新闻军事
  • 工作室官网长春关键词优化平台
  • 自己编写代码建设微网站seo网络优化公司
  • java网站开发模式有哪些厦门seo网站推广
  • 单页面网站制作柳州网站建设哪里有
  • 怎样用vs2017做网站成品网站源码1688免费推荐
  • 济南网站建设公司导航网站怎么推广
  • wordpress看文网站一起来看在线观看免费
  • 长治网站设计制作网站怎么快速优化关键词排名
  • 怎么制作网站教程下载店铺推广怎么做
  • html个人网页中文模板百度seo关键词报价
  • 互联网产品做网站好还是小程序百度seo怎么把关键词优化上去
  • 旅游网站的后台管理系统怎么做seo优化标题 关键词
  • wordpress博客站点地图百度竞价广告代理
  • 西安网站建设ipv6西安最新消息今天
  • 萍乡网站建设公司百度下载软件
  • 小型网站开发成本软件排名优化
  • 东莞网站seo优化托管全国培训机构排名前十
  • 好网站建设公司北京外贸网站优化推广
  • 网站 色调汕头百度网络推广
  • 如何设计一个网络搜索引擎优化的实验结果分析
  • 校园网站建设素材优化大师官方免费下载
  • 网站建设中 模板 下载商丘seo外包