Skip to content

Instantly share code, notes, and snippets.

View Khanin-devmode's full-sized avatar
💭
Applying atomic habit to my coding daily.

Khanin Chomphusri Khanin-devmode

💭
Applying atomic habit to my coding daily.
View GitHub Profile
@Khanin-devmode
Khanin-devmode / custom_error_text_form_field.dart
Last active February 14, 2025 10:25
TextFormField with custom error
class CustomErrorTextFormField extends StatefulWidget {
const CustomErrorTextFormField({super.key});
@override
State<CustomErrorTextFormField> createState() =>
_CustomErrorTextFormFieldState();
}
class _CustomErrorTextFormFieldState extends State<CustomErrorTextFormField> {
final ValueNotifier<String?> _errorTextNotifier =
@Khanin-devmode
Khanin-devmode / main.dart
Created April 23, 2024 15:11
Flutter code example. Using Bloc library event-base approach in counter app. Simplify to one file verison.
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});
@Khanin-devmode
Khanin-devmode / main.dart
Created April 16, 2024 14:45
Minimal counter app with bloc library
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});
@Khanin-devmode
Khanin-devmode / main.dart
Created April 7, 2024 11:12
Wrap and FractionallySizedBox widgets example in Flutter
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@Khanin-devmode
Khanin-devmode / main.dart
Created February 11, 2024 13:35
Code example building movie ticket widget in flutter with CustomPainter and Path.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.