Skip to content

Instantly share code, notes, and snippets.

View rydmike's full-sized avatar

Rydmike rydmike

View GitHub Profile
@rydmike
rydmike / analysis_options.yaml
Last active May 6, 2024 04:58
RydMike lints v2.2.0 - Personal preferences and starting point for Dart & Flutter linter rules setup.
# RydMike LINTER Preferences v2.2.0
#
# Get this file here: https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
#
# We include and activate all lint rules, later below we disable the not used or desired ones.
# You can find a list of all lint rules to put in your all_lint_rules.yaml file here:
# https://dart.dev/tools/linter-rules/all
#
# For a comparison of all lint rules settings in rule styles listed below, please see this Google
# sheet: https://docs.google.com/spreadsheets/d/1Nc1gFjmCOMubWZD7f2E4fLhWN7LYaOE__tsA7bf2NjA
@rydmike
rydmike / all_lint_rules.yaml
Last active January 5, 2024 20:25
List of ALL Dart & Flutter linter rules
linter:
rules:
- always_declare_return_types
- always_put_control_body_on_new_line
- always_put_required_named_parameters_first
- always_require_non_null_named_parameters
- always_specify_types
- always_use_package_imports
- annotate_overrides
- avoid_annotating_with_dynamic
@rydmike
rydmike / main.dart
Last active December 28, 2023 11:41
Flutter Vikings 2022 Theme Demo https://bit.ly/3wAYQBf
// MIT License
//
// Copyright (c) 2022 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 November 8, 2023 15:49
Test of shadow issue on PageView using elevated Card with ContinuousRectangleBorder wrappers
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@rydmike
rydmike / main.dart
Created November 8, 2023 15:07
Test of shadow issue on PageView using elevated Card wrappers
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@rydmike
rydmike / main.dart
Last active October 22, 2023 19:19
BottomSheet with handle test and transparent Card shadow theme in dark mode
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
@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 September 6, 2023 11:52
Form with Checkbox sample
import 'package:flutter/material.dart';
void main() => runApp(const FormExampleApp());
class FormExampleApp extends StatelessWidget {
const FormExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
@rydmike
rydmike / main.dart
Created August 10, 2023 11:15
Card elevation example for Flutter issue #132199 https://github.com/flutter/flutter/issues/132199
// MIT License
//
// Copyright (c) 2023 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 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);