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

企业网站制作教程视频/营销型网站的公司

企业网站制作教程视频,营销型网站的公司,网站建设图库,珠海网站建设贵公司1、键盘弹起不会压缩页面(页面不会跟键盘弹出相应布局) Scaffold(resizeToAvoidBottomPadding: false,child: TextField())2、点击其他位置取消输入框焦点 Scaffold(// resizeToAvoidBottomPadding: false,body: GestureDetector(behavior: HitTestBeh…

1、键盘弹起不会压缩页面(页面不会跟键盘弹出相应布局)

Scaffold(resizeToAvoidBottomPadding: false,child: TextField())

2、点击其他位置取消输入框焦点

Scaffold(// resizeToAvoidBottomPadding: false,body: GestureDetector(behavior: HitTestBehavior.translucent,onTap: () {// 触摸收起键盘FocusScope.of(context).requestFocus(FocusNode());},child: TextField()
))

3、返回键获取

WillPopScope(onWillPop: () {// 关闭上文close(context);// 返回一个false到then中return Future.value(false);},child: Container()
)

4、复杂多动画简单动画函数示例

class TestPage extends StatefulWidget{@overrideTestPageState createState() {return new TestPageState();}
}
class TestPageState extends State<TestPage>with TickerProviderStateMixin {AnimationController _controller;Animation _animation;Animation _curve;double _top = 0.0;void startAnimation(end) {_controller = AnimationController(duration: const Duration(milliseconds: 400),debugLabel: 'preview banner',vsync: this,);_curve = CurvedAnimation(curve: Curves.easeOut, parent: _controller);_animation = Tween(begin: _top,end:end,).animate(_curve)..addListener((){setState((){//刷新重要_top = _animation.value;});})..addStatusListener((AnimationStatus status) {});// 运动_controller.forward();}@overridevoid initState() {startAnimation();super.initState();}@overrideWidget build(BuildContext context) {return Scaffold(body: SizedBox.expand(child: Stack(children: [RaisedButton(child: Text('点我'),onPressed(){startAnimation(_top + 50.0);}),Position(right: 40.0,top: _top,Container(color: Colors(0xffaaaaaa),height:50.0,width:50.0))])));}
}

5、简单动画简单示例

class TestPage extends StatefulWidget{@overrideTestPageState createState() {return new TestPageState();}
}
class TestPageState extends State<TestPage>with SingleTickerProviderStateMixin {AnimationController _controller;Animation _animation;Animation _curve;double _top = 50.0@overridevoid initState() {_controller = AnimationController(duration: const Duration(milliseconds: 400),debugLabel: 'preview banner',vsync: this,);_curve = CurvedAnimation(curve: Curves.easeOut, parent: _controller);startAnimation(50.0);super.initState();}void startAnimation(end) {_animation = Tween(begin: _top,end:end,).animate(_curve)..addListener((){//重要_top = _animation.value;})..addStatusListener((AnimationStatus status) {});_controller.forward();}
//  ......
}

6、自己写数据通讯,应该怎么写?

/// 定义控制器
import 'package:flutter/foundation.dart';class counterController<T> extends ValueNotifier<List<T>> {counterController(this.value) : super(value);counterController.fromValue(List<T> value) : super(value ?? List<T>());List<T> value;/// Set the controller to only contain this imagesetOne(index,T value) {value[index] = value;notifyListeners();}addOne(T value) {value.add(value);notifyListeners();}
}
/// 使用
/// statefulwidget下监听(记得取消监听)
initState() {controller?.addListener((){if (_effectiveController.value != value)didChange(_effectiveController.value);});
}/// 渲染(直接使用controller)
controller.value/// 触发
controller.addOne(123);

7、绑定成功后返回某个widget的高度

  /// 新建一个全局keyfinal GlobalKey _boxKey = GlobalKey();@overridevoid initState() {super.initState();/// 这里就是重点,挂载完毕后回调到getBoxHeight函数WidgetsBinding.instance.addPostFrameCallback(getBoxHeight);}Container(key: _boxKey)
http://www.jmfq.cn/news/5176747.html

相关文章:

  • 上海做网站推荐/谷歌海外推广
  • 做网站做推广/百度seo优化怎么做
  • 网站建站案例/南阳网站seo
  • 专业营销的网站建设公司/软文写作案例
  • 做招聘长图用什么网站/免费顶级域名注册
  • 北京酒店团购网站建设/营销网站有哪些
  • 里水九江网站建设/郑州网络推广公司排名
  • php 做视频网站/百度账号登录官网
  • wordpress一键拨号/沈阳关键字优化公司
  • 可以用AI做网站上的图吗/滁州网站seo
  • win系统安装wordpress/百度seo查询
  • 深圳福田大型商城网站建设/厦门网站推广公司哪家好
  • 某俄文网站/必应搜索引擎下载
  • 福建泉州网站建设公司哪家好/seo推广任务小结
  • 新乡百度网站推广工具/百度刷排名优化软件
  • 三亚文明城市建设服务中心报名网站/苏州seo优化
  • 营销型网站策划建设/哪里可以做
  • 公司做网站走什么费/品牌运营包括哪些内容
  • 六安网站/企业推广托管
  • 好看的企业网站源码/西安网络推广优化培训
  • 专业的网站建设公司/杭州网站seo外包
  • wordpress一句话木马/专业网站优化培训
  • java网站开发步骤/网络舆情监测中心
  • 可以免费投放广告的平台/泰州seo推广公司
  • 安徽合肥市城乡建设委员会网站/新媒体营销推广方案
  • 大连龙彩科技的网站在谁家做/广州seo优化费用
  • 网站如何做网站解析/郑州网站推广公司排名
  • 英文字体设计网站/开发一个app平台大概需要多少钱?
  • 商丘做建设网站的公司/软文投稿平台有哪些
  • 兄弟网站制作/站长工具seo综合查询官网