flutter-layout

Overflow warning in AnimatedContainer adjusting height

感情迁移 提交于 2019-12-08 08:15:44
问题 Example Using the CupertinoPicker, I want it to animate into view below a textinput, using the AnimatedContainer, but when it becomes visible, I get an overflow warning. From what I've seen you cannot adjust the size of the CupertinoPicker, only it's parent. Is there a better solution? Column( children: <Widget>[ buildTextField( field: 'limit', label: 'How Many Guests?', controller: TextEditingController( text: eventModel.event['limit']), onTap: () { showPicker.value = !showPicker.value; }, )

flutter design Curves layout

▼魔方 西西 提交于 2019-12-08 07:23:01
问题 in flutter i know that we can draw line to design arc layout such as this below screen shot but i just learn this feature on flutter and i can't design that, maybe in flutter we have some implemented library or source code like with that, but i can't find and design that note that, white space between right of screen and curve is resizable on height and width and using customPaint not clipping widget 回答1: Here is working example. Maybe you want any additional functionality - I think you can

Button overlaps on textfield when keyboard is open

Deadly 提交于 2019-12-08 05:15:49
问题 Here is my issue: The button should Not overlap the textfield. Notice that I added a SingleChildScrollView() . The user can still scroll up and achieve the desired the result but I want to make it automatic: Here is my code: import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_masked_text/flutter_masked_text.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:talking_dodo/dodo/pages/payment/credit_card.dart'; class

How to set the shape of a button with conical border

走远了吗. 提交于 2019-12-08 03:15:20
问题 I'm dealing with buttons in flutter,and want to change the shape of the button in my application. How can I get a conical border for my button? 回答1: You can create your own one using CustomPaint widget to draw your button shape. class MyButton extends StatelessWidget { final double width; final double height; final Color color; final Widget child; final VoidCallback onPressed; const MyButton({ Key key, this.width = 150.0, this.height = 75.0, this.color, @required this.child, @required this

In Flutter, how can a positioned Widget feel taps outside of its parent Stack area?

你。 提交于 2019-12-08 01:03:47
问题 A Stack contains MyWidget inside of a Positioned . Stack( overflow: Overflow.visible, children: [ Positioned( top: 0.0, left: 0.0, child: MyWidget(), )], ); Since overflow is Overflow.visible and MyWidget is larger than the Stack , it displays outside of the Stack , which is what I want. However, I can't tap in the area of MyWidget which is outside of the Stack area. It simply ignores the tap there. How can I make sure MyWidget accepts gestures there? 回答1: This behavior occurs because the

Is it possible to force the alignment of a specific child widget in a Wrap widget?

依然范特西╮ 提交于 2019-12-08 00:15:24
问题 I'm trying to create a layout in flutter consisting of a row with two child widgets, the first aligned to the left and the second aligned to the right, that also will wrap the widgets if the container is too narrow. This is similar to the question asked here Flutter align two items on extremes - one on the left and one on the right, which can be solved with a Wrap widget with alignment: WrapAlignment.spaceBetween . However when the widgets wrap using this method, the right widget wrapped to a

bottom sheet with initial height half of screen and if it scroll then height is increase to full screen

北战南征 提交于 2019-12-07 15:30:55
问题 I have a bottom sheet with below code in where i put a height 300.0 but I want increase height to full screen when user scroll ..how can i do that ..please void _showBottomSheet() { setState(() { _showPersBottomSheetCallBack = null; }); _scaffoldKey.currentState .showBottomSheet((context) { return new Container( height: 300.0, color: Colors.greenAccent, child: new Center( child: new Text("Hi BottomSheet"), ), ); }) .closed .whenComplete(() { if (mounted) { setState(() {

How can I build a chip input field in Flutter?

醉酒当歌 提交于 2019-12-07 12:31:54
问题 A chip input field using Material 回答1: You can find an implementation of a Chip Input Field type widget here: Latest: https://gist.github.com/slightfoot/c6c0f1f1baca326a389a9aec47886ad6 import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; // See: https://twitter.com/shakil807/status/1042127387515858949 // https://github.com/pchmn/MaterialChipsInput/tree/master/library/src/main/java/com/pchmn/materialchips // https://github.com/BelooS

Multidirectional scroll in flutter

青春壹個敷衍的年華 提交于 2019-12-07 12:14:36
问题 I come from a web development background, and am used to being able to create an element that has both x and y overflow (allowing scrolling in any direction). I'm struggling to achieve the same functionality with Flutter. Looking through the documentation, I've found SingleChildScrollView, but it only allows Axis.horizontal or Axis.vertical, not both. So I have tried the following: return SingleChildScrollView( // horizontal scroll widget scrollDirection: Axis.horizontal, child:

How to change text selection option in flutter?

。_饼干妹妹 提交于 2019-12-07 07:44:24
I tried to add text editing format option like in the gmail app. But when highlight the text there' is not a format option. Is it possible to handle selecting alert? (Copy/cut/paste). Or is there a way to add format bar like gmail? TextField( controller: _categoryController, decoration: InputDecoration( border: InputBorder.none, hintText: "Enter Category Name", ), ), I added screenshot and gif files to better understanding my question. Selecting option on my Flutter application Selecting option on Gmail App Output: You can check the code below: import 'package:flutter/material.dart'; void main