Skip to content

Instantly share code, notes, and snippets.

Avatar

Rydmike rydmike

View GitHub Profile
@rydmike
rydmike / main.dart
Created Sep 1, 2019
Demo of Flutter Drawer issue on Android with transparent statusbar, as well as no impact of SafeArea(top: false) on Drawer content
View main.dart
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 Jan 27, 2020
Demo of Flutter WEB shadows (and fonts) rendering issue
View main.dart
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 Feb 17, 2020
Flutter Padding Examples of GridView and StaggaredGrid (Not DartPad Compatible example)
View main.dart
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
Created Feb 21, 2020
More GridView Tests and Testing const versus static const class members in Flutter const widgets
View main.dart
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 Mar 26, 2020
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
View main.dart
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 Apr 9, 2020
Gesture detector issue/question: How to block pan events from being received by parent detector/listner? See https://github.com/flutter/flutter/issues/50776
View main.dart
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
GestureDetection onPan issue
View main.dart
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
Flutter CustomPaint with Shader with SweepGradient crashes on web
View main.dart
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() {
runApp(WebCrashDemo());
}
class WebCrashDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
@rydmike
rydmike / main.dart
Last active Jun 3, 2020
Color wheel example that does work on Flutter WEB together with the one that crashes
View main.dart
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() {
runApp(WebCrashDemo());
}
class WebCrashDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
@rydmike
rydmike / main.dart
Last active Jun 4, 2020
Issue demo: ClipRect over Container with BoxShadow
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(IssueDemoApp());
}
class IssueDemoApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(