Skip to content

Instantly share code, notes, and snippets.

View Luckey-Elijah's full-sized avatar
🦢
Working from home

Elijah Luckey Luckey-Elijah

🦢
Working from home
View GitHub Profile
@Luckey-Elijah
Luckey-Elijah / controller_builder.dart
Last active August 11, 2022 18:20 — forked from lukepighetti/text_editing_controller_builder.dart
Wrap any TextField with TextEditingControllerBuilder to make it declarative
import 'package:flutter/widgets.dart';
/// {@template text_controller_builder}
/// Exposes a controller (of type [C]) to the child.
/// Used to convert any TextField into a declarative version.
///
///
/// ```dart
/// TextControllerBuilder<MyTextEditingController>(
/// create: () => MyTextEditingController()..doSomethingSpecialOnCreate(),