Skip to content

Instantly share code, notes, and snippets.

View rydmike's full-sized avatar

Rydmike rydmike

View GitHub Profile
@rydmike
rydmike / main.dart
Last active June 3, 2020 13:27
Color wheel example that does work on Flutter WEB together with the one that crashes
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 July 27, 2021 17:06
Issue demo: ClipRect over Container with BoxShadow
import 'package:flutter/material.dart';
void main() {
runApp(IssueDemoApp());
}
class IssueDemoApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@rydmike
rydmike / main.dart
Last active April 5, 2023 10:34
Flutter: MaskFilter.blur Outer Blur issue on DomCanvas
import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(IssueDemoApp());
}
// The Maskfilter style we want to demo/test
const kMaskFilter = MaskFilter.blur(BlurStyle.outer, 10);
@rydmike
rydmike / main.dart
Last active June 15, 2020 22:03
PageView with Scrolling Lists and Grids
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// On a device this [setSystemUIOverlayStyle] call will make your AppBar cool
// on Android. It also helps with the AppBar effect shown just for fun in
@rydmike
rydmike / main.dart
Last active June 18, 2020 15:59
Flutter Material clipping issue with shadows
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(IssueDemoApp());
}
class IssueDemoApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@rydmike
rydmike / main.dart
Last active August 7, 2021 18:00
Demo code for Flutter Elevation Issue, the issue is only visible on SKIA builds, not on Web DomCanvas. https://github.com/flutter/flutter/issues/51237
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
const double kEdgePadding = 35.0;
const double kMaxContentWidth = 800.0;
const double kMaxExtraSpace = 1500.0;
const double kMaxElevation = 20.0;
const int kMaxCards = 20;
void main() {
@rydmike
rydmike / main.dart
Last active August 16, 2020 19:36
Demo of animation jank with AnimatedContainer with Theme.of(context) color used in color property. It causes jank on Web CanvasKit master builds, but not on Beta channel.
// MIT License
// Copyright 2020 Mike Rydstrom
//
// 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:
//
@rydmike
rydmike / main.dart
Last active August 16, 2020 20:13
Flutter: Floating action button location is wrong for top locations when using Scaffold property 'extendBodyBehindAppBar'
// MIT License
// Copyright 2020 Mike Rydstrom
//
// 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:
//
@rydmike
rydmike / main.dart
Last active March 11, 2021 11:45
Demo of Flutter WEB master regression with theme change and AnimatedCrossFade
// MIT License
// Copyright 2020 Mike Rydstrom
//
// 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:
//
@rydmike
rydmike / main.dart
Last active September 11, 2020 11:33
[Web] [CanvasKit] CupertinoTabBar with blur filter causes repeated JavaScript Warnings
// MIT License
// Copyright 2020 Mike Rydstrom
//
// 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:
//