Skip to content

Instantly share code, notes, and snippets.

Tinkering with Flutter, Dart and everything Apple

Neevash Ramdial (Nash) Nash0x7E2

Tinkering with Flutter, Dart and everything Apple
View GitHub Profile
Nash0x7E2 / Allow-multiple-gestures.dart
Last active May 31, 2021
[DEPRECATED] Sample code on how to enable gesture pass through so that both the parent and the child widget receive the gesture.
View Allow-multiple-gestures.dart
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
//Main function. The entry point for your Flutter app.
void main() {
home: Scaffold(
body: DemoApp(),
Property/Callback Description
onTapDown OnTapDown is fired everytime the user makes contact with the screen.
onTapUp When the user stops touching the screen, onTapUp is called.
onTap When the screen is briefly touched, onTap is triggered.
onTapCancel When a user touches the screen but does not complete the Tap, this event is fired.
onDoubleTap onDoubleTap is called when the screen is touched twice in quick succession.
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 {
this.color: Colors.lightBlueAccent,
View simple-dart-http-server.dart
import 'dart:async';
import 'dart:io';
void main() {
class TestHttpServer {
HttpServer server;
Nash0x7E2 / c_cpp_properties.json
Last active Oct 20, 2018
C++ Launch config for VSCode
View c_cpp_properties.json
"configurations": [
"name": "Win32",
"includePath": [
"defines": [
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.elevation = 1.0,
this.margin = const EdgeInsets.all(4.0),
this.clipBehavior = Clip.none,
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 / multiple-scrollables.dart
Created Mar 12, 2019
Sample code for having a horizontal list within a vertical list view in Flutter.
View multiple-scrollables.dart
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
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;
Widget build(BuildContext context) {
return LayoutBuilder(
Nash0x7E2 / responsive-layout.dart
Last active Jan 5, 2021
Mainly used for Flutter web, builds the correct child depending on the width of the screen.
View responsive-layout.dart
import 'package:flutter_web/material.dart';
class ResponsiveLayout extends StatelessWidget {
const ResponsiveLayout({
Key key,
@required this.largeChild,
this.largeBreakPoint = 1200.0,
this.mediumBreakPoint = 800.0,