Skip to content

Instantly share code, notes, and snippets.

View jogboms's full-sized avatar
💙
Building Awesome w/ Dart & Flutter

Jeremiah Ogbomo jogboms

💙
Building Awesome w/ Dart & Flutter
View GitHub Profile
@jogboms
jogboms / main.dart
Created December 19, 2018 08:17
Flutter CustomScrollView and Keyboard issue repro
import 'package:flutter/material.dart';
void main() async {
runApp(App());
}
class App extends StatelessWidget {
const App({
Key key,
}) : super(key: key);
@jogboms
jogboms / action.dart
Created January 28, 2019 08:43
How I ReBloc.
class NotificationsAsyncLoadingAction extends Action {
const NotificationsAsyncLoadingAction();
}
class NotificationsAsyncSuccessAction extends Action {
const NotificationsAsyncSuccessAction({
@required this.notifications,
});
final List<NotificationModel> notifications;
import 'dart:async';
import 'dart:convert';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class WidgetToImage extends StatefulWidget {
@override
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
class StatusBar extends StatelessWidget {
const StatusBar({
Key key,
this.brightness = Brightness.dark,
@required this.child,
}) : super(key: key);
import 'package:flutter/widgets.dart';
class OneTimeBuilder extends StatefulWidget {
const OneTimeBuilder({
Key key,
@required this.once,
@required this.child,
}) : assert(once != null),
assert(child != null),
super(key: key);
# From: https://github.com/flutter/flutter/blob/master/analysis_options.yaml
#
# Specify analysis options.
#
# Until there are meta linter rules, each desired lint must be explicitly enabled.
# See: https://github.com/dart-lang/linter/issues/288
#
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
# See the configuration guide for more
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
import 'package:flutter/material.dart';
class Bubble extends StatelessWidget {
Bubble({this.message, this.time, this.delivered, this.isMe});
final String message, time;
final delivered, isMe;
@override
Widget build(BuildContext context) {
const alphabet = "abcdefghijklmnopqrst";
const randomStr = Array(3)
.fill(null)
.map(() => Math.floor(Math.random() * alphabet.length))
.map(num => alphabet[num])
.join("");
let counter = 0;
export function newId<T extends string>(prefix: string = "id") {
return `${prefix}_${randomStr}_${counter++}` as T;
@jogboms
jogboms / wave_card.dart
Created April 23, 2019 05:53 — forked from stefanJi/wave_card.dart
flutter wave card example
import 'package:flutter/widgets.dart';
class WaveCard extends StatelessWidget {
WaveCard({Key key, padding: EdgeInsets}) : super(key: key);
@override
Widget build(BuildContext context) {
final painter = WavePainter(Color.fromRGBO(96, 204, 184, 0.2));
return CustomPaint(
painter: painter,
@jogboms
jogboms / number_input.dart
Created April 30, 2019 05:12 — forked from slightfoot/number_input.dart
Number Input Widget - For entering pins and other such things - #HumpDayQandA - 24th April 2019
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(ExampleApp());
class ExampleApp extends StatefulWidget {
@override
_ExampleAppState createState() => _ExampleAppState();
}