flutter-layout

Flutter: Clip a column to prevent overflow

痞子三分冷 提交于 2019-12-07 07:37:17
问题 Pretty simple question, but I haven't been able to find an answer. I have a layout structure in Flutter like this: Inkwell Card ScopedModelDescendant Column Container[] The number of containers in the column is variable. The goal is that it should look like this: But instead, it ends up doing this: I was able to create that "ideal" look by putting a SingleChildScrollView between the ScopedModelDescendant and the Column , but of course that's not what I want, because I don't want it to scroll.

how to do pagination in GridView (Flutter)

老子叫甜甜 提交于 2019-12-06 22:06:36
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 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(() { items_number += 10 ; }); } }, child: GridView.builder( itemCount: items_number, itemBuilder: (context,

flutter how to center widget inside list view

荒凉一梦 提交于 2019-12-06 19:37:08
问题 I'm struggling with centering widget inside listView . I did like this but Text('ABC') is not centered vertically. How can I achieve this? new Scaffold( appBar: new AppBar(), body: new ListView( padding: const EdgeInsets.all(20.0), children: [ new Center( child: new Text('ABC') ) ] ) ); 回答1: Vertically Center & Horizontal Center: Scaffold( appBar: new AppBar(), body: Center( child: new ListView( shrinkWrap: true, padding: const EdgeInsets.all(20.0), children: [ Center(child: new Text('ABC'))

Is it possible to force the alignment of a specific child widget in a Wrap widget?

烈酒焚心 提交于 2019-12-06 14:15:57
I'm trying to create a layout in flutter consisting of a row with two child widgets, the first aligned to the left and the second aligned to the right, that also will wrap the widgets if the container is too narrow. This is similar to the question asked here Flutter align two items on extremes - one on the left and one on the right , which can be solved with a Wrap widget with alignment: WrapAlignment.spaceBetween . However when the widgets wrap using this method, the right widget wrapped to a new run is no longer right aligned. ( screenshots ) What I would like to happen is for the right

How to align DropdownButton next to a TextField in Flutter?

十年热恋 提交于 2019-12-06 13:41:16
I would like to vertically align a DropdownButton right next to a TextField . Row( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ DropdownButton<String>( ... ), Flexible( child: TextField( ... ), ), ], ) The current behavior is: As you can see, the bottom lines aren't aligned. I guess that's happening due to a differences in height. What would be a good practice to fix that? (I'm guessing not using a fixed height) My final goal is something like this: Where both lines and the text of DropdownButton and TextField are vertically aligned. I am not sure whether this solution

Flutter tabsView and NestedScrollView scroll issue

你离开我真会死。 提交于 2019-12-06 12:19:01
问题 i have "NestedScrollView" that content a "tabView" and every tab view content a "List builder" , when i scroll inside one of list builder (inside tabs) , all other tabs is sync the scroll position if i add "ScrollController" to each listview (in tabs) , then the listBuilder inside the tab scroll separated of "NastedScrollView" here is an example code : import 'package:flutter/material.dart'; void main() => runApp( MaterialApp( home: MyApp() , ) ); class MyApp extends StatefulWidget{

Flutter - How can I dynamically show or hide App Bars on pages

北慕城南 提交于 2019-12-06 10:56:51
问题 I have design one screen which is appear when intent from navigation drawer as well as from other screen. Now i want to hide app bar when intent from navigation drawer, so please guide me, below is my code Navigation Screen code import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:pwc/src/home/HomeScreen.dart'; import 'package:pwc/src/model/UserModel.dart'; import 'package:pwc/src/property/BuyerPropertyListScreen.dart'; import 'package:pwc/src/property

Flutter Stream Builder Triggered when Navigator Pop or Push is Called

房东的猫 提交于 2019-12-06 07:53:30
问题 I have a stream builder in the app's home/root page. This stream builder gets triggered whenever I do a page-navigation elsewhere, which has nothing to do with the stream itself. My understanding, according to here and here, is when a page is popped/pushed in the navigator, it triggers a rebuild on the app, so the stream builder gets re-attached and so it fires. However this seems inefficient, so is there a way to prevent the stream builder from firing when a page is popped/pushed?

Flutter, How to remove white spaces around dialog box?

时光怂恿深爱的人放手 提交于 2019-12-06 06:36:02
问题 I am calling this dialog while getting data from server. This dialog box is having white spaces around it. I can I remove this white space around my dialog box. Here is my code. var bodyProgress = new Container( decoration: new BoxDecoration( color: Colors.blue[200], borderRadius: new BorderRadius.circular(10.0) ), width: 300.0, height: 200.0, //color: Colors.blue, alignment: AlignmentDirectional.center, child: new Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment:

How to create a horizontally scrolling table with fixed column in Flutter?

为君一笑 提交于 2019-12-06 06:04:55
问题 I would like to create a series of tables that you can scroll through vertically, each of which may have a different number of rows/columns from each other. Within each table, I would like to have the leftmost column frozen in place, and the remaining columns in that table to be horizontally scrollable, in case there are a number of columns that do not fit in the width of the screen. See screenshot: My initial plan was to use a ListView for the page-level vertical scrolling between tables,