小编Sae*_*Kim的帖子

Flutter 错误:任务 ':app:compileFlutterBuildDebug 执行失败

我重新安装了 flutter 并尝试再次加载我的应用程序,但加载时遇到问题。我已经尝试了三天,甚至重新安装了我的窗口和所有程序,但我没有任何运气。任何人都可以帮我解决这个问题吗?

\n

您可以在https://github.com/bagmk/StartUp_Project/tree/master/fluttershare-master上访问我的文件

\n

主程序.dart

\n
import \'package:firebase_core/firebase_core.dart\';\nimport \'package:flutter/material.dart\';\nimport \'package:fluttershare/pages/home.dart\';\n\nvoid main() async {\n  WidgetsFlutterBinding.ensureInitialized();\n  await Firebase.initializeApp();\n  runApp(MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      title: \'Barter\',\n      debugShowCheckedModeBanner: false,\n      theme:\n          ThemeData(primarySwatch: Colors.deepPurple, accentColor: Colors.teal),\n      home: Home(),\n    );\n  }\n}\n
Run Code Online (Sandbox Code Playgroud)\n

pubspec.yaml

\n
name: fluttershare\ndescription: A new Flutter project.\n\n# The following defines the version and build number for your application.\n# A version number is three numbers separated by dots, like 1.2.43\n# followed by an optional build …
Run Code Online (Sandbox Code Playgroud)

gradle build.gradle visual-studio-code flutter

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

Stream Builder加载更多数据

我试图在到达流构建器的末尾后加载更多数据,每次到达末尾时,流构建器都会重新加载并弹回到开头,并且它不允许我向下滚动(保持重新加载并弹回到开头)顶端)。

我尝试的是一旦到达终点,增加火力的限制,但我不确定问题是什么..任何人都可以帮助我吗?

这是我想要做的示例代码

  _onEndScroll(ScrollMetrics metrics) {
    //loadToTrue();
    setState(() {
      documentLimit = documentLimit + 10;
    });
  }



 StreamBuilder(
              initialData: cache,
              stream: FirebaseFirestore.instance
                      .collection("timeline")
                      .doc(widget.currentUser.id)
                      .collection('timelinePosts')
                      .orderBy('timestamp', descending: true)
                      .limit(documentLimit)
                      .snapshots(),
              builder: (BuildContext context,
                  AsyncSnapshot<QuerySnapshot> streamSnapshot) {
                items = streamSnapshot.data != null &&
                        streamSnapshot.data.docs != null
                    ? streamSnapshot.data.docs
                    : [];

                List<Post> posts =
                    items.map((doc) => Post.fromDocument(doc)).toList();


                cache = streamSnapshot.data;

                return !streamSnapshot.hasData ||
                        streamSnapshot.connectionState ==
                            ConnectionState.waiting
                    ? Center(
                        child: CircularProgressIndicator(),
                      )
                    : NotificationListener<ScrollNotification>(
                        onNotification: (scrollNotification) {
                          if (scrollNotification is ScrollEndNotification) {
                            _onEndScroll(scrollNotification.metrics);
                          } …
Run Code Online (Sandbox Code Playgroud)

firebase flutter google-cloud-firestore stream-builder

0
推荐指数
1
解决办法
1727
查看次数