小编abn*_*h69的帖子

颤动:如何避免改变方向?

我有一个横向最终用户设计.用户不需要/需要肖像,需要避免iOS/Android上的自动方向更改.我怎样才能做到这一点?

orientation flutter

8
推荐指数
2
解决办法
6156
查看次数

如何使用我的用户名和密码将 GitHub 上的私有包添加到我的 pubspec.yaml 中?

我的问题很简单。我可以使用克隆私有 git 存储库

git clone https://my_user_name:my_password@github.com/my_account/my_package.git
Run Code Online (Sandbox Code Playgroud)

现在,如何使用我的用户名和密码将 GitHub 上的私有包添加到我的 pubspec.yaml 中?

dependencies:
  my_package:
    git: https://my_user_name:my_password@github.com/my_account/my_package.git 
Run Code Online (Sandbox Code Playgroud)

就我而言,我正在 IntelliJ IDEA 中使用 Flutter/Dart。但假设该解决方案应该适用于任何环境和其他编程语言。

yaml github package password-protection flutter

7
推荐指数
1
解决办法
3062
查看次数

如何使用buildArguments或其他任何东西在Flutter/FirebaseAnimatedList中查询?(请举例)

我有一个Scaffold身体:

body: new Column(
        children: <Widget>[
          new Flexible(
            child: new FirebaseAnimatedList(
              query: FirebaseDatabase.instance
                  .reference()
                  .child('products')
                  .orderByChild('order'),
              padding: new EdgeInsets.all(8.0),
              reverse: false,
              itemBuilder: (_, DataSnapshot snapshot,
                  Animation<double> animation, int x) {
                return new ProductItem(
                    snapshot: snapshot, animation: animation);
              },
            ),
          ),
        ],
      ),
Run Code Online (Sandbox Code Playgroud)

但我需要添加一个简单的查询: 'Active' = true

可能吗?怎么样?任何示例/教程?

谢谢.

dart firebase firebase-realtime-database flutter

6
推荐指数
1
解决办法
5255
查看次数

颤振布局:如何在Flutter中的Flex(或另一行)中放置一行?还使用Stack小部件

我需要在一行中放入2个组合小部件:

组合小部件名为"boxText".我需要它两次,每个都在一个边框内有两个文本和一个TextFormField,如:

Stack
  Image and others
  Form
    Row or Flex or Whatever:
    +------------------------------+    +------------------------------+
    | Text  Text TextFormField     |    | Text Text  TextFormField     |
    +------------------------------+    +------------------------------+
Run Code Online (Sandbox Code Playgroud)

我的代码(和眼泪):重要:只有在添加TextFormField时才会发生异常.

@override小部件构建(BuildContext context){

// Composed Widget
Widget boxText = new Container(
  decoration: new BoxDecoration(
    border: new Border.all(
      color: Colors.cyan[100],
      width: 3.0,
      style: BorderStyle.solid,
    ),
  ),
  margin: new EdgeInsets.all(5.0),
  padding: new EdgeInsets.all(8.0),
  child: new Row(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: <Widget>[
      new Text(
        'Text',
        style: null,
      ),
      new Text(
        'Text',
        style: null,
      ),
      new TextFormField(
        decoration: const …
Run Code Online (Sandbox Code Playgroud)

forms layout row flutter

5
推荐指数
1
解决办法
1万
查看次数

Flutter:如何将来自firebase的Future数据加载到GridView?

大家好(喜欢Flutter的人),

这很简单(但我不知道如何).

我在Firebase数据库中有动态菜单选项.我需要在GridView中向最终用户显示它.

我有一个Future列表(让我们说Future>)从Firebase数据中返回一个列表:

static Future<List<Menu>> list() async {
    List<Menu> _list = new List();
    await drMenues.onValue.listen((event) {
      Menu _menu = new Menu();
      _menu.desdeData(event.snapshot);
      _list.add(_menu);
    });
    return _list;
  }
Run Code Online (Sandbox Code Playgroud)

现在,我需要使用这些菜单选项填充GridView.

final datosMenues = list();
...
new GridView.count(
  crossAxisCount: (orientation == Orientation.portrait) ? 3 : 4,
  childAspectRatio: (orientation == Orientation.portrait) ? 1.0 : 1.3,
      children: datosMenues.then
...
Run Code Online (Sandbox Code Playgroud)

我需要一些帮助来完成它.我知道我需要一个"那么"因为是未来的名单.

请问任何建议?

gridview dart firebase-realtime-database flutter

4
推荐指数
2
解决办法
4808
查看次数