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
/// A channel that the gRPC libray communicates over. | |
/// This is provided by the gRPC library. | |
final channel = GrpcWebClientChannel.xhr(Uri.parse('https://your.api.url:8080')); | |
/// The class [AccountServiceClient] is generated by the gRPC library from | |
/// your `.proto` definition. | |
final client = AccountServiceClient(channel); | |
Future<void> changePassword() async { | |
/// The message you want to send to the API. It's also generated from your |
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 AccountService extends AccountServiceBase { | |
@override | |
Future<Empty> sendEmailVerification(ServiceCall call, VerificationRequest request) { | |
// TODO: implement sendEmailVerification | |
throw UnimplementedError(); | |
} | |
@override | |
Future<User> signInWithPassword(ServiceCall call, PasswordSignInRequest request) { | |
// TODO: implement signInWithPassword |
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
syntax = "proto3"; | |
package dropzone.public_account; | |
import "shared.proto"; | |
// Very simplified version of our account service. | |
service AccountService { | |
rpc SendEmailVerification(VerificationRequest) returns(shared.Empty); |
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:io'; | |
main() async { | |
final server = await HttpServer.bind(InternetAddress.anyIPv6, 80); | |
server.listen((HttpRequest request) { | |
request.response.write('Hello, world!'); | |
request.response.close(); | |
}); | |
} |
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
// Get the template HTML and remove it from the doument. | |
var previewNode = document.querySelector("#template"); | |
previewNode.id = ""; | |
var previewTemplate = previewNode.parentNode.innerHTML; | |
previewNode.parentNode.removeChild(previewNode); | |
var myDropzone = new Dropzone(document.body, { // Make the whole body a dropzone | |
url: "/target-url", // Set the url | |
thumbnailWidth: 80, | |
thumbnailHeight: 80, |
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
Dropzone.myDropzone.options = { | |
addedfile: function(file) { | |
file.previewTemplate = $(this.options.previewTemplate); | |
this.element.find(".previews").append(file.previewTemplate); | |
file.previewTemplate.find(".filename span").text(file.name); | |
file.previewTemplate.find(".details").append($("<div class=\"size\">" + (this.filesize(file.size)) + "</div>")); | |
} | |
}; |
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
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) { | |
/******/ return installedModules[moduleId].exports; |
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
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) { | |
/******/ return installedModules[moduleId].exports; |
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
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) { | |
/******/ return installedModules[moduleId].exports; |
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'; | |
Future foo() async { | |
print('foo() before delay'); | |
await Future.delayed(Duration(milliseconds: 100)); | |
print('foo() after delay'); | |
} | |
void main() async { |