flutter-layout

Flutter expansion tile remove trailing

旧街凉风 提交于 2021-01-29 12:30:47
问题 i have a exoansiontile and i want it to be like a box, everything centered, the problem is that if i add a text that is too long, i get the overflow error and i think this is caused by the trailing of the expansion tile. Here is a picture: https://gyazo.com/c29329106dc5dcb162b71b5f41951b67 Here is the code: ExpansionTile( trailing: Text(''), leading: Container( margin: new EdgeInsets.only(left: 0, top: 10.0, right: 0.0, bottom: 0.0), child: Image.asset( 'images/food.png' )), title: Row(

Flutter custom font multi weight doesn't work properly

…衆ロ難τιáo~ 提交于 2021-01-29 12:14:43
问题 I'm trying to use a family font with multi weight in a flutter. But when I use font style with weight bold (w700) and heavy(w800) , it doesn't work. Only work until semibold/medium (w600) Here is my font assets folder structure : myapp\assets\fonts\unisans\unisans_Bold.ttf myapp\assets\fonts\unisans\unisans_Heavy.ttf myapp\assets\fonts\unisans\unisans_Reguler.ttf myapp\assets\fonts\unisans\unisans_Semibold.ttf Defined fonts in pubspec.yaml : fonts: - family: Unisans fonts: - asset: assets

A RenderFlex overflowed by 40 pixels on the bottom problem

爷,独闯天下 提交于 2021-01-29 11:13:53
问题 Another exception was thrown: A RenderFlex overflowed by 40 pixels on the bottom. I am getting this error. Please someone help me. I am new in flutter. I did change lots of things on the code but still couldn't change the result. import 'package:flutter/material.dart'; import 'package:estilo/pages/cart.dart'; class Cart_products extends StatefulWidget { @override _Cart_productsState createState() => _Cart_productsState(); } class _Cart_productsState extends State<Cart_products> { var Products

Is there any memory issues when using timer and nested stream in flutter app

喜你入骨 提交于 2021-01-29 08:49:52
问题 I am using nested stream and a timer method for my app. Which is like a display board changes values (or screen) in every 10 seconds and repeat. I have not any quite idea about the problems in my code (it just seems working well), also thinking to add a clock in my screen, which am not sure how to implement yet (using stream again or with initstate ). Please check my main code and give me some tips to clean up any issues if there. My app is using firebase to get latest data. class OmApp

Customize the click effect of a widget in Flutter

岁酱吖の 提交于 2021-01-29 07:21:00
问题 How to customize the click effect of a widget in Flutter, which can be configured in Android: <?xml version="1.0" encoding="UTF-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/btn_pressed" /> <!-- pressed --> <item android:state_focused="true" android:drawable="@drawable/btn_normal" /> <!-- focused --> <item android:drawable="@drawable/btn_normal" /> <!-- default --> </selector> I want to ask how to

cannot access the body fields of a Request without content-type - Flutter

↘锁芯ラ 提交于 2021-01-29 06:38:29
问题 I am having an issue making an HTTP PUT requests in a flutter. I can print the data on the console but when I tried to parse it to the endpoint that performs a PUT request, it return a response of 404 please can anyone help me? and this is the message: cannot access the body fields of a Request without content-type "application/x-www-form-urlencoded" Here is the actual problem: for (Products i in selectedProducts) { var stockupdate = { "oid": i.oid, // I can't get the oid here "unitInStock":

Flutter :- How to scroll the sceen without shrink the screen on the Stack view?(Scroll the the whole screen when the keyboard appears )

你。 提交于 2021-01-28 19:17:07
问题 Description I am creating the login screen in which I have used the Stack widget, Currently, everything works fine but only one issue of the shrinking the view. When I use the resizeToAvoidBottomPadding: false inside the Scaffold then screen shrinking disappear but another problem arise that whole screen scroll not working, please check below lines of code class _LoginScreen extends State<LoginScreen> { @override Widget build(BuildContext context) { // TODO: implement build return Scaffold(

How do i change the color and text of Container at onTap event in FLUTTER

一世执手 提交于 2021-01-28 19:13:22
问题 I have two containers in a row and what i want to do is when i click the 1st container it changes its color as well as the 2nd container i.e. - when i click on 1st container it make it look like selected and the other one deselected and same as on 2nd container. Is there anyway to do that? GestureDetector( onTap: () { print('its getting pressed'); }, child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Expanded( child:

flutter checkbox not working in StatelessWidget

橙三吉。 提交于 2021-01-28 19:10:30
问题 Here is my class class Home extends StatelessWidget { and the Checkbox goes here. @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Padding( padding: EdgeInsets.all(20.0), child: Column( children: <Widget>[ TextField( controller: ctrlMotherName, decoration: InputDecoration( labelText: "Name of Mother", border: OutlineInputBorder() ) ),