Skip to content

Instantly share code, notes, and snippets.

@hectorAguero
hectorAguero / main.dart
Created March 27, 2025 21:26
Cubit + AsyncValue
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@hectorAguero
hectorAguero / main.dart
Created March 13, 2025 14:04
Sync and Async Button named constructors
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@hectorAguero
hectorAguero / main.dart
Last active March 6, 2025 16:41
TableRow with Leading and Trailing
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) => MaterialApp(
title: 'Material App',
@hectorAguero
hectorAguero / main.dart
Created February 20, 2025 21:03
Arrow Rotation
import 'package:flutter/material.dart';
/// Flutter code sample for [RotationTransition].
void main() => runApp(const RotationTransitionExampleApp());
class RotationTransitionExampleApp extends StatelessWidget {
const RotationTransitionExampleApp({super.key});
@hectorAguero
hectorAguero / main.dart
Created January 24, 2025 15:10
AnimatedSize with AnimatedSwitched in text
import 'package:flutter/material.dart';
/// Flutter code sample for [AnimatedSize].
void main() => runApp(const AnimatedSizeExampleApp());
class AnimatedSizeExampleApp extends StatelessWidget {
const AnimatedSizeExampleApp({super.key});
static const Duration duration = Duration(seconds: 1);
@hectorAguero
hectorAguero / main.dart
Created December 18, 2024 20:47
Months of the Year using InheritedNotifier
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@hectorAguero
hectorAguero / main.dart
Last active December 17, 2024 14:27
Flutter CompositedTransform with Listenable
import 'package:flutter/material.dart';
// Based on https://medium.com/snapp-x/creating-custom-dropdowns-with-overlayportal-in-flutter-4f09b217cfce
// And https://github.com/flutter/flutter/issues/138828
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@hectorAguero
hectorAguero / main.dart
Created November 27, 2024 12:51
CustomClipper and CustomPainter in Flutter
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@hectorAguero
hectorAguero / main.dart
Created November 21, 2024 20:33
DecoratedImage with ClipPath
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override