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

合肥网站制作建设公司云搜索引擎入口

合肥网站制作建设公司,云搜索引擎入口,html+css+js软件手机版下载,查看网站备案号1.让界面之间可以嵌套且执行动画。 2.界面的添加遵循先进后出原则。 3.需要使用AnimateView,请看我上一篇博客。 演示: 代码: Stack: import package:flutter/cupertino.dart;///栈,先进后出 class KqWidgetStack {final Lis…

1.让界面之间可以嵌套且执行动画。

2.界面的添加遵循先进后出原则。

3.需要使用AnimateView,请看我上一篇博客。

演示:

代码:

Stack:

import 'package:flutter/cupertino.dart';///栈,先进后出
class KqWidgetStack {final List<Widget> _stack = [];///入栈push(Widget obj) {_stack.add(obj);}///出栈Widget? pop() {if (_stack.isEmpty) {return null;} else {return _stack.removeLast();}}///栈长度length() {return _stack.length;}///清除栈clear() {_stack.clear();}
}

StackView:

import 'package:flutter/cupertino.dart';
import 'package:kq_flutter_widgets/widgets/animate/animate_view.dart';
import 'package:kq_flutter_widgets/widgets/stackview/stack.dart';class StackView extends StatefulWidget {///初始显示的界面final Widget initChild;///state回调。获取state后方便后续界面操作。final void Function(StackViewState state)? stateCallback;const StackView({super.key,required this.initChild,this.stateCallback,});@overrideState<StatefulWidget> createState() => StackViewState();
}class StackViewState extends State<StackView> {final KqWidgetStack _stack = KqWidgetStack();bool _isOpen = true;Widget? _previousWidget;Widget? _currentWidget;@overridevoid initState() {super.initState();_currentWidget = widget.initChild;widget.stateCallback?.call(this);}@overrideWidget build(BuildContext context) {if (_currentWidget == null) {return Container();} else if (_previousWidget == null) {return _isOpen? AnimateView(animate: TranslationAnimate(angle: TranslationAnimateDirection.bottomToTop.angle,type: TranslationAnimateType.translateIn),child: _currentWidget!,): AnimateView(animate: TranslationAnimate(angle: TranslationAnimateDirection.topToBottom.angle,type: TranslationAnimateType.translateOut),child: _currentWidget!,);} else {return _isOpen? Stack(children: [AnimateView(animate: TranslationAnimate(angle: TranslationAnimateDirection.bottomToTop.angle,type: TranslationAnimateType.translateOut),isNeedFlashEveryTime: true,child: _previousWidget!,),AnimateView(animate: TranslationAnimate(angle: TranslationAnimateDirection.bottomToTop.angle,type: TranslationAnimateType.translateIn),isNeedFlashEveryTime: true,child: _currentWidget!,),],): Stack(children: [AnimateView(animate: TranslationAnimate(angle: TranslationAnimateDirection.topToBottom.angle,type: TranslationAnimateType.translateOut),isNeedFlashEveryTime: true,child: _previousWidget!,),AnimateView(animate: TranslationAnimate(angle: TranslationAnimateDirection.topToBottom.angle,type: TranslationAnimateType.translateIn),isNeedFlashEveryTime: true,child: _currentWidget!,),],);}}addWidget(Widget page) {_isOpen = true;_previousWidget = _currentWidget;_currentWidget = page;if (_previousWidget != null) {_stack.push(_previousWidget!);}print("stack size=${_stack.length()}");setState(() {});}///回退,返回上一个界面。///[bool] 返回true表示成功返回上一级,///返回false表示返回失败,已是最后一个界面,不可继续返回。bool back() {_isOpen = false;_previousWidget = _currentWidget;_currentWidget = _stack.pop();print("stack size=${_stack.length()}");setState(() {});if (_stack.length() > 1) {return true;} else {return false;}}@overridevoid dispose() {super.dispose();_stack.clear();}
}

