animated_textformfields 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • new53

animated_textformfields #

A Flutter package that has a collection of animated (and some not so animated) TextFormFields to make UI development faster and more beautiful.

Example #

Descriptions #

Animated TextFormField

The Animated TextFormField toggles between animatiion states based on wheter is has focus or not. When the textformfield has focus, the textformfield animates the color and the corners of the textformfield.

SlideIn TextFormField

The SlideIn TextFormField animates between the hint text showing up inside the text field when the text is empty, and above the textformfield when it is filled with text.

Custom TextFormField Lite

The Custom TextFormField is a textformfield that does not animate. It is be used to complete another animated TextFormField, but can also be used as a standalone version.

Sample #

Animated TextFormField

AnimatedTextFormField(
    width: MediaQuery.of(context).size.width * 0.875,
    height: 48.0,
    inputType: TextInputType.text,
    hintText: "Name",
    controller: textEditingControllerAnimated,
    textStyle: TextStyle(
        color: Colors.black,
        fontSize: 16.0,
    ),
    focusNode: myFocusNode,
    cornerRadius: BorderRadius.circular(14.0),
)

SlideIn TextFormField

SlideInTextFormField(
    vsync: this,
    width: MediaQuery.of(context).size.width * 0.875,
    height: 48.0,
    inputType: TextInputType.text,
    fieldText: "Name",
    controller: textEditingControllerSlideIn,
    textStyle: TextStyle(
        color: Colors.black,
        fontSize: 16.0,
    ),
    cornerRadius: BorderRadius.circular(14.0),
)

Custom TextFormField Lite

CustomTextFormFieldLite(
    width: MediaQuery.of(context).size.width * 0.875,
    height: 48.0,
    inputType: TextInputType.text,
    hintText: "Name",
    controller: textEditingControllerLite,
    textStyle: TextStyle(
        color: Colors.black,
        fontSize: 16.0,
    ),
    cornerRadius: BorderRadius.circular(14.0),
)

Author #

Follow @thealphaversion

LinkedIn: @Aditya Chakraborti

[0.1.0] - 21/06/2020 #

Added initial animated TextFormField that toggles between animatiion states based on wheter is has focus or not.

[0.2.0] - 21/06/2020 #

Added a custom TextFormField that does not animate. It will be used to complete another animated TextFormField, but can also be used as a standalone version.

[1.0.0] - 21/06/2020 #

Added a slide_in TextFormField that animated between the hint text showing up inside the text field when the text is empty, and above the textformfield when it is filled with text.

[1.0.1] - 22/06/2020 #

Updated homepage for the package

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Animated TextFields Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.orange,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: DemoPage(title: 'Demo Home Page'),
    );
  }
}

class DemoPage extends StatefulWidget {
  DemoPage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _DemoPageState createState() => _DemoPageState();
}

class _DemoPageState extends State<DemoPage> with TickerProviderStateMixin {
  FocusNode myFocusNode = FocusNode();
  TextEditingController textEditingControllerAnimated =
      new TextEditingController();
  TextEditingController textEditingControllerLite = new TextEditingController();
  TextEditingController textEditingControllerSlideIn = new TextEditingController();

  @override
  void dispose() {
    textEditingControllerAnimated.dispose();
    textEditingControllerLite.dispose();
    textEditingControllerSlideIn.dispose();
    myFocusNode.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Padding(
            padding:
                const EdgeInsets.symmetric(horizontal: 8.0, vertical: 24.0),
            child: Text(
              'Animated TextFields Demo',
              style: TextStyle(
                fontSize: 24.0,
              ),
              maxLines: 3,
            ),
          ),
          Align(
            alignment: Alignment.centerLeft,
            child: Padding(
              padding: const EdgeInsets.fromLTRB(36.0, 12.0, 12.0, 4.0),
              child: Text(
                'AnimatedTextFormField',
                style: TextStyle(
                  fontSize: 18.0,
                ),
                maxLines: 1,
              ),
            ),
          ),
          // this example describes how to use AnimatedTextFormField
          AnimatedTextFormField(
            width: MediaQuery.of(context).size.width * 0.875,
            height: 48.0,
            inputType: TextInputType.text,
            hintText: "Name",
            controller: textEditingControllerAnimated,
            textStyle: TextStyle(
              color: Colors.black,
              fontSize: 16.0,
            ),
            focusNode: myFocusNode,
            cornerRadius: BorderRadius.circular(14.0),
          ),
          Align(
            alignment: Alignment.centerLeft,
            child: Padding(
              padding: const EdgeInsets.fromLTRB(36.0, 24.0, 12.0, 4.0),
              child: Text(
                'CustomTextFormFieldLite',
                style: TextStyle(
                  fontSize: 18.0,
                ),
                maxLines: 1,
              ),
            ),
          ),
          // this example describes how to use CustomTextFormFieldLite
          CustomTextFormFieldLite(
            width: MediaQuery.of(context).size.width * 0.875,
            height: 48.0,
            inputType: TextInputType.text,
            hintText: "Name",
            controller: textEditingControllerLite,
            textStyle: TextStyle(
              color: Colors.black,
              fontSize: 16.0,
            ),
            cornerRadius: BorderRadius.circular(14.0),
          ),
          Align(
            alignment: Alignment.centerLeft,
            child: Padding(
              padding: const EdgeInsets.fromLTRB(36.0, 24.0, 12.0, 4.0),
              child: Text(
                'SlideInTextFormField',
                style: TextStyle(
                  fontSize: 18.0,
                ),
                maxLines: 1,
              ),
            ),
          ),
          // this example describes how to use SlideInTextFormField
          SlideInTextFormField(
            vsync: this,
            width: MediaQuery.of(context).size.width * 0.875,
            height: 48.0,
            inputType: TextInputType.text,
            fieldText: "Name",
            controller: textEditingControllerSlideIn,
            textStyle: TextStyle(
              color: Colors.black,
              fontSize: 16.0,
            ),
            cornerRadius: BorderRadius.circular(14.0),
          ),
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  animated_textformfields: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:animated_textformfields/animated_textformfields.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
6
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
53
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • animated_textformfields that is a package requiring null.

Health issues and suggestions

Document public APIs. (-0.11 points)

95 out of 98 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/animated_textformfield/animated_textformfield.dart.

Run flutter format to format lib/animated_textformfield/animated_textformfield.dart.

Format lib/animated_textformfields.dart.

Run flutter format to format lib/animated_textformfields.dart.

Format lib/custom_textformfield_lite/custom_textformfield_lite.dart.

Run flutter format to format lib/custom_textformfield_lite/custom_textformfield_lite.dart.

Format lib/definitions/callbacks.dart.

Run flutter format to format lib/definitions/callbacks.dart.

Format lib/slide_in_textformfield/slide_in_textformfield.dart.

Run flutter format to format lib/slide_in_textformfield/slide_in_textformfield.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
animated_size_and_fade ^1.1.1 1.1.1
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test