Flutter

Flutter: Implementing a peek & pop effect

旧城冷巷雨未停 提交于 2021-02-07 04:18:54
问题 I was trying to achieve a peek & pop effect - when the user taps and hold on to a card, a dialog opens, and dismissed when the user no longer tap holding on the screen: Listener( onPointerDown: (PointerDownEvent e) { // open dialog showDialog( context: context, builder: (context) => Container( child: Card(), )); }, onPointerUp: (PointerUpEvent e) { // dismiss dialog if (Navigator.of(context).canPop()) { Navigator.of(context).pop('dialog'); } }, child: Card() ) It worked nicely which shows the

Flutter: Implementing a peek & pop effect

前提是你 提交于 2021-02-07 04:18:45
问题 I was trying to achieve a peek & pop effect - when the user taps and hold on to a card, a dialog opens, and dismissed when the user no longer tap holding on the screen: Listener( onPointerDown: (PointerDownEvent e) { // open dialog showDialog( context: context, builder: (context) => Container( child: Card(), )); }, onPointerUp: (PointerUpEvent e) { // dismiss dialog if (Navigator.of(context).canPop()) { Navigator.of(context).pop('dialog'); } }, child: Card() ) It worked nicely which shows the

Flutter: Implementing a peek & pop effect

会有一股神秘感。 提交于 2021-02-07 04:18:08
问题 I was trying to achieve a peek & pop effect - when the user taps and hold on to a card, a dialog opens, and dismissed when the user no longer tap holding on the screen: Listener( onPointerDown: (PointerDownEvent e) { // open dialog showDialog( context: context, builder: (context) => Container( child: Card(), )); }, onPointerUp: (PointerUpEvent e) { // dismiss dialog if (Navigator.of(context).canPop()) { Navigator.of(context).pop('dialog'); } }, child: Card() ) It worked nicely which shows the

Pass trough all gestures between two widgets in Stack

不打扰是莪最后的温柔 提交于 2021-02-07 03:34:44
问题 I'm working on an app where I display markers over a map like so: The way it works is markers are rendered "over" the Map widget as Stack . My problem is that currently, the markers 'absorbs' the gestures used to control the map underneath (if the gesture starts on the marker). I was therefore wondering, is there a way to pass through all gestures events between two widgets in a stack? Ideally, the marker would ignore (and pass through) all events except onTap (as I still want to be able to

Pass trough all gestures between two widgets in Stack

被刻印的时光 ゝ 提交于 2021-02-07 03:33:20
问题 I'm working on an app where I display markers over a map like so: The way it works is markers are rendered "over" the Map widget as Stack . My problem is that currently, the markers 'absorbs' the gestures used to control the map underneath (if the gesture starts on the marker). I was therefore wondering, is there a way to pass through all gestures events between two widgets in a stack? Ideally, the marker would ignore (and pass through) all events except onTap (as I still want to be able to

Pass trough all gestures between two widgets in Stack

白昼怎懂夜的黑 提交于 2021-02-07 03:29:44
问题 I'm working on an app where I display markers over a map like so: The way it works is markers are rendered "over" the Map widget as Stack . My problem is that currently, the markers 'absorbs' the gestures used to control the map underneath (if the gesture starts on the marker). I was therefore wondering, is there a way to pass through all gestures events between two widgets in a stack? Ideally, the marker would ignore (and pass through) all events except onTap (as I still want to be able to

How to pass widget constructor as a parameter for another widget to build

梦想的初衷 提交于 2021-02-07 03:13:10
问题 Is there a way to pass one widget as a parameter to another? My code has something similar to this with two TextWidget of type BoldWidget and ItalicWidget : abstract class TextWidget extends StatelessWidget { final String text; TextWidget({ @required this.text, }); } class BoldWidget extends TextWidget { @override Widget build(BuildContext context) { return Text(this.text, style: TextStyle(fontWeight: FontWeight.bold),); } } class ItalicWidget extends TextWidget { @override Widget build

Video background in flutter

旧巷老猫 提交于 2021-02-07 02:48:29
问题 It is possible to have a background video playing all time in flutter? i was looking for some packages and trying to make it function but i dont know how. maybe using something like this but with video. decoration: new BoxDecoration( image: new DecorationImage( image: new AssetImage("images/f1.jpg"), fit: BoxFit.cover, ),), inside a container. 回答1: Try this package https://pub.dartlang.org/packages/video_player the example provided is pretty straight forward to follow. You can then just place

Flutter: how to let a file be opened by an external app (like Android's implicit intent)?

隐身守侯 提交于 2021-02-06 19:54:20
问题 I am building a Flutter app that essentially fetches data from the cloud. The data type varies, but they're commonly an image, pdf, text file, or an archive (zip file). Now I want to fire an implicit intent, so the user can choose their favorite app to handle the payload. I've searched for answers, and I have tried the following routes: url_launcher plugin (as suggested in How to open an application from a Flutter app?) android intent share plugin Route #3 is not really what I wanted, since

flutter doctor --android-licenses gives a java error

强颜欢笑 提交于 2021-02-06 14:46:29
问题 Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156) at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75) at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81) at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73) at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli