Notes on working with Hasura & Postgres docker containers in a local mac environment.
Table of content:
| // so it doesn't conflict with Image from material package | |
| import 'dart:ui' as ui; | |
| import 'package:flutter/material.dart'; | |
| // svg from hero patterns (I Like Food): https://www.heropatterns.com/ | |
| // converted to CustomPainter code using: https://fluttershapemaker.com/ | |
| void main() { | |
| runApp(SvgPatternExample()); |
| import 'dart:async'; | |
| import 'package:meta/meta.dart'; | |
| import 'package:hasura_connect/hasura_connect.dart'; | |
| import 'package:http/http.dart' as http; | |
| // problem: | |
| // when subscribing to`HasuraConnect.subscription`, a websocket connection is created on the first subscription | |
| // call. The websocket connection is created only once with the initial subscription and the provided TokenInterceptor | |
| // or headers. When the token expires during an active subscription, HasuraConnect doesn't stop the subscription, or try | |
| // to reconnect with the latest token in in the TokenInterceptor nor does it throw an error. It'll keep calling `onRequest` |
| // Based on Flutter 1.26.0-17.3.pre Dart SDK 2.10.4 | |
| // filed issue at https://github.com/dart-lang/sdk/issues/44876 | |
| main() { | |
| final datetimeParsed = DateTime.parse('2021-02-05T22:37:12.933232+00:00'); | |
| final datetimeMS = DateTime.fromMicrosecondsSinceEpoch(1612564632933232); | |
| print(datetimeParsed.toIso8601String()); // prints 2021-02-05T22:37:12.933Z | |
| print(datetimeMS.toUtc().toIso8601String()); // prints 2021-02-05T22:37:12.933Z | |
| print(datetimeParsed.microsecondsSinceEpoch); // prints 1612564632933000 |
Notes on working with Hasura & Postgres docker containers in a local mac environment.
Table of content:
| // answer for: | |
| // https://stackoverflow.com/questions/64826393/how-can-i-implement-this-specific-scroll-animation-using-flutter/ | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( |
| // taken from: https://github.com/iampawan/FlutterBackdrop | |
| // copy paste to https://dartpad.dev/ and should work | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(MaterialApp( | |
| debugShowCheckedModeBanner: false, | |
| theme: ThemeData(primarySwatch: Colors.teal), | |
| home: BackdropPage(), |