Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter #4

Open
Ccixyj opened this issue Mar 6, 2018 · 5 comments
Open

flutter #4

Ccixyj opened this issue Mar 6, 2018 · 5 comments

Comments

@Ccixyj
Copy link
Owner

Ccixyj commented Mar 6, 2018

参考 http://blog.csdn.net/hekaiyou/article/details/52874796?locationNum=4&fps=1

@Ccixyj
Copy link
Owner Author

Ccixyj commented Mar 7, 2018

可能有网络问题,考虑直接下载sdk使用。
image

  1. 卡在"resolve dependency" : 网络问题. 添加android 项目的http代理 .在设置中添加cert.

  2. package get
    参考 https://www.colabug.com/3911024.html

@Ccixyj
Copy link
Owner Author

Ccixyj commented Aug 30, 2018

在 Flutter 中使用 MVP 架构

在 Android 开发中有很多设计模式,从 MVC 到 MVP MVVM 等,而在 Flutter 中也可是使用 MVP 模式进行开发,在这篇文章中我们来看一下在 Flutter 中如何使用 MVP 模式开发应用.

@Ccixyj
Copy link
Owner Author

Ccixyj commented Sep 6, 2018

解决 Scaffold.of() called with a context that does not contain a Scaffold.

调用 Scaffold.of(context).showSnackBar(snackBar); 的时候报错
原因:context 及 父对象中不包含 ScaffoldState

解决办法:

  1. 使用 GlobalKey<ScaffoldState>()
   final  sKey = GlobalKey<ScaffoldState>();

   Scaffold(
     key: sKey
   );

   //其他地方
     sKey.currentState.showSnackBar(SnackBar(content: Text("click button ")));
  1. 使用 BuilderStatefulBuilder
   Scaffold(
     body:  Builder(builder: (ctx) {
       return GestureDetector(
         onTap: () {
           Scaffold.of(ctx).showSnackBar(SnackBar(content: Text("click button ")));
         },
         child: Text("clickme"),
       );
     })
   );

@Ccixyj Ccixyj changed the title first flutter app flutter Sep 9, 2018
@Ccixyj
Copy link
Owner Author

Ccixyj commented Sep 19, 2018

TextFieldonChangedcontroller 不能同时使用

onChanged 事件 与 controller 的手动添加事件监听都能监听文本变幻。但是使用 controller 改变文字无法让 onChanged 回调。所以只是用 controller 添加回调的方法。

Handling changes to a text field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant