flutter-layout

How to change cursor color in flutter

ぃ、小莉子 提交于 2019-12-20 04:37:16
问题 Dears, I have 2 qestions in flutter If you don't mind. 1- How to change the color of the cursor as it default blue and I don't like it 2- how can I make the text at the bottom of the screen whatever the screen size. ?? Thank you in advance. 回答1: put cursorColor: Colors.white, inside TextFormField 回答2: For question 1 you can set the cursorColor for theme attribute when calling MaterialApp like the below new MaterialApp( title: "Flutter App", theme: ThemeData( cursorColor: Colors.red, home:

Flutter change wave quadraticBezierTo points

ぐ巨炮叔叔 提交于 2019-12-20 04:28:15
问题 with this below implementation code we have this custom shape design: and in this design i want to change that to: as i just learn create custom shape i can't do that, is any body can help me how to achieve that? thanks import 'package:flutter/material.dart'; class WaveClipperTwo extends CustomClipper<Path> { bool reverse; WaveClipperTwo({this.reverse = false}); @override Path getClip(Size size) { var path = Path(); if(!reverse) { path.lineTo(0.0, size.height - 20); var firstControlPoint =

Transparent PageRoute in Flutter for displaying a (semi-) transparent page

拥有回忆 提交于 2019-12-19 17:24:19
问题 Would it be possible to have a page route with a transparent background so I can show a (semi-)transparent page on top of an existing page? 回答1: Yes, definitely! One solution would be to extend PageRoute and make the opaque getter return false. A possible solution could look like the following: import 'package:flutter/widgets.dart'; class TransparentRoute extends PageRoute<void> { TransparentRoute({ @required this.builder, RouteSettings settings, }) : assert(builder != null), super(settings:

Flutter: Vertical Text widget

不问归期 提交于 2019-12-19 09:47:15
问题 I looked up here and pub.dev and flutter docs but could not find(or could not word my query) any solution for this simple task. I want to display a String with its letters going from up to down while keeping the letter orientations default. So a rotated Text() would not work. My desired outcome is this: H E L T L H O A N W K O S R ❤️ L D Also, I would need to wrap the String to the next line(column in this case) A height parameter is necessary to limit the number of letters from top to down

What is the alternative to RecyclerView in Flutter?

南楼画角 提交于 2019-12-19 07:26:05
问题 What is the alternative to Recycle view in flutter I have tried using this code but how to do Animination with listview widget in flutter Is this valid? ListView( children: <Widget>[ ListTile( leading: Icon(Icons.map), title: Text('Map'), ), ListTile( leading: Icon(Icons.photo_album), title: Text('Album'), ), ListTile( leading: Icon(Icons.phone), title: Text('Phone'), ), ], ); 回答1: You can also use animatedlist widget for animations. code example are given in the following link. AnimatedList

Flutter ListView.Builder() in scrollable Column with other widgets

北城以北 提交于 2019-12-19 05:11:44
问题 I have a TabBarView() with an amount of different views. I want of them to be a Column with a TextField at top and a ListView.Builder() below, but both widgets should be in the same scrollable area (scrollview). The way I implemented it threw some errors: @override Widget build(BuildContext context) { return new Column( mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: <Widget>[ new Padding( padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),

Flutter: RenderBox was not laid out

和自甴很熟 提交于 2019-12-19 05:04:36
问题 I'm trying to create a ListView but when I import the list_form.dart class i get this error. Maybe I made some mistakes with the layout because if I try to run it inside the main file I don't get this error. This is the error: I/flutter (12956): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════ I/flutter (12956): The following assertion was thrown during performResize(): I/flutter (12956): Vertical viewport was given unbounded height. I

Flutter: RenderBox was not laid out

主宰稳场 提交于 2019-12-19 05:04:10
问题 I'm trying to create a ListView but when I import the list_form.dart class i get this error. Maybe I made some mistakes with the layout because if I try to run it inside the main file I don't get this error. This is the error: I/flutter (12956): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════ I/flutter (12956): The following assertion was thrown during performResize(): I/flutter (12956): Vertical viewport was given unbounded height. I

flutter design Curves layout as single widget

☆樱花仙子☆ 提交于 2019-12-19 04:56:15
问题 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

Flutter: How to Get the Number of Text Lines

旧街凉风 提交于 2019-12-19 02:38:08
问题 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? 回答1: 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