我的Flutter Project结构是这样的
Main() //Run App with MaterialApp and Routes
L HomePage() //Default route (/), with BottomNavigation
L MoviesPage() //Default BottomNavigation Index and shows a list of movies form TMDB
L DetailsPage()
L SeriesPage()
L SupportPage()
Run Code Online (Sandbox Code Playgroud)
单击任何电影后,它将向前导航到DetailsPage(),但是当我从DetailsPage()调用Navigator.pop时,它应该返回上一个屏幕,但没有。
Navigator.canPop(context)返回false,但是硬件后退按钮工作正常,那么如何解决呢?
主镖
class BerryMain extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return MaterialApp(
home: Inferno(
{
'/': (context, argumets) => HomePage(),
'/detailspage': (context, arguments) => DetailsPage(arguments),
},
).home(context),
);
}
}
Run Code Online (Sandbox Code Playgroud)
主页
class HomePage extends StatefulWidget {
@override
State<StatefulWidget> …Run Code Online (Sandbox Code Playgroud) 当 Flutter beta v1.0.0 发布时,我离开了我的 Flutter 项目一段时间。现在我将我的项目移动到一个带有最新 Flutter(稳定版 v1.2.1)和 Dart 的新系统,并遇到了这个构建异常问题。
请注意,此项目在我下面的旧桌面 flutter doctor 输出上运行良好
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel beta, v1.0.0, on Linux, locale en_GB.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[?] Android Studio (version 3.2)
? Flutter plugin not installed; this adds Flutter specific functionality.
? Dart plugin not installed; this adds …Run Code Online (Sandbox Code Playgroud) 编辑:答案是您需要提供特定高度或将 ListView shrinkWrap 属性设置为 true,否则 listView 具有无限高度,这就是渲染库给出异常的原因。
我正在尝试嵌套 ListView,但不幸的是,RENDER LIBRARY 出现异常。我尝试了多种从现有引用中嵌套 ListViews 的方法,但我所做的只是让我自己感到困惑。
如您所见,这是该应用程序的概念设计。我正在尝试为流派和演员添加新的 listview.builder,然后添加按钮。
文件的要点链接:https : //gist.github.com/purplecandy/279364f2a229ee3120a4b7474123dba9
实际上我遇到了不同类型的错误:/因为我正在尝试不同的实现。这是来自当前的实现
I/flutter ( 2244): ??? EXCEPTION CAUGHT BY RENDERING LIBRARY ??????????????????????????????????????????????????????????
I/flutter ( 2244): The following assertion was thrown during performLayout():
I/flutter ( 2244): 'package:flutter/src/rendering/viewport.dart': Failed assertion: line 1598 pos 16:
I/flutter ( 2244): 'constraints.hasBoundedHeight': is not true.
I/flutter ( 2244):
I/flutter ( 2244): Either the assertion indicates an error in the framework itself, or we should provide substantially …Run Code Online (Sandbox Code Playgroud) <script>
import TypeIt from "typeit";
export let name;
new TypeIt('#simpleUsage', {
strings: 'This is a simple string.',
speed: 50,
waitUntilVisible: true
}).go();
</script>
<style>
h1 {
color: purple;
}
</style>
<h1>
Hello
<span id="name"></span>
</h1>
<p id="simpleUsage"></p>
Run Code Online (Sandbox Code Playgroud)
我成功导入了typeit npm模块,没有错误登录到控制台,但仍然无法正常工作。
我肯定尝试过webpack和汇总。
我知道我很专一,但是任何人都可以在这里帮助我。我是新手,没有任何错误登录到控制台,很难找到问题。