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
/** | |
* To know more about the Check digit: | |
* https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit | |
* | |
* An interface to test your VIN number: | |
* https://vpic.nhtsa.dot.gov/decoder/CheckDigit/Index/IJTJHZKFA7M203455 | |
**/ | |
class BarcodeAnalyser { | |
/** |
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
#!/bin/bash | |
#################################################################################################### | |
# This is a helper script to pull cached files on the device (or Emulator). | |
# Android 13 and above doesn't let us see the cached files from the Device Explorer. So, this | |
# script help us to pull them and look at it whenever needed. | |
#################################################################################################### | |
# Download the files of the app ($1: package name) | |
# and store it under the provided path ($2) | |
pullAllFilesUnderThePath() { |
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
# Uncomment this line to define a global platform for your project | |
platform :ios, '13.0' | |
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. | |
ENV['COCOAPODS_DISABLE_STATS'] = 'true' | |
project 'Runner', { | |
'Debug' => :debug, | |
'Profile' => :release, | |
'Release' => :release, |
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
#!/bin/bash | |
set -e | |
echo "The script you are running is: $(dirname "$0")/$(basename "$0")" | |
function runDebug() { | |
flutter run iOS --debug --target=lib/main_dev.dart | |
} | |
function runRelease() { |
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:collection/collection.dart'; | |
// Write a function top10words that takes as input a list of words | |
// and returns a list of 10 most frequent words in the input list | |
void main() { | |
// TODO:: call top10words on words list below | |
// var top10 = top10words(words); | |
// expects top10 to include "Iris", "Elisa", "Jack" |
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
// Dart imports: | |
import 'dart:convert'; | |
import 'dart:typed_data'; | |
// Flutter imports: | |
import 'package:flutter/foundation.dart' show kIsWeb; | |
// Package imports: | |
import 'package:get_it/get_it.dart'; | |
import 'package:universal_html/html.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
[ | |
{ | |
"origin": ["*"], | |
"method": ["GET"], | |
"maxAgeSeconds": 3600 | |
} | |
] |
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'; | |
Future<void> downloadFile(String fileName, String pathToFile) async { | |
if (pathToFile.isEmpty) return; | |
if (!kIsWeb) return; | |
Uint8List? data = await FirebaseStorage.instance.ref(pathToFile).getData(); | |
if (data == null) return; | |
String encodedData = base64Encode(data); |
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
Future<void> storePushNotificationToken(String userId, String token) async { | |
final batch = _firestore.batch(); | |
final pushTokenRef = _firestore.collection(FirestoreCollection.pushToken.path).doc(userId); | |
batch.set( | |
pushTokenRef, | |
{'userId': userId, 'token': token}, | |
SetOptions(merge: true), | |
); |
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
Scaffold( | |
appBar: AppBar(...), | |
body: WillPopScope( | |
onWillPop: onBackClick, | |
child: CustomScrollView( | |
slivers: <Widget>[ | |
SliverToBoxAdapter( | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: <Widget>[ |
NewerOlder