orient_text_field 0.1.0 copy "orient_text_field: ^0.1.0" to clipboard
orient_text_field: ^0.1.0 copied to clipboard

A Flutter package that provides orientation-aware text field widgets.

OrientTextField #

pub package Platform Donate on Saweria Donate on Ko-fi

A Flutter package that provides orientation-aware text field widgets. OrientTextField and OrientTextFormField are drop-in replacements for the standard TextField and TextFormField widgets with added support for landscape orientation and full-screen editing.

[Fix Height]

ko-fi

Features #

  • Drop-in replacement for TextField and TextFormField
  • Automatic full-screen editing mode in landscape orientation
  • Same parameters as standard Flutter text fields
  • Keyboard visibility detection and management
  • Seamless orientation handling

Installation #

Add this to your pubspec.yaml:

dependencies:
  orient_text_field: ^0.1.0

Run:

flutter pub get

Usage #

Setup #

Wrap your app with KeyboardStatusProvider at the root:

import 'package:flutter/material.dart';
import 'package:orient_text_field/orient_text_field.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return KeyboardStatusProvider(
      child: MaterialApp(
        home: Scaffold(
          body: MyForm(),
        ),
      ),
    );
  }
}

OrientTextField and OrientTextFormField accept all the same parameters as Flutter's standard TextField and TextFormField. Simply replace your existing widgets without changing any parameters:

// Before
TextField(
  decoration: InputDecoration(labelText: 'Name'),
  maxLines: 3,
  keyboardType: TextInputType.text,
)

// After - Just change the class name
OrientTextField(
  decoration: InputDecoration(labelText: 'Name'),
  maxLines: 3,
  keyboardType: TextInputType.text,
)

Note: The onTap parameter is reserved for internal package functionality and is not available.

Bonus: For a cleaner layout when the keyboard is visible in landscape mode, add:

resizeToAvoidBottomInset:
  MediaQuery.orientationOf(context) != Orientation.landscape,

FullScreenFieldConfig #

Customize the full-screen editing mode with these options:

Property Type Default Description
decoration InputDecoration? null Custom decoration for full-screen mode. If null, inherits from parent field.
keyboardAppearance Brightness? null Keyboard appearance (light/dark). If null, follows system settings.
doneText String "Done" Label text for the done button.
obscureText bool? null Override text obscuring for full-screen mode. If null, inherits from parent.
withObscureToggle bool false Show visibility toggle button for obscured text.
obscureEnabedIcon Widget Icons.visibility Icon shown when text is visible.
obscureDisabledIcon Widget Icons.password Icon shown when text is obscured.
enableFormValidation bool? null Enable validation in full-screen mode (only for OrientTextFormField).

Examples #

For more complete examples including password fields, validation, and different configurations, see the example folder.

Requirements #

  • Flutter: >=1.17.0
  • Dart: >=3.11.4

License #

See LICENSE file.

1
likes
0
points
441
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package that provides orientation-aware text field widgets.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on orient_text_field