Skip to content

Instantly share code, notes, and snippets.

View Nash0x7E2's full-sized avatar
🎯
Tinkering with Flutter, Dart and everything Apple

Neevash Ramdial (Nash) Nash0x7E2

🎯
Tinkering with Flutter, Dart and everything Apple
View GitHub Profile
@Nash0x7E2
Nash0x7E2 / Allow-multiple-gestures.dart
Last active November 3, 2023 08:56
[DEPRECATED] Sample code on how to enable gesture pass through so that both the parent and the child widget receive the gesture.
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
//Main function. The entry point for your Flutter app.
void main() {
runApp(
MaterialApp(
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
Nash0x7E2 / page_view_indicator.dart
Created July 19, 2018 19:55
A modified version of a page view indicator for @flutter. Based on code originally created by @collinjackson
import 'dart:math';
import 'package:flutter/material.dart';
class PageViewIndicator extends StatefulWidget {
PageViewIndicator({
this.controller,
this.pageCount,
this.color: Colors.lightBlueAccent,
});
import 'dart:async';
import 'dart:io';
void main() {
TestHttpServer().createHttpServer();
}
class TestHttpServer {
HttpServer server;
@Nash0x7E2
Nash0x7E2 / c_cpp_properties.json
Last active October 20, 2018 20:50
C++ Launch config for VSCode
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
@Nash0x7E2
Nash0x7E2 / shadow-card.dart
Last active January 17, 2019 19:11
A card with the option to change the shadow color and animation duration of the default card
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,
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 / multiple-scrollables.dart
Created March 12, 2019 00:43
Sample code for having a horizontal list within a vertical list view in Flutter.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
@Nash0x7E2
Nash0x7E2 / ConstrainedView.dart
Last active March 28, 2019 02:37
Used to constrain the child of a scrollable to the max height of the view.
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(
@Nash0x7E2
Nash0x7E2 / responsive-layout.dart
Last active January 5, 2021 23:34
Mainly used for Flutter web, builds the correct child depending on the width of the screen.
import 'package:flutter_web/material.dart';
class ResponsiveLayout extends StatelessWidget {
const ResponsiveLayout({
Key key,
@required this.largeChild,
this.mediumChild,
this.smallChild,
this.largeBreakPoint = 1200.0,
this.mediumBreakPoint = 800.0,