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

淄博手机网站建设商城网站开发公司

淄博手机网站建设,商城网站开发公司,个人网页介绍,wordpress添加默认头像上效果: 有些不能理解官方例子里的动画为什么没有效果,有可能是我写法不对 后续如果有动画效果修复了,再更新这篇,没有动画效果,总觉得感受的丝滑效果差了很多 上代码: 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.mmbaike.com/news/75736.html

相关文章:

  • 非微信官方网页自己做的网站平台推广引流怎么做
  • 模板网站系统seo每日工作内容
  • 建设旅游业网站目的软文网站平台
  • 做变态手术视频网站国外引擎搜索
  • 英文网站设计哪里好网站优化基本技巧
  • 天津网站优化步骤申请网站域名要多少钱
  • 云南省建设执业资格注册管理中心网站seo外包服务公司
  • 德阳做网站的互联网公司百度网站的网址
  • 企业网站规划书范文自媒体推广渠道
  • 做论坛网站时应该注意什么网络营销的四种方式
  • 烟台网站建设优化怎么做seo网站关键词优化
  • 做lol数据的网站有哪些促销策略
  • 搭建农村电商平台北京网站优化平台
  • 做网站弄关键词多少钱seo推广优化
  • 网站设计十大品牌英语seo什么意思
  • 网站建设 seo西安网
  • 医疗科技网站建设郑州网络营销公司哪个好
  • 商城网站开发 价格汕头网站推广
  • seo关于网站关键词指数查询工具
  • 门户网站是如何做引流的百度热榜排行
  • 福州做网站优化百度的推广方式有哪些
  • 家庭农场网站建设营销助手
  • 网站制作推广公司网站建设报价单
  • 在线做图网站潍坊网站建设方案咨询
  • 做我的奴隶 good网站正规培训机构有哪些
  • 专门做拼团的网站国内seo公司
  • wordpress文章同步插件网站制作优化
  • 孝感应城网站建设优化师助理
  • 北京网站定制开发汕头网站建设公司哪个好
  • 网站推广怎么样搜索引擎关键词优化方案