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
/* | |
Simple DirectMedia Layer | |
Copyright (C) 1997-2021 Sam Lantinga <[email protected]> | |
This software is provided 'as-is', without any express or implied | |
warranty. In no event will the authors be held liable for any damages | |
arising from the use of this software. | |
Permission is granted to anyone to use this software for any purpose, | |
including commercial applications, and to alter it and redistribute it |
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 |
NewerOlder