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

杭州企业网站沈阳做网站最好的公司

杭州企业网站,沈阳做网站最好的公司,网站怎么做优化排名,百度推广费用报价单上效果: 有些不能理解官方例子里的动画为什么没有效果,有可能是我写法不对 后续如果有动画效果修复了,再更新这篇,没有动画效果,总觉得感受的丝滑效果差了很多 上代码: import package:flutter/material.…

上效果:

在这里插入图片描述
有些不能理解官方例子里的动画为什么没有效果,有可能是我写法不对
后续如果有动画效果修复了,再更新这篇,没有动画效果,总觉得感受的丝滑效果差了很多

上代码:

import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:logging/logging.dart';const TAG = 'OfficePageViewDemo';class OfficePageViewDemo extends StatelessWidget {const OfficePageViewDemo({super.key});Widget build(BuildContext context) {return MaterialApp(home: Scaffold(appBar: AppBar(title: Text('PageView Demo!'),),body: PageViewDemo(),),);}
}class PageViewDemo extends StatefulWidget {const PageViewDemo({super.key});createState() => _PageViewDemoState();
}class _PageViewDemoState extends State<PageViewDemo>with TickerProviderStateMixin {late PageController _pageViewController;late TabController _tabController;int _currentPageIndex = 0;void initState() {super.initState();_pageViewController = PageController();_tabController = TabController(length: 3, vsync: this);}void dispose() {super.dispose();_pageViewController.dispose();_tabController.dispose();}Widget build(BuildContext context) {final TextTheme textTheme = Theme.of(context).textTheme;return Stack(alignment: Alignment.bottomCenter,children: [PageView(controller: _pageViewController,onPageChanged: _handlePageViewChanged,children: [Center(child: Text('First Page',style: textTheme.titleLarge,),),Center(child: Text('Second Page',style: textTheme.titleLarge,),),Center(child: Text('Third Page',style: textTheme.titleLarge,),),],),PageIndicator(tabController: _tabController,currentPageIndex: _currentPageIndex,onUpdateCurrentPageIndex: _updateCurrentPageIndex,isOnDesktopAndWeb: _isOnDesktopAndWeb,)],);}void _handlePageViewChanged(int currentPageIndex) {Logger(TAG).info('_handlePageViewChanged called! currentPageIndex=$currentPageIndex');if (!_isOnDesktopAndWeb) {return;}_tabController.index = currentPageIndex;setState(() {_currentPageIndex = currentPageIndex;});}void _updateCurrentPageIndex(int index) {Logger(TAG).info('_updateCurrentPageIndex called! index=$index');_tabController.index = index;_pageViewController.animateToPage(index,duration: const Duration(microseconds: 400 * 2), curve: Curves.linear);}bool get _isOnDesktopAndWeb {if (kIsWeb) {return true;}switch (defaultTargetPlatform) {case TargetPlatform.macOS:case TargetPlatform.linux:case TargetPlatform.windows:return true;case TargetPlatform.android:case TargetPlatform.iOS:case TargetPlatform.fuchsia:return false;}}
}class PageIndicator extends StatelessWidget {const PageIndicator({super.key,required this.tabController,required this.currentPageIndex,required this.onUpdateCurrentPageIndex,required this.isOnDesktopAndWeb});final int currentPageIndex;final TabController tabController;final void Function(int) onUpdateCurrentPageIndex;final bool isOnDesktopAndWeb;Widget build(BuildContext context) {if (!isOnDesktopAndWeb) {return const SizedBox();}final ColorScheme colorScheme = Theme.of(context).colorScheme;return Padding(padding: const EdgeInsets.all(8.0),child: Row(mainAxisAlignment: MainAxisAlignment.center,children: [IconButton(splashRadius: 16.0,padding: EdgeInsets.zero,onPressed: () => {if (currentPageIndex == 0){}else{onUpdateCurrentPageIndex(currentPageIndex - 1)}},icon: const Icon(Icons.arrow_left_rounded,size: 32.0,)),TabPageSelector(controller: tabController,color: colorScheme.surface,selectedColor: colorScheme.primary,),IconButton(splashRadius: 16.0,padding: EdgeInsets.zero,onPressed: () => {if (currentPageIndex == 2){}else{onUpdateCurrentPageIndex(currentPageIndex + 1)}},icon: const Icon(Icons.arrow_right_rounded,size: 32.0,)),],),);}
}

事实就是官方代码,不过有点细微差别
有解决动画效果的回复一下蛤!

还差一个拖动边界框改变 widget 的宽高效果;

========END

http://www.yayakq.cn/news/784219/

相关文章:

  • 视频网站怎么做高州市荷花镇网站建设
  • 泰安市建设职工培训中心网站官网事业单位网站备案流程
  • 素马网站建设费用差距手工灯笼简单又好看
  • 做公司 网站建设百度网盘电话人工服务
  • 沈阳设计网站公司哪家好一直免费的服务器万能视频播放器
  • 建站服务搭建的页面时爱生活辽宁移动app
  • 深圳专业网站建设企业免费dw设计成品网页
  • 英文网站怎么切换中文售卖链接
  • seo的网站建设大连外贸网站制作
  • 网站开发流程电话网站建设廾金手指专业壹陆
  • 网站做的一样算侵权吗做网站公司宁波
  • 三门峡建设环境局网站宁国市城乡与住房建设网站
  • 门户网站的门户思维有什么特点wordpress动态页面 收录
  • 在线教育网站开发方案wordpress缓存数据库
  • 万网域名怎样把淘宝网站加进去肥城网站建设价格
  • 用什么语言来做网站莱芜吧诚意带大家修车
  • 如何做关于旅游的网站页面简单5步_制作wordpress留言板
  • 魔方的网站成都软件开发培训机构
  • 东莞建设教育网站小程序二维码怎么生成
  • 网站如何留住用户买完域名网站怎么设计
  • 怎么看一个网站有没有做301我自己做的网站打开很慢
  • 建设银行网站在哪里修改支付密码我和宠物做朋友教案小精灵网站
  • 网站和微信同步建设公司注册地址跟经营地址不一样
  • wordpress怎么看代码郑州企业网站排名优化方法
  • 那个网站可以做域名跳转的南山网站设计线
  • 唐山网站制作app静态网站制作模板
  • 网站建设中采用的技术深圳南山区网站建设公司
  • php 网站开发收费做的较好的拍卖网站
  • 怎么下载网站源码做公司网站哪家 上海
  • 中铝长城建设有限公司网站客户管理系统app下载