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(),
),
@Nash0x7E2
Nash0x7E2 / main.dart
Created April 17, 2020 00:44
Apple's Breathe Animation in Flutter
// MIT License
//
// Copyright (c) 2020 Neevash Ramdial
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Nash0x7E2
Nash0x7E2 / interactive_card.dart
Last active August 31, 2022 20:08
Implementation of Flutter's Card widget using the MaterialStateProperty API for handling and responding to user interaction. This implementation allows developers to quick and easily customize properties on their card whenever a user taps and hover on the widget. Please see the following link for more information on MaterialStateProperty: https:…
/// Implementation of [Card] using the new [MaterialStateProperty] for handling
/// and reacting to user interactions.
class InteractiveCard extends StatefulWidget {
const InteractiveCard({
Key? key,
this.color,
this.shadowColor,
this.elevation,
this.shape,
this.borderOnForeground = true,
@Nash0x7E2
Nash0x7E2 / send_message_using_shortcut_stream.dart
Created September 2, 2021 23:59
Send a message using a keyboard shortcut in Flutter.
import 'package:collection/collection.dart' show IterableExtension;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
Future<void> main() async {
final client = StreamChatClient(
's2dxdhpxd94g',
logLevel: Level.INFO,
);
import 'dart:ui';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
void main() {
runApp(const App());
}
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 / animating_text.dart
Created May 31, 2021 03:46
Animating text made in Flutter. As text appear on screen, they animate between a start and ending color. Demo can be found here: https://twitter.com/Nash0x7E2/status/1399194632626520067?s=20
import 'package:flutter/material.dart';
void main() {
runApp(TexColDemo());
}
class TexColDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@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 / 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,