flutter-layout

Getting 'Horizontal viewport was given unbounded height.' with TabBarView in flutter

拥有回忆 提交于 2019-12-01 03:46:51
I'm trying to make a profile page, where the users info is at the top. And then have a tab view below that for different views. This is the code I'm using at the moment, when I take the TabBarView out it doesn't through an error, and if I wrap the TabBarView in an Expanded the error RenderFlex children have non-zero flex but incoming height constraints are unbounded. comes up. @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(''), ), body: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Padding( padding: EdgeInsets.all(10.0),

Flutter switch between fragments by supporting back to previous fragment

折月煮酒 提交于 2019-12-01 03:46:48
问题 in this link in SF, @martinseal1987 show us how can we use separated widgets link with android fragments. I implemented this solution on my project and after running project i dont have any problem to show first widgets as an Fragment , but when i press to back button my screen goes to black and couldn't back to previous widgets as an fragment i think that is should be this: Problem is on navigateBack and customPop methods and i can attach fragment by pressing on button import 'package

How do I add margins to my widget ? Understanding the effect of EdgeInsets

随声附和 提交于 2019-12-01 03:19:12
I am trying to wrap my head around ui placement in Flutter. So I currently have something that looks like this I would like to add a little space b/w search Textfield and the button. This is what the controlling part of my code looks like. I am trying to style my textFieldSearchBox so it has a little margin on the right, I tried trying to increase the Edge insets but it seems to increase the size of the TextField I don't know why? I know I could adding a padding element after TextField but I wanted to know what my other options are.Why does increasing the EdgeInsets in the decoration of

flutter design Curves layout as single widget

与世无争的帅哥 提交于 2019-12-01 01:48:26
Here solved question about design this layout. I have a problem to using that, because of this curve on right of screen is not widget and when I want to have some other widgets in green side, I can't, because designed curve is not widget its clipped from green layout. Suppose I want to have this curve on right of screen and some widget in below of that. Source code import 'package:flutter/material.dart'; void main() { runApp(MaterialApp(home: Scaffold(body: Test()))); } class Test extends StatefulWidget { @override _TestState createState() => _TestState(); } class _TestState extends State<Test

flutter - App bar scrolling with overlapping content in Flexible space

爱⌒轻易说出口 提交于 2019-11-30 20:54:26
i am trying to recreate App bar scrolling with overlapping content in Flexible space using flutter. the behavior is demonstrated here: http://karthikraj.net/2016/12/24/scrolling-behavior-for-appbars-in-android/ I created collapsing AppBar using SliverAppBar already, using the code I pasted here, I am trying to create THIS i cant use Stack for it because i cant find any onScroll callback, so far i created appbar with flexibleSpace, the app bar collapse on scroll: Scaffold( body: NestedScrollView( headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) => <Widget>[ SliverAppBar(

Flutter: How to Get the Number of Text Lines

和自甴很熟 提交于 2019-11-30 20:15:54
How to Get the Number of Text Lines In our Flutter project, we need to determine if the number of lines of text exceeds 3, then we will display a prompt message. How can we use the code to implement it? If you simply want to check for how many newlines the text contains, you can do a simple final numLines = '\n'.allMatches(yourText).length + 1; However, I guess you're more interested in the number of lines that are actually being displayed visually. Here, things get a little more complicated, because you need to know the available space (the BoxConstraints ) in order to calculate how many

How to remove extra padding around AppBar leading icon in Flutter

梦想与她 提交于 2019-11-30 20:13:17
In my Flutter app, I have this AppBar Widget setAppBar(){ return new AppBar( title: addAppBarTextWidget('Explore'), elevation: 0.0, leading: addLeadingIcon(), actions: <Widget>[ addAppBarActionWidget(Constant.iconNotification, 22.0, 16.0, 8.0), addAppBarActionWidget(Constant.iconProfile, 30.0, 30.0, 15.0) ], ); } Widget addLeadingIcon(){ return new Container( height: 25.0, width: 25.0, padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0), margin: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0), child: new Stack( alignment: AlignmentDirectional.center, children: <Widget>[ new Image.asset(

flutter - App bar scrolling with overlapping content in Flexible space

大兔子大兔子 提交于 2019-11-30 17:00:10
问题 i am trying to recreate App bar scrolling with overlapping content in Flexible space using flutter. the behavior is demonstrated here: http://karthikraj.net/2016/12/24/scrolling-behavior-for-appbars-in-android/ I created collapsing AppBar using SliverAppBar already, using the code I pasted here, I am trying to create THIS i cant use Stack for it because i cant find any onScroll callback, so far i created appbar with flexibleSpace, the app bar collapse on scroll: Scaffold( body:

Getting 'Horizontal viewport was given unbounded height.' with TabBarView in flutter

余生长醉 提交于 2019-11-30 16:55:43
问题 I'm trying to make a profile page, where the users info is at the top. And then have a tab view below that for different views. This is the code I'm using at the moment, when I take the TabBarView out it doesn't through an error, and if I wrap the TabBarView in an Expanded the error RenderFlex children have non-zero flex but incoming height constraints are unbounded. comes up. @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(''), ), body: Column(

Either drawImage or paintImage doesn't work properly in Flutter

别来无恙 提交于 2019-11-30 16:35:26
I basically want to show an image that I have in the assets folder onto the canvas. import 'package:flutter/material.dart' as ui; ... ui.Image img = ui.Image.asset("images/some_image.png"); ui.paintImage(canvas: canvas, image: img); And have got the following error message when I tried to assign img to paintImage's image. The argument type 'Image (C:\ABC\flutter\packages\flutter\lib\src\widgets\image.dart)' can't be assigned to the parameter type 'Image (C:\ABC\flutter\bin\cache\pkg\sky_engine\lib\ui\painting.dart)'. I don't really know what could go wrong, I have seen other codes that had a