Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Tinkering with Flutter, Dart and everything Apple

Neevash Ramdial (Nash) Nash0x7E2

🎯
Tinkering with Flutter, Dart and everything Apple
View GitHub Profile
View simple-dart-http-server.dart
import 'dart:async';
import 'dart:io';
void main() {
TestHttpServer().createHttpServer();
}
class TestHttpServer {
HttpServer server;
@Nash0x7E2
Nash0x7E2 / c_cpp_properties.json
Last active Oct 20, 2018
C++ Launch config for VSCode
View c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
@Nash0x7E2
Nash0x7E2 / shadow-card.dart
Last active Jan 17, 2019
A card with the option to change the shadow color and animation duration of the default card
View shadow-card.dart
class ShadowCard extends StatelessWidget {
const ShadowCard({
Key key,
this.color,
this.elevation = 1.0,
this.shape,
this.margin = const EdgeInsets.all(4.0),
this.clipBehavior = Clip.none,
this.child,
this.semanticContainer = true,
View stepper.dart
import 'package:flutter/material.dart';
class StepperWidget extends StatelessWidget {
const StepperWidget({
Key key,
@required this.tabController,
@required this.headings,
@required this.textStyle,
this.height = 48.0,
@Nash0x7E2
Nash0x7E2 / ConstrainedView.dart
Last active Mar 28, 2019
Used to constrain the child of a scrollable to the max height of the view.
View ConstrainedView.dart
import 'package:flutter/material.dart';
class ConstrainedView extends StatelessWidget {
const ConstrainedView({Key key, this.child}) : super(key: key);
final Widget child;
@override
Widget build(BuildContext context) {
return LayoutBuilder(
View cupertino-page-transition-example.dart
import 'package:flutter/cupertino.dart' show CupertinoPageRoute;
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: HomePage(),
),
);
}
@Nash0x7E2
Nash0x7E2 / page_navigation_bug.dart
Created Sep 23, 2019
Sample code demonstrating back navigation bug in Flutter 1.10.5
View page_navigation_bug.dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
View nested_tab_and_list.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Nested tab bar list demo',
theme: ThemeData(
@Nash0x7E2
Nash0x7E2 / distinct_list.dart
Created Oct 8, 2019
Filters the duplicate items from both list. Returns a new list of type T unique items.
View distinct_list.dart
/// Mixin containing a helper list method
mixin ListDistinct {
/// Creates a new list with the unique elements form [listOne] and [listTwo].
/// The new list is returned with the specified type [T]
List<T> distinct<T>(List<T> listOne, List<T> listTwo) {
final List<T> _newList = <T>[];
_newList.addAll(listOne);
for (final T item in listTwo) {
if (_newList.contains(item)) {
_newList.remove(item);
@Nash0x7E2
Nash0x7E2 / page_view_indicator.dart
Created Jul 19, 2018
A modified version of a page view indicator for @flutter. Based on code originally created by @collinjackson
View page_view_indicator.dart
import 'dart:math';
import 'package:flutter/material.dart';
class PageViewIndicator extends StatefulWidget {
PageViewIndicator({
this.controller,
this.pageCount,
this.color: Colors.lightBlueAccent,
});