flutter-layout

Custom Painter class not visible in Stack flutter

送分小仙女□ 提交于 2020-07-23 10:18:28
问题 For some reason, the Stack widget does not show the Container with the CustomPaint . However if removed from Stack , it works fine. What am I missing here? class _DemoNavBar extends State<DemoNavBar> { @override Widget build(BuildContext context) { // TODO: implement build return MaterialApp( home: Stack( children: <Widget>[ Container(child: CustomPaint(painter: CurvePainter())) ], ) ); } } class CurvePainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { var paint =

Custom Painter class not visible in Stack flutter

走远了吗. 提交于 2020-07-23 10:17:12
问题 For some reason, the Stack widget does not show the Container with the CustomPaint . However if removed from Stack , it works fine. What am I missing here? class _DemoNavBar extends State<DemoNavBar> { @override Widget build(BuildContext context) { // TODO: implement build return MaterialApp( home: Stack( children: <Widget>[ Container(child: CustomPaint(painter: CurvePainter())) ], ) ); } } class CurvePainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { var paint =

Custom Painter class not visible in Stack flutter

一曲冷凌霜 提交于 2020-07-23 10:16:27
问题 For some reason, the Stack widget does not show the Container with the CustomPaint . However if removed from Stack , it works fine. What am I missing here? class _DemoNavBar extends State<DemoNavBar> { @override Widget build(BuildContext context) { // TODO: implement build return MaterialApp( home: Stack( children: <Widget>[ Container(child: CustomPaint(painter: CurvePainter())) ], ) ); } } class CurvePainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { var paint =

Scrolling just a specific container

你离开我真会死。 提交于 2020-07-23 09:06:12
问题 I have the following screen and I need the image area to be fixed and the form part to be scrollable when the keyboard opens: Why the scrolling isn't working for the form part? I tried both with ListView and SingleChildScrollView , but it only works if I wrap the entire content (image and form) with it. import 'package:ahgora/models/user.dart'; import 'package:flutter/material.dart'; class Home extends StatefulWidget { @override _HomeState createState() => _HomeState(); } class _HomeState

Scrolling just a specific container

早过忘川 提交于 2020-07-23 09:04:48
问题 I have the following screen and I need the image area to be fixed and the form part to be scrollable when the keyboard opens: Why the scrolling isn't working for the form part? I tried both with ListView and SingleChildScrollView , but it only works if I wrap the entire content (image and form) with it. import 'package:ahgora/models/user.dart'; import 'package:flutter/material.dart'; class Home extends StatefulWidget { @override _HomeState createState() => _HomeState(); } class _HomeState

Make SliverAppBar have an image as a background instead of a color

放肆的年华 提交于 2020-07-21 04:27:33
问题 I have a SliverAppBar with a background image. When collapsed it has a blue color as a background: But instead of the blue color I want it to show the background image when collapsed: How can I achieve this? I've already tried to give the app bar a transparent background color, but it did not work. Code: void main() => runApp(MyApp()); class MyApp extends StatelessWidget { var scrollController = ScrollController(); @override Widget build(BuildContext context) { return MaterialApp( title:

Keep widget from filling ancestor Expanded in Flutter

*爱你&永不变心* 提交于 2020-07-21 02:36:28
问题 How do I keep a RaisedButton from expanding to fill an Expanded that contains it? I want to create three columns of widths proportional to the space available, but I want the child in each column to be its natural size, without consuming the entire width of its parent Expanded . Widget _controls(BuildContext cx) { return Row( children: [ Expanded( flex: 1, child: player.isOnFirstItem ? Container() : IconButton( icon: Icon(Icons.arrow_back), onPressed: () => control.gotoPreviousItem(), ), ),

Flutter : ListView : Scroll parent ListView when child ListView reach bottom - ClampingScrollPhysics not working in sized container

依然范特西╮ 提交于 2020-07-20 03:51:12
问题 I'm using Flutter version 1.12.13+hotfix. I'm looking for a solution to be able to scroll inside a ListView and when reached the bottom, automatically give scroll lead to the parent ListView. The first solution to achieve that is to use "physics: ClampingScrollPhysics()" with "shrinkWrap: true". So I apply this solution to all sub Listview except first one (the red) because I need to wrap it inside a sized Container(). The problem come from the first one... ClampingScrollPhysics() didn't work

Flutter : ListView : Scroll parent ListView when child ListView reach bottom - ClampingScrollPhysics not working in sized container

青春壹個敷衍的年華 提交于 2020-07-20 03:50:06
问题 I'm using Flutter version 1.12.13+hotfix. I'm looking for a solution to be able to scroll inside a ListView and when reached the bottom, automatically give scroll lead to the parent ListView. The first solution to achieve that is to use "physics: ClampingScrollPhysics()" with "shrinkWrap: true". So I apply this solution to all sub Listview except first one (the red) because I need to wrap it inside a sized Container(). The problem come from the first one... ClampingScrollPhysics() didn't work