- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
这是错误:
I/flutter ( 736): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 736): The following assertion was thrown during performResize():
I/flutter ( 736): Horizontal viewport was given unbounded height.
I/flutter ( 736): Viewports expand in the cross axis to fill their container and constrain their children to match
I/flutter ( 736): their extent in the cross axis. In this case, a horizontal viewport was given an unlimited amount of
I/flutter ( 736): vertical space in which to expand.
这是代码:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'PayMart',
theme: new ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or press Run > Flutter Hot Reload in IntelliJ). Notice that the
// counter didn't reset back to zero; the application is not restarted.
primaryColor: Colors.blue,
primaryColorDark:Colors.blueAccent ,
accentColor: Colors.blue,
),
home: new MyTabs(),
);
}
}
class MyTabs extends StatefulWidget{
@override
MyTabsState createState() => new MyTabsState();
}
class MyTabsState extends State<MyTabs> with SingleTickerProviderStateMixin {
int _index;
PageController _pageController;
@override
void initState() {
// TODO: implement initState
super.initState();
_index = 0;
_pageController = new PageController(initialPage: 0,viewportFraction: 1.0);
}
@override
Widget build(BuildContext context) {
// TODO: implement build
return new Scaffold(
appBar: new AppBar(
title: new Text("PayMart"),
actions: <Widget>[
new FlatButton(onPressed: null, child: new Text("R247.50",style: new TextStyle(color: Colors.white,decorationStyle: TextDecorationStyle.wavy),)),
//new IconButton(icon: new Icon(null, color: Colors.white), onPressed: null),
new IconButton(icon: new Icon(Icons.add_circle_outline,color: Colors.white), onPressed: null)
],
centerTitle: false,
),
drawer: new Drawer(
// Add a ListView to the drawer. This ensures the user can scroll
// through the options in the Drawer if there isn't enough vertical
// space to fit everything.
child: new ListView(
// Important: Remove any padding from the ListView.
padding: EdgeInsets.zero,
children: <Widget>[
new DrawerHeader(
child: new Text('Drawer Header'),
decoration: new BoxDecoration(
color: Colors.blue,
),
),
new ListTile(
title: new Text('Item 1'),
leading: new Icon(Icons.language),
onTap: () {
// Update the state of the app
// ...
},
),
new ListTile(
title: new Text('Item 2'),
onTap: () {
// Update the state of the app
// ...
},
),
],
),
),
body: new Column(children: <Widget>[
new PageView(children: <Widget>[
new Container(child:
new GridView.count(
children: <Widget>[
new FlatButton(onPressed: null,
child: new Column( children: <Widget>[
new Icon(Icons.person,color: Colors.deepOrangeAccent,),
new Text("Hello"),
],
)
),
new FlatButton(onPressed: null,
child: new Column( children: <Widget>[
new Icon(Icons.person,color: Colors.tealAccent,),
new Text("Hello"),
],
)
),
new FlatButton(onPressed: null,
child: new Column( children: <Widget>[
new Icon(Icons.person,color: Colors.deepOrange,),
new Text("Hello"),
],
)
),
new FlatButton(onPressed: null,
child: new Column( children: <Widget>[
new Icon(Icons.person),
new Text("Hello"),
],
)
),
new FlatButton(onPressed: null,
child: new Column( children: <Widget>[
new Icon(Icons.person),
new Text("Hello"),
],
)
),
new FlatButton(onPressed: null,
child: new Column( children: <Widget>[
new Icon(Icons.person),
new Text("Hello"),
],
)
),
new FlatButton(onPressed: null,
child: new Column( children: <Widget>[
new Icon(Icons.person),
new Text("Hello"),
],
)
),
new FlatButton(onPressed: null,
child: new Column( children: <Widget>[
new Icon(Icons.person),
new Text("Hello"),
],
)
),
],
crossAxisCount: 4,
childAspectRatio: 1.5,
padding: const EdgeInsets.all(4.0),
mainAxisSpacing: 0.0,
crossAxisSpacing: 4.0,
shrinkWrap: true,
)
),
new Container(color: Colors.brown,),
new Container(color: Colors.amber,),
new Container(color: Colors.deepOrangeAccent,),
new Container(color: Colors.purpleAccent,)
],
controller: _pageController,
),
]),
bottomNavigationBar: new Stack(
children: <Widget>[
new Positioned(child: new BottomNavigationBar(
fixedColor: Colors.blueAccent,
type: BottomNavigationBarType.fixed,
currentIndex: _index,
onTap: (int _index) {
setState(() {
this._index = _index;
_pageController.animateToPage(_index,
duration: new Duration(milliseconds: 300),
curve: Curves.easeIn);
});
},
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(icon: new Icon(Icons.home), title: new Text("Home")),
new BottomNavigationBarItem(icon: new Icon(Icons.access_alarm), title: new Text("Transactions")),
new BottomNavigationBarItem(icon: new Icon(Icons.play_arrow), title: new Text("Pay")),
new BottomNavigationBarItem(icon: new Icon(Icons.language), title: new Text("Requests")),
new BottomNavigationBarItem(icon: new Icon(Icons.account_balance_wallet), title: new Text("Wallet"))
],
),),
new Positioned.directional(
child: new FloatingActionButton(
onPressed: null,
child:new Icon(Icons.filter_center_focus,size: 24.0,),
mini: false,
),
textDirection: TextDirection.ltr,
bottom: 0.0,
),
new Positioned.directional(
textDirection: TextDirection.ltr,
child: new Text("scan",style: new TextStyle(color: Colors.white,fontSize: 12.0),),
bottom: 6.0,
)
],
alignment: Alignment.bottomCenter,
)
);
}
}
最佳答案
在您的具体情况下,我只是建议删除包装 Column
,因为它只有一个子部件。
无论如何,要在不触及包装 Column
的情况下解决这个问题,您可以用 Expanded 包围您的 PageView
或 Flexible小部件。 PageView
的高度未知,因为它的高度取决于它的子项。因此它不能放在 Column 中。无需将其包装在上述小部件之一中。
关于dart - 如何将 flutter PageView 放入列或行中?当我这样做时,我收到以下错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49765219/
我有一个关于 JavaScript 语法的问题。实际上,我在自学 MEAN 堆栈教程时想出了编码(https://thinkster.io/mean-stack-tutorial#adding-aut
在我的书中它使用了这样的东西: for($ARGV[0]) { Expression && do { print "..."; last; }; ... } for 循环不完整吗?另外,do 的意义何
我已经编写了读取开关状态的代码,如果按 3 次 # 则退出。 void allkeypadTest(void) { static uint8_t modeKeyCount=0; do
因此,对于上周我必须做的作业,我必须使用 4 个 do-while 循环和 if 语句在 Java 中制作一个猜谜游戏。我无法成功完成它,类(class)已经继续,没有为我提供任何帮助。如果有人可以查
int i=1,j=0,n=10,k; do{ j+=i; i<<1; printf("%d\n",i); // printf("%d\n",12<<1); }while
此代码用于基本杂货计算器的按钮。当我按下按钮时,一个输入对话框会显示您输入商品价格的位置。我遇到的问题是我无法弄清楚如何获得 do ... while 循环以使输入对话框在输入后弹出。 我希望它始终恢
当我在循环中修改字符串或另一个变量时,它的条件是否每次都重新计算?或者在循环开始前一次 std::string a("aa"); do { a = "aaaa"; } while(a.size<10)
我刚刚写了这个,但我找不到问题。我使用代码块并编写了这个问题 error: expected 'while' before '{' token === Build finished: 1 errors
do { printf("Enter number (0-6): ", ""); scanf("%d", &Num); }while(Num >= 0 && Num 表示“超过”,<表
我有一个包含 10 个项目的 vector (为简单起见,所有项目都属于同一类,称其为“a”)。我想要做的是检查“A”不是 a) 隐藏墙壁或 b) 隐藏另一个“A”。我有一个碰撞函数可以做到这一点。
嗨,这是我的第二个问题。我有下表 |-----|-------|------|------| |._id.|..INFO.|.DONE.|.LAST.| |..1..|...A...|...N..|.
这个问题在这里已经有了答案: 关闭 12 年前。 Possible Duplicates: Why are there sometimes meaningless do/while and if/e
来自 wikibook在 F# 上有一小部分它说: What does let! do?# let! runs an async object on its own thread, then it i
我在 Real World Haskell 书中遇到了以下函数: namesMatching pat | not (isPattern pat) = do exists do
我有一个类似于下面的用例,我创建了多个图并使用 gridExtra 将它们排列到一些页面布局中,最后使用 ggsave 将其保存为 PDF : p1 % mutate(label2
当我使用具有 for 循环的嵌套 let 语句时,如果没有 (do (html5 ..)),我将无法运行内部 [:tr]。 (defpartial column-settings-layout [&
执行 vagrant up 时出现此错误: anr@anr-Lenovo-G505s ~ $ vagrant up Bringing machine 'default' up with 'virtua
# ################################################# # Subroutine to add data to the table Blas
我想创建一个检查特定日期格式的读取主机。此外,目标是检查用户输入是否正确,如果不正确,则提示应再次弹出。 当我刚接触编程时,发现了这段代码,这似乎很合适。我仍然在努力“直到” do {
我关注这个tutorial在谷歌云机器学习引擎上进行培训。我一步一步地跟着它,但是在将 ml 作业提交到云时我遇到了错误。我运行了这个命令。 sam@sam-VirtualBox:~/models/r
我是一名优秀的程序员,十分优秀!