Skip to content

Instantly share code, notes, and snippets.

View yasinarik's full-sized avatar
🎯
Focusing

Yasin Arık yasinarik

🎯
Focusing
View GitHub Profile
@vejmartin
vejmartin / flutter_android_rubber_band.dart
Created April 21, 2019 09:08
Android Rubber Band and Cupertino Transition
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
@PlugFox
PlugFox / dottedBorder.dart
Last active February 15, 2021 07:22
Flutter Web simple file upload
import 'package:flutter_web/material.dart';
import 'dart:math' as math;
class DottedBorder extends StatelessWidget {
final Color color;
final double strokeWidth;
final double gap;
final Widget child;
final EdgeInsets padding;
import 'package:flutter/material.dart';
class AnimatedCount extends ImplicitlyAnimatedWidget {
AnimatedCount({
Key key,
@required this.count,
@required Duration duration,
Curve curve = Curves.linear,
}) : super(duration: duration, curve: curve, key: key);
@osaxma
osaxma / hasura_connect_ex.dart
Last active March 4, 2024 09:38
a workaround for keeping haura_connect subscriptions alive when using JWT
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`