flutter-layout

Set a Drawer to portrait even if image goes to landscape

僤鯓⒐⒋嵵緔 提交于 2020-06-01 06:22:51
问题 I am using this template to build out an App. First attempt at App building but want to use this for an online exhibition platform for my paintings and photography etc. This is from a Google Flutter demo on Youtube. https://github.com/MarcinusX/drawer_challenge/blob/master/lib/main.dart When you run the app in custom guitar drawer mode(set the flip Bool to true ) the Drawer is set to the left side of the screen(portrait mode). I want to use the length of the screen for info and other menu

Flutter button, unwanted extra top and bottom padding

妖精的绣舞 提交于 2020-05-31 07:17:32
问题 I'm trying to customize a Flutter button: ButtonTheme( child: FlatButton( child: Text(_text), color: _color, onPressed: _onPressed, ), minWidth: 40, ), But I can't get rid of the extra top and bottom padding: FlatButton , RaisedButton , MaterialButton , all of them have the padding. NOTE: I have more customizations, such as padding, text trimming, and border-radius. 回答1: To remove that padding add - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, ButtonTheme( child: FlatButton(

How to hide error appearances when TextFormField is focused

微笑、不失礼 提交于 2020-05-30 07:56:19
问题 I'm using TextFormField for a form and custom validator method to return error message. I'm trying to hide default error message and error border on the TextFormField when the text field get focused. TextFormField( focusNode: _focusNode, validator: widget.validator, errorBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.blue, width: 5.0), borderRadius: BorderRadius.circular(5), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(5.0), borderSide:

In Flutter, how to make Buttons and Textfields of same height?

对着背影说爱祢 提交于 2020-05-29 05:14:22
问题 I know that TextField has TextStyle , which has a height property, which is just a multiplier based on fontSize , but how can I make all the widgets the same height (irrespective of font size)? Additionally, is there an equivalent method of the following (in pretty much any other programming language): btnLogin.height = txtPassword.height; 回答1: Output: (All have exact same height) I think the best way to do it is to first find out height of TextField , and then use it for your RaisedButton ,

How to make crossword type puzzle in flutter using GridView or TableView

时间秒杀一切 提交于 2020-05-28 07:16:48
问题 I got a task in which I had to make a something like crossword puzzle. First of all, I will show you the exact image which I want to achieve. I have tried using many possible ways like tried using GridView and Table widgets provided in flutter. Tried putting GridView/Table inside GestureDetector but the problem is that I can't get the word on which the user dragged with his finger. The alphabets and the correct word is coming from server-side. Also when the user dragged on some alphabets then

Flutter - Hero animation is not working with tab navigator

社会主义新天地 提交于 2020-05-28 04:57:42
问题 I am new to flutter and I am using hero widget to make animation for floating button. I have bottom navigation and I have to open page with tab navigator. But hero animation is not working. I use every possible solution but still hero animation not working for page route. Here is my code snippet. FloatingActionButton( onPressed: () { _selectTab(TabItem.Floating); }, child: Icon(Icons.add), heroTag: "tag", ), This is click for fab button to open new page void _selectTab(TabItem tabItem) { if

Flutter - Hero animation is not working with tab navigator

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-28 04:55:33
问题 I am new to flutter and I am using hero widget to make animation for floating button. I have bottom navigation and I have to open page with tab navigator. But hero animation is not working. I use every possible solution but still hero animation not working for page route. Here is my code snippet. FloatingActionButton( onPressed: () { _selectTab(TabItem.Floating); }, child: Icon(Icons.add), heroTag: "tag", ), This is click for fab button to open new page void _selectTab(TabItem tabItem) { if

Listview inside DraggableScrollableSheet not scrolling in flutter

て烟熏妆下的殇ゞ 提交于 2020-05-26 11:15:32
问题 I am designed very heavy nested design like below, the issue when my list expands the listview doesn't seems to be scrolling what is the reason for this, the bottomsheet gets expanded but there is no focus on listview inside it, if i scrolls by touching the 'Operational Hours' text it starts scrolling but when it goes upwards i can't slide it down. _showDialog(BuildContext context) { print("_showDialog"); showModalBottomSheet( context: context, isScrollControlled: true, builder: (BuildContext

Rotate text or image using button gesture in flutter

时光怂恿深爱的人放手 提交于 2020-05-26 09:17:51
问题 Now, the image is smoothly rotating only from left to right when I make a gesture of 360 degree. Required result: Should rotate from right to left when we make a gesture of 360 degree. Done : Should rotate from right to left when we make a gesture of 360 degree. Once we start rotating from left to right at some point and again back to right to left it should rotate from either direction from which the gesture is made. import 'dart:math'; import 'package:flutter/material.dart'; class

Flutter: Column align items to have the same width

℡╲_俬逩灬. 提交于 2020-05-26 04:14:57
问题 I'm trying to align the widgets inside the column to be in the center with CrossAxisAlignment.center but I also want that the Widgets have the same width. How can I achieve this? 回答1: you can get something similar to that by setting the CrossAxisAlignment to stretch and then wrap the Column in a IntrinsicWidth and if you want to give them a specific width use the stepWidth property Center( child: IntrinsicWidth( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>