Skip to content

Instantly share code, notes, and snippets.

View rutvik110's full-sized avatar
🎵
Humming

Rutvik Tak rutvik110

🎵
Humming
View GitHub Profile
@rutvik110
rutvik110 / main.dart
Created April 19, 2021 18:23 — forked from rydmike/main.dart
A Flutter long press context menu. Wrap a child with LongPressPopupMenu and it pops up at press location with its PopupMenuItem:s
// BSD 3-Clause License
//
// Copyright (c) 2021, Mike Rydstrom (Rydmike)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
@rutvik110
rutvik110 / Build error while building cloud function
Last active July 17, 2021 03:22
I'm trying to set up the firebase functions interop for writing cloud functions in dart.But the build is failing as it throws the error that some dependencies don't support null safety.I've tried to run without null safety but issue remains.
[SEVERE] build_node_compilers:entrypoint on node/index.dart:
Dart2Js finished with:
packages/js/js.dart:20:15:
Error: Null safety features are disabled for this library.
final String? name;
^
packages/path/path.dart:100:4:
Error: Null safety features are disabled for this library.
Uri? _currentUriBase;
@rutvik110
rutvik110 / gist:58093ea9cbf7c100732822b6608cdd9e
Created October 6, 2021 13:49
Implicit Animation Example
class MyAnimatedFoo extends StatefulWidget {
const MyAnimatedFoo({Key? key}) : super(key: key);
@override
State<MyAnimatedFoo> createState() => _MyAnimatedFooState();
}
class _MyAnimatedFooState extends State<MyAnimatedFoo> {
double height = 100;
@rutvik110
rutvik110 / gist:debcaaab19ceeb51059a4388b5531fd6
Last active October 6, 2021 14:15
MyCustom Implicit Animation
class MyCustomImplicitAnimation extends StatelessWidget {
const MyCustomImplicitAnimation({Key? key}) : super(key: key);
static final dimensionsTween = Tween<double>(begin: 100.0, end: 200.0);
@override
Widget build(BuildContext context) {
return Scaffold(
body: TweenAnimationBuilder<double>(
@rutvik110
rutvik110 / my_explicit_animation.dart
Created November 4, 2021 09:25
My Explicit Animation
import 'package:flutter/material.dart';
class MyExplicitAnimation extends StatefulWidget {
const MyExplicitAnimation({Key? key}) : super(key: key);
@override
_MyExplicitAnimationState createState() => _MyExplicitAnimationState();
}
class _MyExplicitAnimationState extends State<MyExplicitAnimation>
@rutvik110
rutvik110 / audio_track_visualizer.dart
Created November 20, 2021 15:24
Audio Track Visualizer
import 'dart:convert';
import 'dart:developer';
import 'dart:math' as math;
import 'dart:ui';
import 'package:audioplayers/audioplayers.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
@rutvik110
rutvik110 / audio_data.json
Last active December 19, 2021 11:45
Audio Data Json
This file has been truncated, but you can view the full file.
{
"version": 2,
"channels": 1,
"sample_rate": 48000,
"samples_per_pixel": 256,
"bits": 16,
"length": 38795,
//Only thing we need is 👇 this data points list.
"data": [
0,
@rutvik110
rutvik110 / export_to_csv_on_web.dart
Created December 1, 2021 08:59
Export To CSV on Web
import 'dart:convert';
import 'dart:html';
import 'package:csv/csv.dart';
String parseDataToCsvString(List<List<dynamic>> data) {
final String csvString =
ListToCsvConverter().convert(data, fieldDelimiter: ",");
return csvString;
}
@rutvik110
rutvik110 / analysis_options.yaml
Created December 12, 2021 08:02
Analysis Options file for flutter projects which uses VGV analysis and dart-code-metrics.
include: package:very_good_analysis/analysis_options.yaml
linter:
rules:
analyzer:
exclude:
- test/
plugins:
- dart_code_metrics
class JsonParserIsolate {
final String input;
JsonParserIsolate(this.input);
Future parseJson({Function(String)? onError}) async {
final completer = Completer();
var port = ReceivePort();
var errorPort = ReceivePort();