Skip to content

Instantly share code, notes, and snippets.

View rydmike's full-sized avatar

Rydmike rydmike

View GitHub Profile
@rydmike
rydmike / main.dart
Created September 1, 2019 23:21
Demo of Flutter Drawer issue on Android with transparent statusbar, as well as no impact of SafeArea(top: false) on Drawer content
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
@rydmike
rydmike / main.dart
Created January 27, 2020 17:46
Demo of Flutter WEB shadows (and fonts) rendering issue
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@rydmike
rydmike / main.dart
Last active February 17, 2020 02:42
Flutter Padding Examples of GridView and StaggaredGrid (Not DartPad Compatible example)
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
void main() {
return runApp(MyApp());
}
class MyApp extends StatelessWidget {
@rydmike
rydmike / main.dart
Last active July 18, 2022 19:14
EXAMPLE: Padding Slivers with SliverPadding and demo of why Padding does not work
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
return runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@rydmike
rydmike / main.dart
Created February 21, 2020 12:45
More GridView Tests and Testing const versus static const class members in Flutter const widgets
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
const double kMySize = 20.0;
const Color kMyGreen = Color(0xFF388E3C);
class MyConsts {
// Private constructor so the class cannot be externally instantiated
// This also hides the code completion, but only when the class
// is in another imported file, so it cannot be demoed in DartPad
@rydmike
rydmike / main.dart
Last active March 26, 2020 15:37
A Flutter example of how to make a Widget member value have a default value, while being extension/compose and null safe. Part of this Twitter discussion: https://twitter.com/RydMike/status/1243200280809930753
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: Scaffold(
body: SuperWidget(
child: Text('This is supposed to have a red background'),
),
),
@rydmike
rydmike / main.dart
Last active April 9, 2020 16:06
Gesture detector issue/question: How to block pan events from being received by parent detector/listner? See https://github.com/flutter/flutter/issues/50776
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Gesture Issue',
home: Scaffold(body: Center(child: GestureIssue())),
@rydmike
rydmike / main.dart
Created May 18, 2020 22:49
GestureDetection onPan issue
import 'package:flutter/gestures.dart';
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
void main() {
runApp(PanIssueDemo());
}
class PanIssueDemo extends StatelessWidget {
@override
@rydmike
rydmike / main.dart
Last active December 20, 2020 16:38
GestureDetection onDrag OK
import 'package:flutter/gestures.dart';
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
void main() {
runApp(PanIssueDemo());
}
class PanIssueDemo extends StatelessWidget {
@override
@rydmike
rydmike / main.dart
Created May 21, 2020 16:57
Flutter CustomPaint with Shader with SweepGradient crashes on web
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() {
runApp(WebCrashDemo());
}
class WebCrashDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {