flutter-layout

Flutter Widgets arrangement and events

依然范特西╮ 提交于 2019-12-11 02:39:28
问题 I am trying to build a form in Flutter, please take a look in the screen image I've made so far: I have few questions regarding this page: How can I align the DropDown buttons (Project and Task) so they will be stretched with the same width and that their icons will be at the same position? Also, How can I decorate them with some kind of border? The input fields Widgets, like Start/Finish and Date, when you click the icon, it will open a Time or Date Picker. I would like that also when user

How to make SliverAppBar listen to botomSheet change

风流意气都作罢 提交于 2019-12-11 00:58:27
问题 I'm working on weather forecast app, which is made with CustomScrollView - SliverAppBar shows selected city and current weather and SliverList shows forecast. Then, using FAB, I open BottomSheet where I change city. Now (after confirm button press) I'd like to update content of the View to new data. Source code 来源: https://stackoverflow.com/questions/57648842/how-to-make-sliverappbar-listen-to-botomsheet-change

Flutter: How to make a ListView transparent to pointer events (but not its non-transparent contents)?

一个人想着一个人 提交于 2019-12-10 22:49:20
问题 I have a Scrollable ( ListView or any other) and it contains a transparent widget, say Container(height:200) . I can see through both the widget and the scrollable (in other words I can see the widgets behind the scrollable). How can I be able to click through the transparent widget and the scrollable, so that I reach the widgets behind the scrollable? ListView( children: [ Container(height: 200), // Transparent. Container(color: Colors.red, height: 200), ], ); Note, I cannot wrap the

Flutter Expansion Tile — Header Color Change, and Trailing Animated Arrow Color Change

和自甴很熟 提交于 2019-12-10 21:29:58
问题 I have used the Expansion Tile to generate a Expansion List View. I'm facing some customization issues in Expansion Tile Header. Below is my code. ExpansionTile( title: Container( child: Text( getCategory(i), style: TextStyle( color: Colors.white, ), ), color: Colors.black ), children: <Widget>[ new Container( height: 60.0, margin: const EdgeInsets.only(top:10.0, left: 10.0, right:10.0, bottom: 10.0), decoration: BoxDecoration( color: Colors.blue, borderRadius: new BorderRadius.all( Radius

Flutter: setState() or markNeedsBuild() called when widget tree was locked… during orientation change

元气小坏坏 提交于 2019-12-10 18:52:47
问题 I want to create a App whose UI can be updated based on device orientation. In Portait layout, i use a drawer to show some elements (Fig.). In Landscape layout, there is no drawer but the elements are showed in a column at left of screen (Fig.). The program works, when the drawer is closed. But when i switch orientation from portait to landscape with drawer opened , i got error of "setState() or markNeedsBuild() called when widget tree was locked" The stack provides this info: Built build\app

Flutter - Text inside an Expanded Widget within a Column overflowing

萝らか妹 提交于 2019-12-10 18:44:20
问题 What I want to achieve is to have a text widget inside a Column of fixed height. When the text is long I want the overflow property which is set to TextOverflow.ellipsis to kick in. The Text widget has its maxLines property set to a high value to allow it to wrap down. But there are other widgets in the column too, both before and after the text widget. The text widget is in an Expanded widget so that it takes up as much room in the column. Full code is pasted below. The problem with this

Flutter: Change text when FlexibleSpaceBar is collapsed

社会主义新天地 提交于 2019-12-10 18:09:20
问题 I have looked through the Flutter documentation to try and find an event, callback or even a state that I could hook into when the FlexibleSpaceBar is collapsed or expanded. return new FlexibleSpaceBar( title: new Column( crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[ new Text(_name, style: textTheme.headline), new Text(_caption, style: textTheme.caption) ]), centerTitle: false, background: getImage());` When the FlexibleSpaceBar is

Flutter Scrollable Stack with Height greater than Screen Height

天涯浪子 提交于 2019-12-10 17:39:31
问题 I have a widget hierarchy where SingleChildScrollView is the parent with a Stack as the child, the Stack has two children, if the Second child goes beyond the screen height its height gets clipped. According to docs the stack occupies size according to a Non-Positioned child. So that means we have to explicitly give a height to the Stack , but this height is arbitrary and it won't wrap the contents inside. My main aim is to wrap the SingleChildScrollView height rather than having empty space

Animation Of Container using Offset - Flutter

纵饮孤独 提交于 2019-12-10 14:55:49
问题 I am trying to move the container on the screen by giving begin and end offset like from Offset(0.0,0.0) to Offset(400.0,300.0) . I am using Slide Transition to animate the container I am using Tween<Offset>(begin: const Offset(3.0, 4.0), end: Offset(0.0, 0.0)) to move it on the screen I want to pass these Offset(400.0,300.0) and animate it. Here is my code class MoveContainer extends StatefulWidget { MoveContainer({Key key, }) : super(key: key); @override State<StatefulWidget> createState()

how to do pagination in GridView (Flutter)

最后都变了- 提交于 2019-12-10 11:36:31
问题 I want to implement pagination in GridView I use GridView.builder I want to download 10 by 10 items when the user reaches the last row 回答1: You can do this using a NotificationListener . As a simple demonstration it will increase the length of your GridView whenever it reaches end of page : var items_number = 10 ; return NotificationListener<ScrollNotification>( onNotification: (scrollNotification){ if(scrollNotification.metrics.pixels == scrollNotification.metrics.maxScrollExtent){ setState(