This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { dataProcessor } from "./processors"; | |
export const parseDataToAlgoliaFormat = (snapshot: { [key: string]: any }) => { | |
let payload: { | |
[key: string]: boolean | string | number; | |
} = { | |
objectID: snapshot.id ?? snapshot.objectID, | |
path: snapshot.path | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'dart:math' as math; | |
List<double> loadparseJson(String jsonBody) { | |
final data = jsonDecode(jsonBody); | |
final List<int> points = List.castFrom(data['data']); | |
List<int> filteredData = []; | |
// Change this value to number of audio samples you want. | |
// Values between 256 and 1024 are good for showing [RectangleWaveform] and [SquigglyWaveform] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
//a state notifier that can be used to call a future after an event. | |
//it will automatically update the state when the future completes | |
//call [doRequest] to call the future | |
//pass in [request] to the [doRequest] function or in the constructor | |
//the [request] in the doRequest function will take precendence over the [request] in the constructor | |
class FutureStateNotifier<T> extends StateNotifier<AsyncValue<T>> { | |
FutureStateNotifier({this.request}) : super(AsyncValue<T>.loading()); | |
final Future<T> Function()? request; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JsonParserIsolate { | |
final String input; | |
JsonParserIsolate(this.input); | |
Future parseJson({Function(String)? onError}) async { | |
final completer = Completer(); | |
var port = ReceivePort(); | |
var errorPort = ReceivePort(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include: package:very_good_analysis/analysis_options.yaml | |
linter: | |
rules: | |
analyzer: | |
exclude: | |
- test/ | |
plugins: | |
- dart_code_metrics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>( |