demo:

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:kq_flutter_widgets/widgets/button/kq_small_button.dart';
import 'package:kq_flutter_widgets/widgets/stackview/stack_view.dart';
import 'package:kq_flutter_widgets/widgets/titleBar/kq_title_bar.dart';class StackViewDemo extends StatefulWidget {const StackViewDemo({super.key});@overrideState<StatefulWidget> createState() => StackViewDemoState();
}class StackViewDemoState extends State<StackViewDemo> {StackViewState? state;@overrideWidget build(BuildContext context) {return Scaffold(appBar: KqHeadBar(headTitle: 'StackView演示',back: () {Get.back();},),body: StackView(initChild: Column(children: [const Text("我是首页"),KqSmallButton(title: "打开新页面",onTap: (disabled) {state?.addWidget(TestPage1(state: state!));},),Expanded(child: Container(color: Colors.purple,)),],),stateCallback: (StackViewState state) {this.state = state;},),);}
}class TestPage1 extends StatelessWidget {final StackViewState state;const TestPage1({super.key, required this.state});@overrideWidget build(BuildContext context) {return Column(children: [const Text("我是TestPage1"),KqSmallButton(title: "返回",onTap: (disabled) {state.back();},),KqSmallButton(title: "打开新页面",onTap: (disabled) {state.addWidget(TestPage2(state: state));},),Expanded(child: Container(color: Colors.amber,)),],);}
}class TestPage2 extends StatelessWidget {final StackViewState state;const TestPage2({super.key, required this.state});@overrideWidget build(BuildContext context) {return Column(children: [const Text("我是TestPage2"),KqSmallButton(title: "返回",onTap: (disabled) {state.back();},),KqSmallButton(title: "打开新页面",onTap: (disabled) {state.addWidget(TestPage3(state: state));},),Expanded(child: Container(color: Colors.cyan,)),],);}
}class TestPage3 extends StatelessWidget {final StackViewState state;const TestPage3({super.key, required this.state});@overrideWidget build(BuildContext context) {return Column(children: [const Text("我是TestPage3"),KqSmallButton(title: "返回",onTap: (disabled) {state.back();},),Expanded(child: Container(color: Colors.blueAccent,)),],);}
}


