flutter-layout

How to change the state of an entry in CustomMultiChildLayout in Flutter

*爱你&永不变心* 提交于 2019-12-13 03:22:45
问题 I used CustomMultiChildLayout to customize a layout, and implemented MultiChildLayoutDelegate . There are many entries in the layout. I want to change the state when I click on these items, similar to the normal and pressed state of Button in Android. The part of the code is as follows, but it has no effect. Thanks! Build item widget: Color _color = Colors.redAccent; Widget _buildChild(int index) { return LayoutId( id: '$childId$index', child: GestureDetector( onTapDown: (event) { setState(()

A RenderFlex overflowed by Infinity pixels on the bottom

吃可爱长大的小学妹 提交于 2019-12-13 02:54:16
问题 I have a very simple control where I am trying to show a DrodownButton with a couple of TextFields. When the app runs in the emulator, I get an error saying "BOTTOM OVERFLOWED BY Infinity PIXELS". The stack trace hints at the issue and points me some relevant documentation, but being very new to Flutter, I'm not sure what needs to change. I have tried all the suggestions based on looking at questions about similar errors, but have not had any luck. I/flutter (10708): ══╡ EXCEPTION CAUGHT BY

Flutter: how to fix bottom overflow

拜拜、爱过 提交于 2019-12-13 02:11:48
问题 I have a Flutter Widget with a column layout that has two Containers, one of which has a ListView.builder . When the page renders I get a bottom overflow by 169px and I'm not sure how to fix it. I've googled around for solutions and have tried various things like wrapping one or more of the Container s in the widget in an Expanded widget, but that doesn't work either. If I wrap just the Container that has the FutureBuilder inside of it in an Expanded , then the ListView doesn't render at all

Autocomplete suggestion and search using json data

人盡茶涼 提交于 2019-12-13 01:29:10
问题 I want to display data from local json in list as suggestions when user types in a textfield. The suggestions displayed should be based on id that is associated with text to be displayed. Somehow I am not able to achieve to display the data in UI and how to build the hierarchy of widgets that will display suggestions in list . Not sure what am I missing here. Looking for guidance. End result I am looking to achieve is: Json snippet: { "data": [{ "serviceCategory": "ELECTRICAL",

Make container background as transparent?

筅森魡賤 提交于 2019-12-12 17:50:20
问题 I have a container which look like this which has some background color. I want the list behind the container should be visible. The code written for the container is below: new Container( margin: EdgeInsets.fromLTRB(50.0, 10.0, 50.0, 10.0), width: _isTextFieldActive ? 150.0 : 80.0, height: 40.0, decoration: new BoxDecoration( color: Color(0xFF98DAFC), borderRadius: new BorderRadius.only( topLeft: Radius.circular(0.0), topRight: Radius.circular(32.0), bottomLeft: Radius.circular(0.0),

Dynamically change the gridview crossaxis count to populate dynamic columns in flutter

落花浮王杯 提交于 2019-12-12 16:50:34
问题 I'm working on a gridview from flutter framework to achieve a dynamic column count, but didn't get a solution. I have tried using GridView.count and Gridview.builder with itembuilder and i didn't get the expected result. Any help would be appreciated. Please find the image of the design to be achieved. edit : after using staggeredGridview i'm getting the below result return StaggeredGridView.countBuilder( crossAxisCount: 2, itemBuilder: (BuildContext context, int index) { if (index % 2 == 0)

How to change the background color of Popup MenuButton bullet window?

試著忘記壹切 提交于 2019-12-12 11:23:42
问题 I want to change the background color of Popup Menu Button window. What should I do? I hope I can get your help. Thank you.When I change the color of container, some corners cannot change the color. new IconButton( icon: new Icon( Icons.search, color: Colors.white, ), onPressed: () {}, ), new PopupMenuButton( offset: const Offset(0.0, 60.0), icon: new Icon(Icons.add, color: Colors.white), itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[ new PopupMenuItem<String>( value: '选项一的值'

Flutter card top radius is covered by Image

只愿长相守 提交于 2019-12-12 10:59:24
问题 When I add a image to the card, the Radius at the top of the card are covered. How can I solve it? When I add a image to the card, the Radius at the top of the card are covered. How can I solve it? class App extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( theme: ThemeData(primarySwatch: Colors.yellow), home: Scaffold( backgroundColor: Colors.grey[200], appBar: AppBar(title: Text('Demo'),), body: SizedBox( height: 310.0, child: Card( elevation: 3.0,

How to make text as big as the width allows in flutter

谁说胖子不能爱 提交于 2019-12-12 10:38:35
问题 I have a Container where I need to show a barcode (it's a app for virtual fidelity cards) and I'd love to have the barcode to be as wide as possible on the screen. For now I set the font size at a reasonable size that suits all devices, but it's only temporary of course. How can I solve this? This is the code I am using for building the Widget. @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(_title), ), body: Container( padding: const EdgeInsets.all

ListView inside Column causes 'Vertical viewport was given unbounded height'

风格不统一 提交于 2019-12-12 08:55:49
问题 I am new to flutter and having trouble with layouts. I want something like this: A sticky header and a scroll view below it. I thought of using Column widget with two children - first being the header and second being the ListView. Here is my code Widget build(BuildContext context) { return Material( elevation: 8.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Padding( padding: const EdgeInsets.all(16.0), child: Text( title, style: Theme.of(context)