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:async'; | |
| void main() async{ | |
| Future<int>testTimer(int i) { | |
| final completer=Completer<int>(); | |
| Timer(Duration(seconds: 5), () { | |
| print("coucou from :$i"); | |
| if (i != 3) | |
| completer.complete(i); |
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:async'; | |
| void main() async { | |
| Future<int> computeCost(int val) async { | |
| await Future.delayed(Duration(seconds: 1)); | |
| return val * 2; | |
| } | |
| Stream<int> generateValues1() { | |
| return Stream.periodic(Duration(seconds: 1), (val) { |
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'; | |
| import 'package:flutter/rendering.dart'; | |
| import 'package:sliding_sheet/sliding_sheet.dart'; | |
| import 'package:webview_flutter/webview_flutter.dart'; | |
| class SlidingSheetWebView extends StatefulWidget { | |
| @override | |
| _SlidingSheetWebViewState createState() => _SlidingSheetWebViewState(); | |
| } |
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
| const blurhash = require('blurhash'); | |
| const { createCanvas, loadImage, Image } = require('canvas') | |
| const getImageData = (image) => { | |
| const canvas = createCanvas(image.width, image.height) | |
| const context = canvas.getContext('2d') | |
| context.drawImage(image, 0, 0) | |
| return context.getImageData(0, 0, image.width, image.height) | |
| } |
OlderNewer