Skip to content

Instantly share code, notes, and snippets.

Avatar

Jermaine Oppong graphicbeacon

View GitHub Profile
@graphicbeacon
graphicbeacon / index.html
Created Sep 7, 2020
Dispatching custom events example for Dart Web projects
View index.html
<input type="text" />
@graphicbeacon
graphicbeacon / async-gen.dart
Created Sep 3, 2020
Async Generators example
View async-gen.dart
import 'dart:async';
void main() {
// asynchronousNaturalsTo(10).listen(print);
final controller = asyncNaturalsTo(10);
controller.stream.listen((n) => print('YEss $n'),
onDone: () {
controller.close();
});
@graphicbeacon
graphicbeacon / main.dart
Last active Jun 26, 2020
Flutter Grid example with highlighted square
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
debugShowCheckedModeBanner: false, home: Scaffold(body: BoxApp())));
}
class BoxApp extends StatefulWidget {
@override
BoxAppState createState() => BoxAppState();
@graphicbeacon
graphicbeacon / index.html
Created Jun 20, 2020
Centering card with Materialize example
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
@graphicbeacon
graphicbeacon / server.dart
Created May 25, 2020
Shelf Dart Tutorial solution code
View server.dart
import 'dart:io';
import 'package:shelf/shelf.dart' as shelf;
import 'package:shelf/shelf_io.dart' as io;
// For Google Cloud Run, set _hostname to '0.0.0.0'.
const _hostname = 'localhost';
const _port = 8080;
void main(List<String> args) async {
@graphicbeacon
graphicbeacon / Dockerfile
Created May 17, 2020
Setup Dart with Docker
View Dockerfile
# ./Dockerfile
FROM google/dart-runtime
@graphicbeacon
graphicbeacon / main.dart
Last active Mar 22, 2020
Flutter slideout container with handle
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Page(),
),
),
);
@graphicbeacon
graphicbeacon / main.dart
Created Mar 21, 2020
Slideout container
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Page()
)
));
class Page extends StatefulWidget {
@graphicbeacon
graphicbeacon / main.dart
Created Mar 21, 2020
Flutter AnimationController example
View main.dart
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Padding(
padding: const EdgeInsets.only(top: 20, left: 20, right: 20),
child: PageAnimation()
)
@graphicbeacon
graphicbeacon / main.dart
Last active Mar 22, 2020
Flutter GestureDetector example - draggable square
View main.dart
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Padding(
// padding: const EdgeInsets.only(top: 20, left: 20, right: 20),
padding: const EdgeInsets.all(0),
child: Page()
)
You can’t perform that action at this time.