flutter-layout

Remove extra part after clipping in Flutter

若如初见. 提交于 2019-12-11 14:56:56
问题 Clipping allows me to draw only the part which I want to show. How do I remove the extra part which is not drawn but still takes up space? The code import 'package:flutter/material.dart'; class ClipTut extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Row( children: <Widget>[ ClipRect( clipper: CustomRect(), child: Container( decoration: BoxDecoration( border: Border.all(width: 4, color: Colors.black), color: Colors.blue, ), width:

how to scroll outer scrollview when inner scrollview reaches to the end in flutter?

大憨熊 提交于 2019-12-11 14:52:36
问题 I have a SingleChildScrollView as a child widget inside its parent SingleChildScrollView widget as in the image below, Currently when I scroll down the touching area in the inner scrollview, the inner scrollview scrolls down and nothing moves when it reaches the bottom. But I want the whole screen(outer scrollview) starts scrolling when the inner scrollview reaches the bottom as below. (It doesn't matter if I have to tap again in order to scroll the outer scrollview) How could I achieve the

Does anyone know how to implement a search bar with tabs like that similar to instagram using flutter?

有些话、适合烂在心里 提交于 2019-12-11 14:35:36
问题 I want to know how to build a search bar where it filters the users search input into groups or tabs such as people, tags, places just like what instagram has but I don't know how to do this! 回答1: It could look like this: import 'package:flutter/material.dart'; main() => runApp( MaterialApp( // home: Scaffold( // body: Container(child: SearchButton()), home: Body()), ); class Body extends StatefulWidget { @override _BodyState createState() => _BodyState(); } class _BodyState extends State

Flutter: Firebase Pushnotification On Data Change

痴心易碎 提交于 2019-12-11 12:17:32
问题 After getting the comment, i have deployed this folowing code to my firebase project and it was successfully deploed!.But there is no notifications been send to me. Please check my Firebase Realtime database Screenshot here for better understanding. [ITS SOLVED NOW:IT WILL SEND NOTIFICATIONS TO ONLY ONE ID ie My Admin Device] WORKING CODE: const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(functions.config().firbase); exports

Flutter: How to use AnimatedContainer with Expanded in Column?

血红的双手。 提交于 2019-12-11 11:02:38
问题 Let's say we have 3 children of a Column : Flexible( flex:1, child: Container( color: Colors.red, ), ), Flexible( flex:3, child: Container( color: Colors.yellow, ), ), Flexible( flex:1, child: Container( color: Colors.blue, ), ), I want to programmatically expand middle child with flex=3 to cover the whole Column with smooth animation, while the top and bottom children shrinks accordingly. Right now my setup is with a Column and Flexible widgets. However if you can think of a solution with

Unwanted space appearing between RaisedButton widgets in a column

不打扰是莪最后的温柔 提交于 2019-12-11 10:55:42
问题 tl;dr Why is space appearing between my two buttons when I have not explicitly set any? I am trying to make a layout like the one below: However, what appears to be about 16px of space appears between the two buttons and I cannot figure out where it is coming from. I at first thought maybe the Column was adding space but I am using MainAxisAlignment.center which shouldn't add any. I now think that there is perhaps some Material theming going on that automatically applies padding to the

How to fetch api data by passing variables (parameters)?

坚强是说给别人听的谎言 提交于 2019-12-11 08:56:05
问题 I am fetching api data for sports player for which I need to pass unique player id . Currently, I have to pass pid manually which fetches only one player's data at a time. But I would like to fetch multiple players data and display it in listView . API endpoint is: https://cricapi.com/api/playerStats?apikey=&pid=0000. I am able to parse above url, fetch it's result and display in UI properly, but I want to fetch multiple players data and not just one. Code to fetch api: FetchJson() async {

Flutter - How can I push to other Route without user interaction (like onTap)?

余生颓废 提交于 2019-12-11 08:46:13
问题 I am an iOS developer, and trying Flutter now. As the title, what I want to achieve is to make a class act like "manager", to control my page route on app start. For example in iOS, I can check a 'Bool' inside AppDelegate (didFinishedLaunchingWithOptions) / ViewController (ViewDidLoad/Appear) and change the rootViewController or push to a desire ViewController depends on the 'Bool', like something 'isLogin' to rather push to LoginViewController / LoggedViewController. I know I can do Push on

Flutter column auto height by parent row

删除回忆录丶 提交于 2019-12-11 07:29:54
问题 I try use Column auto height but still not working. Example Card Row Expanded(flex:4) NetworkImage (this image has height 120) Expanded(flex: 4) Container Column (this is column what I need) So I found solution that I have to use Expanded widget so I tried it and got exception Card Row Expanded(flex: 4) NetworkImage (this image has height 120) Expanded(flex: 4) Container Expanded Column (this is column what I need) Expanded widgets must be placed directly inside Flex widgets. I/flutter (14383

Not able to prepopulate dropdown with object in flutter

。_饼干妹妹 提交于 2019-12-11 06:07:18
问题 I've a dropdown which is populated with objects received from API. The problem is I'm not able to pre-populate the dropdown with the object when the user takes edit. Here is the sample JSON: [{"_id":"435463","userId":"3423423","username":"ma","categoryId":"5656756","insurerId":"567544","packageId":"5675","categoryName":"vehicle insurance","insurerName":"lic","packageName":"family"}, {"_id":"4564644","userId":"2342344","username":"ma","categoryId":"6575744","insurerId":"567567","packageId":