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
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 / page_navigation_bug.dart
Created September 23, 2019 19:47
Sample code demonstrating back navigation bug in Flutter 1.10.5
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',
import 'package:flutter/cupertino.dart' show CupertinoPageRoute;
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: HomePage(),
),
);
}
import 'package:flutter/material.dart';
class ItemTextStyle {
const ItemTextStyle({
@required this.initialStyle,
@required this.animatedStyle,
});
final TextStyle initialStyle;
final TextStyle animatedStyle;
@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,
@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 / 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(
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 / 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,
@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",