flutter-layout

Flutter TextFormField hidden by keyboard

匆匆过客 提交于 2019-12-03 07:54:41
NOTE: Im using Navigator.of(context).push to push ModalRoute, Hi I have page with ModalRoute with TextFormField in the body, but when keyboard show up, the input is being hide by keyboard, how to fix this? return Container( child: ListView( children: <Widget>[ //other widget SizedBox(height: _qtyAnimation.value), Row( children: <Widget>[ Expanded( child: Text( "Jumlah", style: TextStyle(fontWeight: FontWeight.bold), ), ), SizedBox( width: 145.0, child: TextFormField( focusNode: _qtyFocusNode, controller: qty, keyboardType: TextInputType.number, textAlign: TextAlign.center, decoration:

Custom Card Shape Flutter SDK

北战南征 提交于 2019-12-03 06:30:23
问题 I just started learning Flutter and I have developed an app with GridView. GridView items are Card. Default card shape is Rectangle with a radius of 4. I know there is shape property for Card Widget and it takes ShapeBorder class. But I am unable to find how to use ShapeBorder class and customize my cards in GridView. Thanks in Advance. 回答1: You can use it this way Card( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(15.0), ), child: Text( 'Card with circular border',

How to update flutter TextField's height and width?

半世苍凉 提交于 2019-12-03 04:33:42
How does one customise the TextField layout's height and width in Flutter? 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( fontSize: 40.0, height: 2.0, color: Colors.black ) ) ) Bear in mind that the height in the TextStyle is a

Rounded Corners Image in Flutter

北慕城南 提交于 2019-12-03 02:08:19
问题 I am using Flutter to make a list of information about movies. Now I want the cover image on the left to be a rounded corners picture. I did the following, but it didn’t work. Thanks! getItem(var subject) { var row = Container( margin: EdgeInsets.all(8.0), child: Row( children: <Widget>[ Container( width: 100.0, height: 150.0, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8.0)), color: Colors.redAccent, ), child: Image.network( subject['images']['large'], height:

Overflow Error in Flutter when keyboard open

纵然是瞬间 提交于 2019-12-02 23:03:04
问题 I am designing a login page it overflowed when I click on any text form field it open keyboard and through overflow warning like this see attached image. I also want a Raised button icon should be on the right side of the button. Widget build(BuildContext context) { return Container( child: Scaffold( body: Stack( fit: StackFit.expand, children: <Widget>[ Container( decoration: BoxDecoration( image: new DecorationImage( image: new AssetImage('assets/login_page_bg_1.jpg'), fit: BoxFit.cover,

Flutter: BottomNavigationBar rebuilds Page on change of tab

拜拜、爱过 提交于 2019-12-02 19:11:28
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.green), NewsListWidget(), ShopsTabWidget(), PlaceholderWidget(Colors.blue), ]; super.initState(); }

How to use the constraints and sizes of other widgets during the build phase

点点圈 提交于 2019-12-02 18:36:17
问题 I want to make sure I cover all cases A Parent widget reads (and possibly uses) a child's size or constraints A Child widget reads (and possibly uses) a parent's size or constraints A Child widget reads (and possibly uses) another child's size or constraints The solution seems to be to... Let the build phase run Then the size and constraints of the widget I want to retreive data from are built Then I interrupt the regular sequence of phases (so the draw Frame function does not run) Then rerun

Horizontally scrollable cards with Snap effect in flutter

痞子三分冷 提交于 2019-12-02 16:48:00
I want to create a list of cards scrolling horizontally with snap to fit effect when swiped either from left or right. Each card has some spacing between them and fit to screen similar to below image Apart from that these horizontally scrollable list elements should be contained inside a vertically scrollable list. I all I am able to achieve is only displaying a list of horizontal scrolling cards after following example in flutter docs. class SnapCarousel extends StatelessWidget { @override Widget build(BuildContext context) { final title = 'Horizontal List'; return MaterialApp( title: title,

Rounded Corners Image in Flutter

不想你离开。 提交于 2019-12-02 16:06:32
I am using Flutter to make a list of information about movies. Now I want the cover image on the left to be a rounded corners picture. I did the following, but it didn’t work. Thanks! getItem(var subject) { var row = Container( margin: EdgeInsets.all(8.0), child: Row( children: <Widget>[ Container( width: 100.0, height: 150.0, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8.0)), color: Colors.redAccent, ), child: Image.network( subject['images']['large'], height: 150.0, width: 100.0, ), ), ], ), ); return Card( color: Colors.blueGrey, child: row, ); } as follows

Overflow Error in Flutter when keyboard open

北城余情 提交于 2019-12-02 09:14:32
I am designing a login page it overflowed when I click on any text form field it open keyboard and through overflow warning like this see attached image. I also want a Raised button icon should be on the right side of the button. Widget build(BuildContext context) { return Container( child: Scaffold( body: Stack( fit: StackFit.expand, children: <Widget>[ Container( decoration: BoxDecoration( image: new DecorationImage( image: new AssetImage('assets/login_page_bg_1.jpg'), fit: BoxFit.cover, colorFilter: new ColorFilter.mode( Colors.black.withOpacity(0.55), BlendMode.dstATop))), ), Column(