This file contains 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:html' as html; | |
import 'package:uuid/uuid.dart'; | |
import 'package:image_picker_web/image_picker_web.dart'; | |
Future uploadImage() async { | |
var image = await ImagePicker().pickImage(source: ImageSource.gallery); | |
if (image != null) { | |
final metadata = SettableMetadata( |
This file contains 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 'package:encrypt/encrypt.dart'; | |
import 'package:path_provider/path_provider.dart'; | |
import 'dart:async'; | |
import 'dart:io'; | |
class StorageUtil { | |
static Future<String> getLocalPath() async { |
This file contains 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 Util { | |
static bool isEmail(String email){ | |
return RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email); | |
} | |
} |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android"> | |
<translate android:fromXDelta="-100%" android:toXDelta="0%" | |
android:fromYDelta="0%" android:toYDelta="0%" | |
android:duration="300"/> | |
</set> |
This file contains 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
extension DateTimeExtension on DateTime { | |
bool isSameDay(DateTime otherDate){ | |
DateTime today = DateTime.now(); | |
return otherDate.day == today.day && otherDate.month == today.month && otherDate.year == today.year; | |
} | |
bool isToday(){ | |
DateTime today = DateTime.now(); | |
return this.day == today.day && this.month == today.month && this.year == today.year; | |
} |
This file contains 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
//Assumes Instant is in your pubspec | |
import 'package:instant/instant.dart'; | |
//Super Simple! | |
DateTime myDT = DateTime.now(); //Current DateTime | |
DateTime EastCoast = dateTimeToZone(zone: "EST", datetime: myDT); //DateTime in EST zone | |
return EastCoast; |
This file contains 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
flutter packages pub run build_runner watch --delete-conflicting-outputs |
This file contains 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:async'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_localizations/flutter_localizations.dart'; | |
import 'package:intl/date_symbol_data_local.dart' as intl; | |
import 'package:intl/intl.dart' as intl; | |
class _PTBRMaterialLocalizationsDelegate | |
extends LocalizationsDelegate<MaterialLocalizations> { |
NewerOlder