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 December 23, 2022 12:22
Flutter width constrained body with app theming demo
// MIT License
//
// Copyright (c) 2021 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
Created September 9, 2021 21:21
Flutter Drag and Tap Re-order list, with "fake" up down animation effect... just an experiment
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@rydmike
rydmike / main.dart
Last active August 31, 2021 12:44
Flutter Rounded Border Solutions to Tweet: https://twitter.com/RydMike/status/1431999590547476483
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@rydmike
rydmike / main.dart
Last active August 30, 2021 11:48
None uniform borderside container hack example.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@rydmike
rydmike / platform_is.dart
Last active October 15, 2022 20:07
Flutter Universal Platform Check - That Works on Web too
import 'universal_platform_web.dart'
if (dart.library.io) 'universal_platform_vm.dart';
/// A universal platform checker.
///
/// Can be used to check active physical Flutter platform on all platforms.
///
/// To check what host platform the app is running on use:
///
/// * PlatformIs.android
@rydmike
rydmike / main.dart
Created June 2, 2021 02:48
Flutter: SelectableText has extra padding and does not align with Text
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@rydmike
rydmike / main.dart
Created April 26, 2021 16:51
Flutter experiment to better theme center text in Stadium Bordered buttons.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
@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
@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 / 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',