Skip to content

Instantly share code, notes, and snippets.

@drkdelaney
drkdelaney / change_theme_dialog.dart
Created July 19, 2024 21:17
Dialog example for returning data from the dialog.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@drkdelaney
drkdelaney / bottom_navigation_bar_go_router.dart
Last active January 23, 2024 17:10
A basic app with go_router and bottom navigation.
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
void main() {
runApp(MusicAppDemo());
}
class MusicAppDemo extends StatelessWidget {
MusicAppDemo({super.key});

Keybase proof

I hereby claim:

  • I am derekedelaney on github.
  • I am ddelaney (https://keybase.io/ddelaney) on keybase.
  • I have a public key ASCXoNH442GyawXLeAZ0_wo27hrx6FDW6KLWfOllmmDFzgo

To claim this, I am signing this object:

@drkdelaney
drkdelaney / CustomCliper.dart
Last active December 21, 2022 00:25
A CustomCliper dart pad example
import 'dart:math';
import 'package:flutter/material.dart';
class FirstClipper extends CustomClipper<Path> {
FirstClipper();
@override
Path getClip(Size size) {
final path = Path();
@drkdelaney
drkdelaney / flutter_tabs.dart
Last active September 2, 2021 19:13
Flutter tabs overflow accessibility issue
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,
@drkdelaney
drkdelaney / master_detail_example.dart
Last active August 4, 2021 23:54
master-detail-example
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
@drkdelaney
drkdelaney / selected_list_bug.dart
Created June 25, 2021 21:28
Showing a selected list bug when using IndexedStack
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(),
@drkdelaney
drkdelaney / main.dart
Last active June 4, 2021 21:10
Sign in form with forgot password on bottom
import 'package:flutter/material.dart';
void main() {
runApp(App());
}
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@drkdelaney
drkdelaney / show_confetti_dialog.dart
Created May 12, 2021 22:11
Adds confetti to a flutter Dialog
import 'package:flutter/material.dart';
import 'package:confetti/confetti.dart';
Future<T> showConfettiDialog<T>({
@required BuildContext context,
WidgetBuilder builder,
bool barrierDismissible = true,
Color barrierColor,
bool useSafeArea = true,
bool useRootNavigator = true,