Skip to content

Instantly share code, notes, and snippets.

View nagasaki876's full-sized avatar
:octocat:
Working from home

Raheem Campbell nagasaki876

:octocat:
Working from home
View GitHub Profile
@slightfoot
slightfoot / ensure_visible.dart
Last active July 12, 2021 04:43
DEPRECATED. (Now integrated Into Flutter!!!). Ensure Visible for Flutter. Makes sure TextField or other widgets are scrolled into view when they receive input focus. Just pass the focusNode provided to your TextField inside the builder.
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
/// Signature for a function that creates a widget with the supplied [FocusNode].
typedef Widget EnsureVisibleBuilder(BuildContext context, FocusNode focusNode);
/// A widget that ensures it is always visible inside its ancestor scrollable
/// when focused.
class EnsureVisible extends StatefulWidget {