flutter-layout

How to build a list view builder from a form with values from the form

大城市里の小女人 提交于 2020-01-16 08:59:16
问题 I have a Flutter app that takes an input from a user and build a list on to another page but when I try to build the list on the other page it routes but it does not build the list and I have another function with the thing but does not route to the page I want instead it routes to a page I just made up right there this is the form code import 'package:flutter/material.dart'; import 'cont.dart'; import 'user.dart'; typedef OnDelete(); class UserForm extends StatefulWidget { final User user;

Created data from Firebase database keeps overlapping on one another

北慕城南 提交于 2020-01-16 08:19:28
问题 Can you help me with my problem? I managed to read my data from the Firebase Database but for some reason they look like this: What I want is to just have them displayed correctly in a column like manner with an image in the background my code that is used to build the widgets is below: Widget buildItem(DocumentSnapshot doc) { return Padding( padding: const EdgeInsets.all(8.0), child: Column( // crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text('Name: ${doc.data[

how to refresh state on Navigator.Pop or Push in flutter

雨燕双飞 提交于 2020-01-16 05:24:05
问题 Here I have two pages first is called BSP_signup_terms page and the second is Bsp_Service_page . when I am on BSP_signup_terms on that page I have to select some checkbox based on the selected checkbox it will show me some data. but problem is that it will show me the complete data but when I get back to the BSP_signup_terms from Bsp_signup_page and I am changing the checkbox and then again when I am pressing next button it will not change the result it same as the previous result. Here is

How to set Flutter CameraPreview Size “Fullscreen”

只愿长相守 提交于 2020-01-15 21:30:15
问题 Iam using CameraPreview for measuring height of an object,But the issue was i cant able to set cameraPreview height full screen.. I have tried Positioned widget , it fills the screen but the image was stretched. I have tried Transform Widget , but height does not fills fullscreen, white space is coming.Image is not stretched. Mycode: final size = MediaQuery.of(context).size; final deviceRatio = size.width / size.height; return Stack( children: <Widget>[ Transform.scale( scale: controller

How to add a circular dot as an indicator in Flutter Tabs?

随声附和 提交于 2020-01-15 06:38:55
问题 We wish to generate the following layout as Scrolling Tabs in Flutter: I tried using indicator property of TabBar to customise the indicator to green dot. THE indicator property takes a Decoration inherited Widget which may have BoxDecoration , ShapeDecoration and UnderlineTabDecoration as options. Both BoxDecoration and ShapeDecoration surround the Tab content hence make it difficult to add a circle below the tab. UnderlineTabDecoration doesn't provide any methods to round the edges and

How to add a circular dot as an indicator in Flutter Tabs?

情到浓时终转凉″ 提交于 2020-01-15 06:37:07
问题 We wish to generate the following layout as Scrolling Tabs in Flutter: I tried using indicator property of TabBar to customise the indicator to green dot. THE indicator property takes a Decoration inherited Widget which may have BoxDecoration , ShapeDecoration and UnderlineTabDecoration as options. Both BoxDecoration and ShapeDecoration surround the Tab content hence make it difficult to add a circle below the tab. UnderlineTabDecoration doesn't provide any methods to round the edges and

Calling a function on an event from another class Flutter

≯℡__Kan透↙ 提交于 2020-01-14 05:58:41
问题 I've been having this problem with Flutter and I don't know how to handle it. I was trying to go through some of the tutorials and then I wanted to do this. What I want to do is to call from the FloatingActionButton on the onPresssed event ._increment , so that I can increment the _counter . But then I get that error. What am I missing? void main() { runApp(MaterialApp( title: 'Flutter Tutorial', home: TutorialHome(), )); } class TutorialHome extends StatelessWidget { @override Widget build

How to remove overscroll on ios?

给你一囗甜甜゛ 提交于 2020-01-11 07:32:06
问题 By default, flutter adds a overscroll effect on ListView/GridView/... on ios I would like to remove this effect entirely or on one specific scrollable. What can I do ? 回答1: I found this answer (https://stackoverflow.com/a/51119796/5869913) and just added information about deleting overscroll effect. The overscroll effect comes from BouncingScrollPhysics added by ScrollBehavior To remove this effect, you need to specify a custom ScrollBehavior and override getScrollPhysics method. For that,

Upload image with http.post and registration form in Flutter?

假如想象 提交于 2020-01-10 05:38:05
问题 so i want to upload a File (image) to a server with a bunch of other variable (Strings) String firstname , lastname , birthDay, phone , adresse ; File image; return http.post( uri, headers: { 'Accept': 'application/json', "Authorization": "Bearer $token", }, body: body, encoding: encoding, ); Future<http.Response> postRegisteration() async { return await api.httpPost('fotApp/master', body: { 'firstname': 'lorem', 'lastname': 'lorem', 'birthDay': 'lorem', 'adresse': 'lorem', 'phone': 'lorem',

Flutter Back button with return data

断了今生、忘了曾经 提交于 2020-01-09 07:52:26
问题 I have an interface with two buttons that pop and return true or false, like so: onPressed: () => Navigator.pop(context, false) I need to adapt the back button in the appbar, so it pops and also returns false. Is there a way to accomplish this? 回答1: This may help and work for you 1st screen void goToSecondScreen()async { var result = await Navigator.push(_context, new MaterialPageRoute( builder: (BuildContext context) => new SecondScreen(context), fullscreenDialog: true,) ); Scaffold.of(