flutter-layout

How to centred column and row item in Flutter?

橙三吉。 提交于 2020-01-01 04:07:28
问题 I have small currency table. I didn't use grid. I use Column and rows. Problem is that items in rows is not showing in centre as shown below excel example. What widget do I have to use to makes the items centred? Any help please? The Example codes: return new Center( child: new Column( crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ new Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ new Padding( padding: const EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 5.0)

How to update flutter TextField's height and width?

放肆的年华 提交于 2020-01-01 01:10:06
问题 How does one customise the TextField layout's height and width in Flutter? 回答1: To adjust the width, you could wrap your TextField with a Container widget, like so: new Container( width: 100.0, child: new TextField() ) I'm not really sure what you're after when it comes to the height of the TextField but you could definitely have a look at the TextStyle widget, with which you can manipulate the fontSize and/or height new Container( width: 100.0, child: new TextField( style: new TextStyle(

Flutter: BottomNavigationBar rebuilds Page on change of tab

痞子三分冷 提交于 2019-12-31 09:15:14
问题 I have a problem with my BottomNavigationBar in Flutter. I want to keep my page alive if I change the tabs. here my implementation BottomNavigation class Home extends StatefulWidget { @override State<StatefulWidget> createState() { return _HomeState(); } } class _HomeState extends State<Home> { int _currentIndex = 0; List<Widget> _children; final Key keyOne = PageStorageKey("IndexTabWidget"); @override void initState() { _children = [ IndexTabWidget(key: keyOne), PlaceholderWidget(Colors

Vertical viewport was given unbounded height

我怕爱的太早我们不能终老 提交于 2019-12-30 03:38:06
问题 I am new to flutter. Just have to center my Grid view: Below is the Code I tried: @override Widget build(BuildContext context) { return new Material( color: Colors.deepPurpleAccent, child: new Column( mainAxisAlignment: MainAxisAlignment.center, children:<Widget>[new GridView.count(crossAxisCount: _column,children: new List.generate(_row*_column, (index) { return new Center( child: new CellWidget() ); }),)] ) ); } Exception as follows: I/flutter ( 9925): ══╡ EXCEPTION CAUGHT BY RENDERING

How to shift focus to next textfield in flutter?

↘锁芯ラ 提交于 2019-12-30 00:39:33
问题 I am new to Flutter. I am building a form with multiple text inputs using following widgets: Form, TextFormField. The keyboard that appears doesn't show "next" (which should shift the focus to next field) field action instead it is "done" action (which hides the keyborad). I looked for any hints in official docs, found nothing directly that can be done. I although landed on FocusNode(cookbook, api doc). It provides with mechanism to shift focus by some button or any other action on app, but I

Flutter: Scrolling to a widget in ListView

霸气de小男生 提交于 2019-12-28 02:57:05
问题 How can I scroll to a special widget in a ListView ? For instance I want to scroll automatically to some Container in the ListView if I press a specific button. ListView(children: <Widget>[ Container(...), Container(...), #scroll for example to this container Container(...) ]); 回答1: By far, the easiest solution is to use Scrollable.ensureVisible(context) . As it does everything for you and work with any widget size. Fetching the context using GlobalKey . The problem is that ListView won't

Flutter - Wrap text on overflow, like insert ellipsis or fade

僤鯓⒐⒋嵵緔 提交于 2019-12-28 02:31:08
问题 I'm trying to create a line in which center text has a maximum size, and if the text content is too large, it fits in size. I insert the TextOverflow.ellipsis property to shorten the text and inserting the triple points ... but it is not working. main.dart import 'package:flutter/material.dart'; void main() { runApp(new MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( home: new HomePage(), ); } } class HomePage extends

Resize Flutter FloatingActionButton

喜欢而已 提交于 2019-12-25 03:08:49
问题 I can't figure out how to make the FAB smaller inside the first Container in the list. It seems to want to occupy the complete container, no matter what I try. Ive even tried a container within a container. The complete Orange area is clickable. I tried SizedBox, same result. Here is the code. import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { final title = 'Horizontal List'; return

App works perfectly yesterday and now an error PlatformException(FirebaseException, An internal error has occurred. [ 7: ], null) appears

蹲街弑〆低调 提交于 2019-12-25 01:49:00
问题 Hi I have a flutter app that is perfectly working yesterday. I even manage to signup and it registered in my Firebase console but for some reason when i try it today (didnt change anything code whatsoever) This error appears when trying to register for a new account PlatformException(FirebaseException, An internal error has occurred. [ 7: ], null) 回答1: This is not an actual error. Happened with me too yesterday, Fixed this with. Check your internet connectivity (or firewall) Restart your

Can't search contacts

筅森魡賤 提交于 2019-12-25 00:46:02
问题 So I have made a list of static contacts, and I have tried to add a search bar, however I can't search the contacts using the search bar. When I click on search bar it will open but then close. The keyboard pops up for a moment but then will close. The idea was to make the search predictive, so when a name is typed in, it will list the closed based on the names in the database. Any ideas? class ContactsPage extends StatefulWidget { Widget appBarTitle = new Text("Contacts"); Icon actionIcon =