flutter-layout

How to add an extra label within TextFormField?

纵然是瞬间 提交于 2020-12-13 09:06:21
问题 Is there a way to position "Forget password" label inside a TextFormField? On a sample picture put forget password? right inside the input new TextFormField( decoration: InputDecoration(labelText: 'Password', labelStyle: TextStyle( color: Colors.black87, fontSize: 17, fontFamily: 'AvenirLight' ), focusedBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.purple), ), enabledBorder: new UnderlineInputBorder( borderSide: BorderSide(color: Colors.grey, width: 1.0) ), ), style:

How to add an extra label within TextFormField?

白昼怎懂夜的黑 提交于 2020-12-13 09:06:08
问题 Is there a way to position "Forget password" label inside a TextFormField? On a sample picture put forget password? right inside the input new TextFormField( decoration: InputDecoration(labelText: 'Password', labelStyle: TextStyle( color: Colors.black87, fontSize: 17, fontFamily: 'AvenirLight' ), focusedBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.purple), ), enabledBorder: new UnderlineInputBorder( borderSide: BorderSide(color: Colors.grey, width: 1.0) ), ), style:

How to add an extra label within TextFormField?

删除回忆录丶 提交于 2020-12-13 09:05:13
问题 Is there a way to position "Forget password" label inside a TextFormField? On a sample picture put forget password? right inside the input new TextFormField( decoration: InputDecoration(labelText: 'Password', labelStyle: TextStyle( color: Colors.black87, fontSize: 17, fontFamily: 'AvenirLight' ), focusedBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.purple), ), enabledBorder: new UnderlineInputBorder( borderSide: BorderSide(color: Colors.grey, width: 1.0) ), ), style:

How to manage native looks of switch widget in flutter

人盡茶涼 提交于 2020-12-13 03:44:24
问题 I want to create switch/toggle widget in Flutter/Dart with native looks of different OS. I mean if I run on iOS mobile it should be looks like: If I run on Android mobile it should be looks like : Help me to achieve this type of functionality in flutter/dart 回答1: Use Switch.adaptive Creates a CupertinoSwitch if the target platform is iOS, creates a material design switch otherwise. Switch.adaptive(value: true, onChanged: (newValue) {}) Sample code: bool _value = true; @override Widget build

How to manage native looks of switch widget in flutter

三世轮回 提交于 2020-12-13 03:41:46
问题 I want to create switch/toggle widget in Flutter/Dart with native looks of different OS. I mean if I run on iOS mobile it should be looks like: If I run on Android mobile it should be looks like : Help me to achieve this type of functionality in flutter/dart 回答1: Use Switch.adaptive Creates a CupertinoSwitch if the target platform is iOS, creates a material design switch otherwise. Switch.adaptive(value: true, onChanged: (newValue) {}) Sample code: bool _value = true; @override Widget build

Flutter scroll to specific item in list

白昼怎懂夜的黑 提交于 2020-12-13 03:23:07
问题 I have a ListView in Flutter that I allow users to dynamically add items to. After adding an item I would like for the list to scroll to the item that was added. I've attached a ScrollController to the ListView so I could use animateTo to scroll, but I'm unsure of how to determine the offset to scroll down to. I had something like this: _scrollController.animateTo( addedIndex.toDouble() * 100, curve: Curves.easeOut, duration: const Duration(milliseconds: 300), ); where addedIndex is the order

Making fixed app-wide menu instead of Drawer on tablets in Flutter

一个人想着一个人 提交于 2020-12-12 07:19:13
问题 My application has a lot of routes and almost every route uses Scaffold with the same Drawer menu to navigate inside the app (my own CustomDrawer widget). As for devices with big screen, I want to always show the menu on the left side in layout, instead of using Drawer (it works like this in Gmail app. I attached a pic). In other words, I need to make a responsive layout with fixed menu. What I've tried: I know that you can use LayoutBuilder to learn constraints size; Making same layout

How to remove space between two containers in Flutter?

心已入冬 提交于 2020-12-12 05:43:07
问题 I have two Containers of height 250 inside Column widget. There is no any other widget present between this two Container widget but still I can see very little space between two containers. Here's my code... import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', home: Example(), ); } } class Example extends StatelessWidget { @override Widget build

Flutter: Object was given an infinite size during layout

我的梦境 提交于 2020-12-08 07:08:58
问题 I'm battling an issue where I'm given the error " Object was given an infinite size during layout " and "This probably means that it is a render object that tries to be as big as possible, but it was put inside another render object that allows its children to pick their own size.". I understand what it means, but not how I can still keep my current widget tree responsive (it renders when running, so for a front-end user there seems to be no problem) while still fixing this issue. Currently I

Flutter: Object was given an infinite size during layout

冷暖自知 提交于 2020-12-08 07:05:02
问题 I'm battling an issue where I'm given the error " Object was given an infinite size during layout " and "This probably means that it is a render object that tries to be as big as possible, but it was put inside another render object that allows its children to pick their own size.". I understand what it means, but not how I can still keep my current widget tree responsive (it renders when running, so for a front-end user there seems to be no problem) while still fixing this issue. Currently I