Skip to content

Instantly share code, notes, and snippets.

i Starting emulators: ["firestore"]
i firestore: Serving ALL traffic (including WebChannel) on http://localhost:8080
! firestore: Support for WebChannel on a separate port (8081) is DEPRECATED and will go away soon. Please use port above instead.
i firestore: Emulator logging to firestore-debug.log
+ firestore: Emulator started at http://localhost:8080
i firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:8080
+ All emulators started, it is now safe to connect.
import 'package:flutter_web/material.dart';
import 'package:flutter_web_ui/ui.dart' as ui;
void main() async {
await ui.webOnlyInitializePlatform();
double position = 0;
runApp(
MaterialApp(
@creativecreatorormaybenot
creativecreatorormaybenot / GT-810 (rolex) Android 7.1
Created September 16, 2019 12:04
CursorWindowAllocationException crash
java.lang.RuntimeException:
at com.google.firebase.firestore.util.AsyncQueue.access$200 (AsyncQueue.java)
or .createAndScheduleDelayedTask (AsyncQueue.java)
or .enqueueAndForget (AsyncQueue.java)
or .lambda$panic$5 (AsyncQueue.java)
or .verifyIsCurrentThread (AsyncQueue.java)
at com.google.firebase.firestore.util.AsyncQueue$$Lambda$5.run (AsyncQueue.java)
import 'package:flutter_web/material.dart';
import 'package:flutter_web_ui/ui.dart' as ui;
void main() async {
await ui.webOnlyInitializePlatform();
double position = 0;
runApp(
MaterialApp(
java.lang.RuntimeException:
at com.google.firebase.firestore.util.AsyncQueue.b (AsyncQueue.java:19)
at com.google.firebase.firestore.util.AsyncQueue$$Lambda$5.run (AsyncQueue.java:2)
at android.os.Handler.handleCallback (Handler.java:790)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6647)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:811)
08-01 08:25:52.232: D/ndk_translation(9587): loaded library "/data/app/app-1/lib/arm/libflutter.so" at 0x9bbe1000
08-01 08:25:52.232: D/ndk_translation(9587): [ linking libflutter.so ]
08-01 08:25:52.273: D/ndk_translation(9587): loaded proxy library "libandroid.so"
08-01 08:25:52.318: I/ActivityManager(1620): Waited long enough for: ServiceRecord{9bafd7b u0 com.google.android.gms/.statementservice.OperationService}
08-01 08:25:52.346: D/ndk_translation(9587): loaded proxy library "libEGL.so"
08-01 08:25:52.400: D/ndk_translation(9587): loaded proxy library "libGLESv2.so"
08-01 08:25:52.458: D/ndk_translation(9587): proxy_libc.so: symbol '__dso_handle' is null
08-01 08:25:52.464: E/ndk_translation(9587): Failed to find data 'in6addr_any'
08-01 08:25:52.464: E/ndk_translation(9587): Failed to find data 'in6addr_loopback'
08-01 08:25:52.486: D/ndk_translation(9587): loaded proxy library "libc.so"
(19.0.0) [Persistence]: Starting transaction: Allocate query
(19.0.0) [WatchStream]: (e600d78) Stream sending: # com.google.firestore.v1.ListenRequest@9a8122a7
add_target {
query {
parent: "projects/{project}/databases/(default)/documents"
structured_query {
from {
collection_id: "{collection_a}"
}
limit {
import 'template_string.dart';
main() {
final templateUrl = TemplateString('{host}/api/v3/{container}/{resourceid}');
final params = <String, dynamic>{'host': 'www.api.com', 'container': 'books', 'resourceid': 10};
print(templateUrl.format(params)); // www.api.com/api/v3/books/10
print(TemplateString('no parameters').format({})); // no parameters
print(TemplateString('{only}{parameters}')
@creativecreatorormaybenot
creativecreatorormaybenot / navigation_notifier.dart
Last active July 26, 2019 04:54
If you want your State.didChangeDependencies method to be called when a new route is pushed or popped above, just use this mixin.
import 'package:flutter/material.dart';
/// When using this mixin by appending `with NavigationNotifierMixin` to
/// your [State], your [State.didChangeDependencies] method will be called
/// every time the [Navigator] pushes a route or pops any route above the
/// route your [StatefulWidget] lives in.
mixin NavigationNotifierMixin<T extends StatefulWidget> on State<T> {
@override
void didChangeDependencies() {
// The TickerMode InheritedWidget changes when navigating,
@creativecreatorormaybenot
creativecreatorormaybenot / main.dart
Last active July 25, 2019 19:55
NonStopTickerProviderMixin
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
mixin NonStopTickerProviderMixin implements TickerProvider {
@override
Ticker createTicker(TickerCallback onTick) => Ticker(onTick);
}
void main() {
runApp(MaterialApp(home: const Init()));