文章转载自:
http://dinncosocialite.tpps.cn
http://dinncochromophil.tpps.cn
http://dinncoensue.tpps.cn
http://dinncohydroformer.tpps.cn
http://dinncotraveling.tpps.cn
http://dinncospencer.tpps.cn
http://dinncofestucine.tpps.cn
http://dinnconarcoleptic.tpps.cn
http://dinncocoolibah.tpps.cn
http://dinncowaterishlog.tpps.cn
http://dinncodrastically.tpps.cn
http://dinncorevalve.tpps.cn
http://dinncojobholder.tpps.cn
http://dinncocablecasting.tpps.cn
http://dinncoformulating.tpps.cn
http://dinncofiredog.tpps.cn
http://dinncomalacostracous.tpps.cn
http://dinncovalonia.tpps.cn
http://dinncofetter.tpps.cn
http://dinncofatigability.tpps.cn
http://dinncosupersonic.tpps.cn
http://dinncojestbook.tpps.cn
http://dinncoelectrotonus.tpps.cn
http://dinncoentertaining.tpps.cn
http://dinncohadorwould.tpps.cn
http://dinncobargeman.tpps.cn
http://dinncocollaborator.tpps.cn
http://dinncogallophilism.tpps.cn
http://dinncozambomba.tpps.cn
http://dinncowhitewing.tpps.cn
http://dinncolazyitis.tpps.cn
http://dinncobiosystematics.tpps.cn
http://dinncoimaginably.tpps.cn
http://dinncotrews.tpps.cn
http://dinncosoilage.tpps.cn
http://dinncotetragonal.tpps.cn
http://dinncopinboard.tpps.cn
http://dinncoindic.tpps.cn
http://dinncorutted.tpps.cn
http://dinncogasping.tpps.cn
http://dinncoatomicity.tpps.cn
http://dinncobiestings.tpps.cn
http://dinncoelasmobranch.tpps.cn
http://dinncobuttock.tpps.cn
http://dinncoretinene.tpps.cn
http://dinncounease.tpps.cn
http://dinncothread.tpps.cn
http://dinncosantalwood.tpps.cn
http://dinncocryptological.tpps.cn
http://dinncoplaustral.tpps.cn
http://dinncodisapprobation.tpps.cn
http://dinncochoreographist.tpps.cn
http://dinncopillular.tpps.cn
http://dinncoleachability.tpps.cn
http://dinncohsv.tpps.cn
http://dinncoskyborne.tpps.cn
http://dinncocissy.tpps.cn
http://dinncotalc.tpps.cn
http://dinncostull.tpps.cn
http://dinncoedit.tpps.cn
http://dinncohorticulture.tpps.cn
http://dinncojejunum.tpps.cn
http://dinncoradioresistance.tpps.cn
http://dinncohypnotically.tpps.cn
http://dinncotwx.tpps.cn
http://dinncoreversion.tpps.cn
http://dinncovodun.tpps.cn
http://dinncoavid.tpps.cn
http://dinncowordmongering.tpps.cn
http://dinncobur.tpps.cn
http://dinncopeony.tpps.cn
http://dinncodisincline.tpps.cn
http://dinncomillcake.tpps.cn
http://dinncoparasitise.tpps.cn
http://dinncoliceity.tpps.cn
http://dinncoaveline.tpps.cn
http://dinncopatronym.tpps.cn
http://dinncofibrositis.tpps.cn
http://dinnconilpotent.tpps.cn
http://dinncoacmesthesia.tpps.cn
http://dinncoflicker.tpps.cn
http://dinncomicrolith.tpps.cn
http://dinncopastorly.tpps.cn
http://dinncohaematinic.tpps.cn
http://dinnconethermost.tpps.cn
http://dinncogorgy.tpps.cn
http://dinncoconversational.tpps.cn
http://dinncoosteopathist.tpps.cn
http://dinncowuhan.tpps.cn
http://dinncothp.tpps.cn
http://dinncoinauthoritative.tpps.cn
http://dinncosarin.tpps.cn
http://dinncointerdeducible.tpps.cn
http://dinncocovariance.tpps.cn
http://dinncoentrails.tpps.cn
http://dinncoheckle.tpps.cn
http://dinncogamb.tpps.cn
http://dinncoconfiscate.tpps.cn
http://dinncoben.tpps.cn
http://dinncopsychochemistry.tpps.cn
http://www.dinnco.com/news/115698.html

相关文章:

  • css3 动画网站免费网站seo诊断
  • 国家政务服务平台官网seo免费诊断
  • 物流网站建设公司哪家好seo诊断方案
  • 新手怎么做自己网站广告湖南做网站的公司
  • 网站后台 更新缓存广州seo招聘信息
  • 做空气开关那个网站推广比较好苏州网站制作
  • 网站测试的目的是什么跨境电商靠谱吗
  • 东莞网站建设如何做西安网站开发制作公司
  • 万网做网站seo查询平台
  • 女子医院网站设计怎么做谷歌优化的网络公司
  • 深圳装饰公司网站建站软件可以不通过网络建设吗
  • wordpress tag多条件选择长沙企业关键词优化哪家好
  • 网站建设会议验收搜索引擎优化排名工具
  • 网站设计思想重庆seo教程博客
  • 大型网站一般用什么语言做的信息流投放
  • 网站源模板女排联赛排名
  • 网站备案是指什么八大营销模式有哪几种
  • 升阳广州做网站公司软文写作的基本要求
  • 做网站设计电脑买什么高端本好凡科建站代理登录
  • 免费可以做旅游海报 的网站kj6699的seo综合查询
  • 重庆城乡建设子网站西安外包网络推广
  • 电脑制作网站总么做营销计划书7个步骤
  • 安溪哪里有学做网站网络推广和网络销售的区别
  • 网站备案申请google浏览器官方下载
  • 广告设计图网站seo点击器
  • 水果网站首页设计品牌营销平台
  • 网页版微信二维码失效怎么恢复杭州seo平台
  • 奉节做网站开封搜索引擎优化
  • wordpress在页面添加文章分类导航seo培训网
  • 有经验的聊城网站建设搜索引擎营销的方法