flutter-layout

how to display animated gif in flutter?

烈酒焚心 提交于 2020-06-25 21:35:46
问题 I am trying to display gif in flutter. I am using the code Image(image : NetworkImage(message.image_url)) But it shows error: Another exception was thrown: Exception: HTTP request failed, statusCode: 403, https://media.giphy.com/media/13AXYJh2jDt2IE/giphy.gif%20 回答1: Place your gif in your images folder of your project and mention it in pubspec.yaml file,just like you do for images. Image.asset( "images/loading.gif", height: 125.0, width: 125.0, ) 回答2: This is what used in Flutter Gallery app

Using TextFormField in Stateless widget is very difficult in flutter

人走茶凉 提交于 2020-06-25 09:24:58
问题 I am trying to use TextFormField in a stateless widget along with ScopedModel to deal with text in it and facing various issues as follow. I tried using controller for field, but everytime I enter some text and press done on keyboard, text gets cleared. No idea as to why. If I remove controller, text stays in field but new problem gets created as to how to get text from field. I solved it by using callback onFieldSubmitted . But turns out, onFieldSubmitted is only getting called when we click

Create widget with transparent hole inside

荒凉一梦 提交于 2020-06-24 10:31:29
问题 How can I create a semi-transparent background with the transparent hole inside? I tried to use decoration and foreground decorations with different blend modes, stack, ClipRect, colorfilters, but nothing works. I will appreciate any ideas. Thanks! 回答1: The "easiest" way I've found to do it is using a ColorFiltered Widget with a Stack . The following code will create exactly what you need: @override Widget build(BuildContext context) { return Material( child: Stack( fit: StackFit.expand,

Create widget with transparent hole inside

久未见 提交于 2020-06-24 10:29:29
问题 How can I create a semi-transparent background with the transparent hole inside? I tried to use decoration and foreground decorations with different blend modes, stack, ClipRect, colorfilters, but nothing works. I will appreciate any ideas. Thanks! 回答1: The "easiest" way I've found to do it is using a ColorFiltered Widget with a Stack . The following code will create exactly what you need: @override Widget build(BuildContext context) { return Material( child: Stack( fit: StackFit.expand,

How to create a transparent full screen dialog on top of activity - Flutter

眉间皱痕 提交于 2020-06-24 07:23:39
问题 I am trying to create a transparent full screen dialog on top of activity. I have tried following this thread but solution doesn't work. In short , what I need is: full screen dialog. transparent background except for the widget I use for the dialog here's my code: To open dialog void onNextBtnClick(){ var route = new MaterialPageRoute( builder: (BuildContext context) => new GenreDialogUI(),fullscreenDialog: true ); Navigator.of(context).push(route); } For Dialog view import 'package:flutter

How to create a transparent full screen dialog on top of activity - Flutter

China☆狼群 提交于 2020-06-24 07:23:09
问题 I am trying to create a transparent full screen dialog on top of activity. I have tried following this thread but solution doesn't work. In short , what I need is: full screen dialog. transparent background except for the widget I use for the dialog here's my code: To open dialog void onNextBtnClick(){ var route = new MaterialPageRoute( builder: (BuildContext context) => new GenreDialogUI(),fullscreenDialog: true ); Navigator.of(context).push(route); } For Dialog view import 'package:flutter

Animated container : RenderFlex overflowed by 154 pixels on the bottom

有些话、适合烂在心里 提交于 2020-06-23 13:18:31
问题 I have a problem when resizing an animated container while setting different content height. It throws exception while resizing : ════════ Exception caught by rendering library ════════ The following assertion was thrown during layout: A RenderFlex overflowed by 154 pixels on the bottom. Here is a minimal example to reproduce the problem (much more complex in my real app but you get the point) : bool expanded; initState() { super.initState(); expanded = false; } void _toggleMode() { setState(

Load more data using Stream Builder in list view

岁酱吖の 提交于 2020-06-17 14:00:27
问题 I am trying to develop an app in flutter, that has topics that the user scroll the Listview end pull the data from api and reload into listview using StreamBuilder and onRefresh its not working.i tried i am not able do that. i implemented scroll view in _GetShaftsState class its not working where do implement? Any one can explain? Example loading more data when list view scroll end again call service api to load the data into listview when first time load record count 30 at end of list view

Flutter: Change status bar color in iOS

本秂侑毒 提交于 2020-06-17 13:20:07
问题 I want to change status bar color with package:flutter/services.dart package but it doesn't work. I am using Mac and iOS simulator: Mojave 10.14.6 iOS 12.2 simulator / Xr Flutter 1.9.1+hotfix.2 Tools • Dart 2.5.0 import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { SystemChrome.setSystemUIOverlayStyle(