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 November 20, 2020 14:22
Playground to demonstrate Plasma Issue in Simple animation and Liquid Studio
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key);
@rydmike
rydmike / main.dart
Created November 24, 2020 12:37
Tooltip size test - For testing legibility of different sizes on different platforms
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
const String demoTooltip = 'Share the selected files and folders\n'
'with other people on the network.';
// const String demoTooltip = 'Tooltip message ijklmnop ABC 123';
class MyApp extends StatefulWidget {
@override
import 'package:flutter/material.dart';
import 'package:flex_color_picker/flex_color_picker.dart';
void main() => runApp(const ColorPickerDemo());
class ColorPickerDemo extends StatefulWidget {
const ColorPickerDemo({Key key}) : super(key: key);
@override
_ColorPickerDemoState createState() => _ColorPickerDemoState();
@rydmike
rydmike / if_wrapper.dart
Created January 9, 2021 23:46
Flutter: A builder that if the [condition] is true, will run its builder and the child will be wrapped by the builder, if false it just returns the child.
import 'package:flutter/material.dart';
/// Type definition for a builder function used by IfWrapper.
typedef IfWrapBuilder = Widget Function(BuildContext context, Widget child);
/// A builder that if the [condition] is true, will run its builder and the
/// child will be wrapped by the builder, if false it just returns the child.
///
/// A convenient way to wrap a widget with another widget, but only if
/// the condition is true. It can save you from having to define a large widget,
import 'package:flutter/material.dart';
import 'package:flex_color_scheme/flex_color_scheme.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@rydmike
rydmike / main.dart
Last active June 2, 2021 13:07
A Flutter long press context menu. Wrap a child with LongPressPopupMenu and it pops up at press location with its PopupMenuItem:s
// BSD 3-Clause License
//
// Copyright (c) 2021, Mike Rydstrom (Rydmike)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
@rydmike
rydmike / main.dart
Last active February 28, 2021 22:04
CTRL-V paste shortcut throws in Flutter Windows
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Text Edit',
@rydmike
rydmike / main.dart
Created March 2, 2021 13:05
Example: One way to make a dialog bigger
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Alert',
theme: ThemeData(
@rydmike
rydmike / svg_asset_image.dart
Created March 27, 2021 12:06
Change the main color of the color used in Undraw SVG images.
import 'dart:async' show Future;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show rootBundle;
import 'package:flutter_svg/flutter_svg.dart';
/// Displays an SVG image provided in the applications asset bundle.
///
/// The [assetName] is the path and name of the SVG file in the asset bundle.
/// This SVG asset display widget is tuned for usage with the Undraw images