🔥🚀 Flutter package to create Pin code input text field with every pixel customization possibility 🎨 with beautiful animations

Overview

Flutter PinPut From Tornike

🔥 🚀 Flutter package to create Pin code input (OTP) text field with every pixel customization possibility 🎨 and beautiful animations, Supports custom numpad.

Supported:

  • Backspace on keyboard
  • Every pixel customization
  • Nice animations
  • Form validation
  • Ios auto fill - testing needed
  • PreFilledSymbol
  • Fake cursor

Contents

Support

First thing first give it a star

Discord Channel

Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Overview

Use submittedFieldDecoration, selectedFieldDecoration, followingFieldDecoration properties to add field decoration, border, fill color, shape, radius etc. provide different values to them in order to achieve nice implicit animations

Installation

1. Depend on it

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

dependencies:
  pinput: ^1.2.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

3. Import it

Now in your Dart code, you can use:

import 'package:pinput/pin_put/pin_put.dart';

Properties

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:pinput/pin_put/pin_put_state.dart';

class PinPut extends StatefulWidget {
  const PinPut({
    Key key,
    @required this.fieldsCount,
    this.onSubmit,
    this.onSaved,
    this.onChanged,
    this.onTap,
    this.onClipboardFound,
    this.controller,
    this.focusNode,
    this.preFilledWidget,
    this.separatorPositions = const [],
    this.separator = const SizedBox(width: 15.0),
    this.textStyle,
    this.submittedFieldDecoration,
    this.selectedFieldDecoration,
    this.followingFieldDecoration,
    this.disabledDecoration,
    this.eachFieldWidth,
    this.eachFieldHeight,
    this.fieldsAlignment = MainAxisAlignment.spaceBetween,
    this.eachFieldAlignment = Alignment.center,
    this.eachFieldMargin,
    this.eachFieldPadding,
    this.eachFieldConstraints =
        const BoxConstraints(minHeight: 40.0, minWidth: 40.0),
    this.inputDecoration = const InputDecoration(
      contentPadding: EdgeInsets.zero,
      border: InputBorder.none,
      counterText: '',
    ),
    this.animationCurve = Curves.linear,
    this.animationDuration = const Duration(milliseconds: 160),
    this.pinAnimationType = PinAnimationType.slide,
    this.slideTransitionBeginOffset,
    this.enabled = true,
    this.autofocus = false,
    this.autovalidateMode = AutovalidateMode.disabled,
    this.withCursor = false,
    this.cursor,
    this.keyboardAppearance,
    this.inputFormatters,
    this.validator,
    this.keyboardType = TextInputType.number,
    this.obscureText,
    this.textCapitalization = TextCapitalization.none,
    this.textInputAction,
    this.toolbarOptions,
    this.mainAxisSize = MainAxisSize.max,
  })  : assert(fieldsCount > 0),
        super(key: key);

  /// Displayed fields count. PIN code length.
  final int fieldsCount;

  /// Same as FormField onFieldSubmitted, called when PinPut submitted.
  final ValueChanged<String> onSubmit;

  /// Signature for being notified when a form field changes value.
  final FormFieldSetter<String> onSaved;

  /// Called every time input value changes.
  final ValueChanged<String> onChanged;

  /// Called when user clicks on PinPut
  final VoidCallback onTap;

  /// Called when Clipboard has value of length fieldsCount.
  final ValueChanged<String> onClipboardFound;

  /// Used to get, modify PinPut value and more.
  final TextEditingController controller;

  /// Defines the keyboard focus for this widget.
  /// To give the keyboard focus to this widget, provide a [focusNode] and then
  /// use the current [FocusScope] to request the focus:
  final FocusNode focusNode;

  /// Widget that is displayed before field submitted.
  final Widget preFilledWidget;

  /// Sets the positions where the separator should be shown
  final List<int> separatorPositions;

  /// Builds a PinPut separator
  final Widget separator;

  /// The style to use for PinPut
  /// If null, defaults to the `subhead` text style from the current [Theme].
  final TextStyle textStyle;

  ///  Box decoration of following properties of [PinPut]
  ///  [submittedFieldDecoration] [selectedFieldDecoration] [followingFieldDecoration] [disabledDecoration]
  ///  You can customize every pixel with it
  ///  properties are being animated implicitly when value changes
  ///  ```dart
  ///  this.color,
  ///  this.image,
  ///  this.border,
  ///  this.borderRadius,
  ///  this.boxShadow,
  ///  this.gradient,
  ///  this.backgroundBlendMode,
  ///  this.shape = BoxShape.rectangle,
  ///  ```

  /// The decoration of each [PinPut] submitted field
  final BoxDecoration submittedFieldDecoration;

  /// The decoration of [PinPut] currently selected field
  final BoxDecoration selectedFieldDecoration;

  /// The decoration of each [PinPut] following field
  final BoxDecoration followingFieldDecoration;

  /// The decoration of each [PinPut] field when [PinPut] ise disabled
  final BoxDecoration disabledDecoration;

  /// width of each [PinPut] field
  final double eachFieldWidth;

  /// height of each [PinPut] field
  final double eachFieldHeight;

  /// Defines how [PinPut] fields are being placed inside [Row]
  final MainAxisAlignment fieldsAlignment;

  /// Defines how each [PinPut] field are being placed within the container
  final AlignmentGeometry eachFieldAlignment;

  /// Empty space to surround the [PinPut] field container.
  final EdgeInsetsGeometry eachFieldMargin;

  /// Empty space to inscribe the [PinPut] field container.
  /// For example space between border and text
  final EdgeInsetsGeometry eachFieldPadding;

  /// Additional constraints to apply to the each field container.
  /// properties
  /// ```dart
  ///  this.minWidth = 0.0,
  ///  this.maxWidth = double.infinity,
  ///  this.minHeight = 0.0,
  ///  this.maxHeight = double.infinity,
  ///  ```
  final BoxConstraints eachFieldConstraints;

  /// The decoration to show around the text [PinPut].
  ///
  /// can be configured to show an icon, border,counter, label, hint text, and error text.
  /// set counterText to '' to remove bottom padding entirely
  final InputDecoration inputDecoration;

  /// curve of every [PinPut] Animation
  final Curve animationCurve;

  /// Duration of every [PinPut] Animation
  final Duration animationDuration;

  /// Animation Type of each [PinPut] field
  /// options:
  /// none, scale, fade, slide, rotation
  final PinAnimationType pinAnimationType;

  /// Begin Offset of ever [PinPut] field when [pinAnimationType] is slide
  final Offset slideTransitionBeginOffset;

  /// Defines [PinPut] state
  final bool enabled;

  /// {@macro flutter.widgets.editableText.autofocus}
  final bool autofocus;

  /// If true [validator] function is called when [PinPut] value changes
  /// alternatively you can use [GlobalKey]
  /// ```dart
  ///   final _formKey = GlobalKey<FormState>();
  ///   _formKey.currentState.validate()
  /// ```
  final AutovalidateMode autovalidateMode;

  /// If true the focused field includes fake cursor
  final bool withCursor;

  /// If [withCursor] true the focused field includes cursor widget or '|'
  final Widget cursor;

  /// The appearance of the keyboard.
  /// This setting is only honored on iOS devices.
  /// If unset, defaults to the brightness of [ThemeData.primaryColorBrightness].
  final Brightness keyboardAppearance;

  /// {@macro flutter.widgets.editableText.inputFormatters}
  final List<TextInputFormatter> inputFormatters;

  /// An optional method that validates an input. Returns an error string to
  /// display if the input is invalid, or null otherwise.
  ///
  /// The returned value is exposed by the [FormFieldState.errorText] property.
  /// The [TextFormField] uses this to override the [InputDecoration.errorText]
  /// value.
  ///
  /// Alternating between error and normal state can cause the height of the
  /// [TextFormField] to change if no other subtext decoration is set on the
  /// field. To create a field whose height is fixed regardless of whether or
  /// not an error is displayed, either wrap the  [TextFormField] in a fixed
  /// height parent like [SizedBox], or set the [TextFormField.helperText]
  /// parameter to a space.
  final FormFieldValidator<String> validator;

  /// {@macro flutter.widgets.editableText.keyboardType}
  final TextInputType keyboardType;

  /// Provide any symbol to obscure each [PinPut] field
  /// Recommended ●
  final String obscureText;

  /// {@macro flutter.widgets.editableText.textCapitalization}
  final TextCapitalization textCapitalization;

  /// The type of action button to use for the keyboard.
  ///
  /// Defaults to [TextInputAction.newline] if [keyboardType] is
  /// [TextInputType.multiline] and [TextInputAction.done] otherwise.
  final TextInputAction textInputAction;

  /// Configuration of toolbar options.
  ///
  /// If not set, select all and paste will default to be enabled. Copy and cut
  /// will be disabled if [obscureText] is true. If [readOnly] is true,
  /// paste and cut will be disabled regardless.
  final ToolbarOptions toolbarOptions;

  /// Maximize the amount of free space along the main axis.
  final MainAxisSize mainAxisSize;

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

enum PinAnimationType {
  none,
  scale,
  fade,
  slide,
  rotation,
}

Example

Import the package:

import 'package:flutter/material.dart';
import 'package:pinput/pin_put/pin_put.dart';

void main() => runApp(PinPutTest());

class PinPutTest extends StatefulWidget {
  @override
  PinPutTestState createState() => PinPutTestState();
}

class PinPutTestState extends State<PinPutTest> {
  final TextEditingController _pinPutController = TextEditingController();
  final FocusNode _pinPutFocusNode = FocusNode();

  BoxDecoration get _pinPutDecoration {
    return BoxDecoration(
      border: Border.all(color: Colors.deepPurpleAccent),
      borderRadius: BorderRadius.circular(15.0),
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primaryColor: Colors.green,
        hintColor: Colors.green,
      ),
      home: Scaffold(
        backgroundColor: Colors.white,
        body: Builder(
          builder: (context) {
            return Center(
              child: SingleChildScrollView(
                child: Column(
                  mainAxisSize: MainAxisSize.min,
                  children: <Widget>[
                    Container(
                      color: Colors.white,
                      margin: const EdgeInsets.all(20.0),
                      padding: const EdgeInsets.all(20.0),
                      child: PinPut(
                        fieldsCount: 5,
                        onSubmit: (String pin) => _showSnackBar(pin, context),
                        focusNode: _pinPutFocusNode,
                        controller: _pinPutController,
                        submittedFieldDecoration: _pinPutDecoration.copyWith(
                          borderRadius: BorderRadius.circular(20.0),
                        ),
                        selectedFieldDecoration: _pinPutDecoration,
                        followingFieldDecoration: _pinPutDecoration.copyWith(
                          borderRadius: BorderRadius.circular(5.0),
                          border: Border.all(
                            color: Colors.deepPurpleAccent.withOpacity(.5),
                          ),
                        ),
                      ),
                    ),
                    const SizedBox(height: 30.0),
                    const Divider(),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                      children: <Widget>[
                        FlatButton(
                          onPressed: () => _pinPutFocusNode.requestFocus(),
                          child: const Text('Focus'),
                        ),
                        FlatButton(
                          onPressed: () => _pinPutFocusNode.unfocus(),
                          child: const Text('Unfocus'),
                        ),
                        FlatButton(
                          onPressed: () => _pinPutController.text = '',
                          child: const Text('Clear All'),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            );
          },
        ),
      ),
    );
  }

  void _showSnackBar(String pin, BuildContext context) {
    final snackBar = SnackBar(
      duration: const Duration(seconds: 3),
      content: Container(
        height: 80.0,
        child: Center(
          child: Text(
            'Pin Submitted. Value: $pin',
            style: const TextStyle(fontSize: 25.0),
          ),
        ),
      ),
      backgroundColor: Colors.deepPurpleAccent,
    );
    Scaffold.of(context)
      ..hideCurrentSnackBar()
      ..showSnackBar(snackBar);
  }
}
Comments
  • autofill not working on ios

    autofill not working on ios

    I tried to use the autofill and it works perfectly with andriod but its not working with the ios

    Pinput( androidSmsAutofillMethod: AndroidSmsAutofillMethod.smsUserConsentApi, length: 6, focusNode: _pinOTPCodeFocus, controller: _pinOTPController, defaultPinTheme: PinTheme( textStyle: TextStyle( color: Colors.white, fontSize: 16, ), width: 40.0, height: 50.0, decoration: pinOTPCodeDecoration), pinAnimationType: PinAnimationType.rotation, onCompleted: _onCompleted)

    opened by Mohamedfaroouk 12
  • PinnPut androidSmsAutofillMethod is not working on showModalBottomSheet

    PinnPut androidSmsAutofillMethod is not working on showModalBottomSheet

    I was wondering if it would be possible for Pinput to receive sms code on showModalBottomSheet? These codes were working fine on StatefullWidget page but not in showModalBottomSheet. Any help would be appreciated.

    Thank you in advance.

    Best Regards, SM

    an additional info:

    Flutter 3.0.5 • channel stable Framework • revision f1875d570e Engine • revision e85ea0e79c Tools • Dart 2.17.6 • DevTools 2.12.2 use: bloc, rxdart pinput: ^2.2.12

    my code as follow:

    import 'package:flutter/material.dart';
    import 'package:pinput/pinput.dart';
    import '../../app.dart';
    import '../styles/base_style.dart';
    import '../styles/button_style.dart';
    import '../styles/color_style.dart';
    import '../widgets/actionSheetAppBar_widget.dart';
    import '../widgets/swipeButton_widget.dart';
    
    Future<bool> otpModalSheet(
        BuildContext context, String phoneNumber, FocusNode focusNode) async {
      final Size _size = MediaQuery.of(context).size;
      final defaultPinTheme = PinTheme(
        width: ButtonStyles.buttonWidth,
        height: ButtonStyles.buttonHeight,
        textStyle: TextStyle(
          fontFamily: 'Poppins',
          color: Colors.white,
          fontWeight: FontWeight.w400,
          fontSize: 20.0,
        ),
        decoration: BoxDecoration(
          color: AppColors.defaultPinTheme,
          borderRadius: BorderRadius.circular(ButtonStyles.buttonHeight),
        ),
      );
      final focusedPinTheme = defaultPinTheme.copyDecorationWith(
        color: AppColors.focusedPinTheme,
      );
      final submittedPinTheme = defaultPinTheme.copyWith(
        decoration: defaultPinTheme.decoration!.copyWith(
          color: AppColors.submittedPinTheme,
        ),
      );
      final errorPinTheme = defaultPinTheme.copyWith(
        decoration: BoxDecoration(
          color: AppColors.errorPinTheme,
        ),
      );
    
      return await showModalBottomSheet(
        enableDrag: false,
        shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.vertical(top: Radius.circular(25.0))),
        backgroundColor: AppColors.actionSheetPrefixIcon,
        context: context,
        isScrollControlled: true,
        builder: (BuildContext context) => SingleChildScrollView(
          padding: MediaQuery.of(context).viewInsets,
          child: Column(
            children: <Widget>[
              SizedBox(height: _size.height * 0.01),
              ActionSheetAppBar(
                title: 'One Time Password',
                onTap: () => Navigator.of(context).pop(false),
              ),
              SizedBox(height: _size.height * 0.01),
              Padding(
                padding: BaseStyles.listPadding,
                child: StreamBuilder<String?>(
                  stream: otpBloc.returnOtp,
                  initialData: "",
                  builder: (BuildContext context, AsyncSnapshot snapshot) {
                    return Pinput(
                      length: 6,
                      keyboardType: TextInputType.number,
                      defaultPinTheme: defaultPinTheme,
                      focusedPinTheme: focusedPinTheme,
                      submittedPinTheme: submittedPinTheme,
                      errorPinTheme: errorPinTheme,
                      separator: Container(
                        height: 60,
                        width: 3,
                        color: Colors.white,
                      ),
                      focusNode: focusNode,
                      autofocus: true,
                      pinputAutovalidateMode: PinputAutovalidateMode.onSubmit,
                      showCursor: true,
                      pinAnimationType: PinAnimationType.fade,
                      animationDuration: Duration(milliseconds: 300),
                      androidSmsAutofillMethod:
                          AndroidSmsAutofillMethod.smsRetrieverApi,
                      onChanged: otpBloc.returnOtpChange,
                    );
                  },
                ),
              ),
              StreamBuilder<bool>(
                stream: otpBloc.isValid,
                builder: (BuildContext context, AsyncSnapshot snapshot) {
                  final bool _isValid = (!snapshot.hasData) ? false : snapshot.data;
                  return AppSwipeButton(
                    hasData: _isValid,
                    buttonText: 'Verify',
                    onPressed: () async {
                      //---do something---//
                      Navigator.of(context).pop(true);
                    },
                  );
                },
              ),
              SizedBox(height: _size.height * 0.02),
            ],
          ),
        ),
      );
    }
    
    

    image

    opened by suryamin 10
  • onCompleted returns pin longer than specified length

    onCompleted returns pin longer than specified length

    length: 6,
    onCompleted: (String pin) async {
            print(pin);
    }
    

    Here print(pin); sometimes prints a String that is longer than 6 digits in length. I am temporarily using pin.substring(0,6) to prevent errors when using input with firebase phone auth.

    opened by da-revo 9
  • validator and autovalidateMode removed from package?

    validator and autovalidateMode removed from package?

    Hey, I just upgraded to latest version, and trying migrate from 1.2.0. And I see that validator and autovalidateMode are removed.

    Can you add them again? It very useful to show a custom error message below the pinput.

    Thanks

    opened by naamapps 9
  • Set PinPut value programmatically

    Set PinPut value programmatically

    So many changes since last time I'm using this awesome package. Bravo and good job to the developers. Right now, I have a case like this. a user wants to fill up the pin put field automatically when authentication sms received. Let say I can retrieve the auth code programmatically and then want to set the code as pinput value and show it to user. How can I do that?

    opened by sinuraya 9
  • How to edit particular digit and change it to new value without deleting other digits?

    How to edit particular digit and change it to new value without deleting other digits?

    I want user to be able to edit any value in-between that is they should be able to click on particular field and edit it rather than deleting all the previous values to edit that place How I can achieve this ?

    opened by Aashutosh3804 8
  • SMS autofill does not work on android

    SMS autofill does not work on android

    I tried to use both androidSmsAutofillMethod.smsRetrieverApi and AndroidSmsAutofillMethod.smsUserConsentApi but none of them autocomplete the field when I am receiving a sms.

    Here is all my code:

    Pinput(
          controller: _textEditingController,
          length: widget.digitCount,
          keyboardType: widget.keyboardType,
          textCapitalization: widget.textCapitalization ?? TextCapitalization.none,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          androidSmsAutofillMethod: AndroidSmsAutofillMethod.smsRetrieverApi,
          separator: SizedBox(width: 2),
          defaultPinTheme: _defaultPinTheme(),
          showCursor: false,
          focusedPinTheme: _defaultPinTheme().copyDecorationWith(
            border: Border.all(
              color: widget.hasSucceeded
                  ? _succeedColor
                  : Theme.of(context).colorScheme.primary,
              width: 2,
            ),
          ),
          errorPinTheme: _defaultPinTheme().copyDecorationWith(
            border: Border.all(
              color: Theme.of(context).colorScheme.error,
              width: 2,
            ),
          ),
          onCompleted: (code) {
            widget.onValidate(code);
          },
          onTap: () {
            if (widget.hasError) {
              _textEditingController.clear();
            }
            widget.onFocus();
          },
        );
      }
    
    opened by ousvat 8
  • Not able to clear the pin input

    Not able to clear the pin input

    Hi, I just upgraded to latest version and when i tried to clear the pin input through _pinPutController.text = ""; and _pinPutController.clear();, it is not working as expected. The pin is not removed.

    Please suggest that how can I clear the pin input. Thank you.

    opened by jh-tan 8
  • Flutter 3 fix

    Flutter 3 fix

    In Flutter 3, WidgetsBinding.instance no longer requires a null safety check.

    : Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
    ../…/src/pinput_state.dart:81
    - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../bin/flutter/packages/flutter/lib/src/widgets/binding.dart').
    package:flutter/…/widgets/binding.dart:1
        WidgetsBinding.instance!.addObserver(this);
                       ^
    : Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
    ../…/src/pinput_state.dart:202
    - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../bin/flutter/packages/flutter/lib/src/widgets/binding.dart').
    package:flutter/…/widgets/binding.dart:1
        WidgetsBinding.instance!.removeObserver(this);
    
    opened by fennelhans 7
  • Tapping on the textfield don't open (virtual) keyboard

    Tapping on the textfield don't open (virtual) keyboard

    Hello there, Hope you are doing fine. I want to inform you about just one last issue. When keyboard isn't visible, if I tap on the textfields exactly, it does not open the keyboard. However, If I tap on the black space in between the text fields, the keyboard shows up. My code for PinPut is as follows: PinPut( fieldsCount: 6, autofocus: false, onSubmit: (otp) { if (otp.length == 6) _submitOTP(otp); print('otp submitted'); }, eachFieldPadding: EdgeInsets.all(5), focusNode: _otpFocusNode, controller: _otpController, onClipboardFound: (value) => _otpController.text = value, pinAnimationType: PinAnimationType.fade, textStyle: TextStyle( fontSize: 20, color: Colors.white, fontWeight: FontWeight.w800, ), selectedFieldDecoration: _pinPutDecoration, submittedFieldDecoration: _pinPutDecoration.copyWith( color: appMainColorLight, border: Border.all(color: appMainColorLight)), followingFieldDecoration: _pinPutDecoration.copyWith( color: Colors.white, border: Border.all(color: Colors.white)), )

    I am attaching a screenshot for your reference. Thank you for your time and support. screencast-Genymotion-2020-04-16_13 42 38 037

    opened by imarindam 7
  • got error on idle state

    got error on idle state

    ` The following _CastError was thrown building AnimatedContainer(duration: 180ms, Alignment.center, bg: BoxDecoration(border: Border.all(BorderSide(Color(0xff5611f8), 1.0, BorderStyle.solid)), borderRadius: BorderRadius.circular(15.0)), BoxConstraints(w=40.0, h=40.0), clipBehavior: Clip.none, dirty, state: _AnimatedContainerState#0f720(ticker inactive, AlignmentGeometryTween(Alignment.center → Alignment.center), bg: DecorationTween(BoxDecoration(border: Border.all(BorderSide(Color(0xff5611f8), 1.0, BorderStyle.solid)), borderRadius: BorderRadius.circular(15.0)) → null), BoxConstraintsTween(BoxConstraints(w=40.0, h=40.0) → BoxConstraints(w=40.0, h=40.0)))):

    `

    image

    opened by arjundevlucid 6
  • Numbers not typing

    Numbers not typing

    Hi. Please in trying to implement the package, I encountered an error whereby the first character of the pin field is not accepting numbers, only special characters. And this happens only on Android, on iOS it's working fine.

    https://user-images.githubusercontent.com/61969550/211009383-15f69df0-400e-423e-b5e4-490c486ef552.mp4

    opened by descobee 3
  • A suggestion, you might like to make [suggestion]

    A suggestion, you might like to make [suggestion]

    InlineSpan is used in the Flutter text field, which means that the entire text changes with the direction of the context or selection. The problem I have with my program, because it supports all languages when typing, I can't just change the desired line to the detected direction. In my opinion, you can create a package that detects and displays the direction in each new line in the text field, like what you did in this package and you are familiar with the text field state objects. Please see these 2 links to understand what I mean Link1 Link2

    I spent some time on it by editing the text field file and it can probably be fixed perfectly

     
      Widget buildText() {
        List<String> list = text.replaceAll("\n", "&&\n").split("&&");
    
        return Container(
          padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
          decoration: BoxDecoration(
              color: Colors.grey[100], borderRadius: BorderRadius.circular(8)),
          child: SingleChildScrollView(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: List.generate(list.length, (index) {
                if (list[index].isNotEmpty && isRTL(list[index])) {
                  return Directionality(
                    textDirection: TextDirection.rtl,
                    child: Row(
                      children: [
                        Text(
                          list[index],
                          style: widget.style,
                        )
                      ],
                    ),
                  );
                }
                return Text(
                  list[index],
                  style: widget.style,
                );
              }),
            ),
          ),
        );
      }
    

    thanks, for your great package and good luck

    opened by MohsenHaydari 1
  • App crashes while reading the OTP

    App crashes while reading the OTP

    D/AndroidRuntime(13715): Shutting down VM E/AndroidRuntime(13715): FATAL EXCEPTION: main E/AndroidRuntime(13715): Process: com.twid, PID: 13715 E/AndroidRuntime(13715): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.google.android.gms.auth.api.phone.SMS_RETRIEVED flg=0x200010 pkg=com.twid (has extras) } in fman.ge.smart_auth.SmartAuthPlugin$ConsentBroadcastReceiver@eeba7d9 E/AndroidRuntime(13715): at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1708) E/AndroidRuntime(13715): at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(Unknown Source:2) E/AndroidRuntime(13715): at android.os.Handler.handleCallback(Handler.java:978) E/AndroidRuntime(13715): at android.os.Handler.dispatchMessage(Handler.java:104) E/AndroidRuntime(13715): at android.os.Looper.loopOnce(Looper.java:238) E/AndroidRuntime(13715): at android.os.Looper.loop(Looper.java:357) E/AndroidRuntime(13715): at android.app.ActivityThread.main(ActivityThread.java:8090) E/AndroidRuntime(13715): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(13715): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) E/AndroidRuntime(13715): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026) E/AndroidRuntime(13715): Caused by: java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode E/AndroidRuntime(13715): at androidx.fragment.app.FragmentActivity.checkForValidRequestCode(FragmentActivity.java:715) E/AndroidRuntime(13715): at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:660) E/AndroidRuntime(13715): at fman.ge.smart_auth.SmartAuthPlugin$ConsentBroadcastReceiver.onReceive(SmartAuthPlugin.kt:489) E/AndroidRuntime(13715): at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1698) E/AndroidRuntime(13715): ... 9 more

    -------------------*****************----------- As per the crash, request code that you are using in startActivityForResult is greater than 16 bits. Please change the request code value to fix it.

    opened by amit-jaiswal-twid 45
  • Error (Xcode): ../../../.pub-cache/hosted/pub.dev/pinput-2.2.17/lib/src/pinput_state.dart:339:14: Error: The method 'FocusTrapArea' isn't defined for the class '_PinputState'.

    Error (Xcode): ../../../.pub-cache/hosted/pub.dev/pinput-2.2.17/lib/src/pinput_state.dart:339:14: Error: The method 'FocusTrapArea' isn't defined for the class '_PinputState'.

    Error (Xcode): ../../../.pub-cache/hosted/pub.dev/pinput-2.2.17/lib/src/pinput_state.dart:339:14: Error: The method 'FocusTrapArea' isn't defined for the class '_PinputState'.

    opened by johnnyychiu 1
  • Sms Autofill for Android not Working for internal testing on Play console

    Sms Autofill for Android not Working for internal testing on Play console

    I tried using the package and autofill worked for me when I started the app on release mode. As soon as I uploaded to internal testing it didn't worked for me.

                          `Pinput(
                                  controller: _pinPutController,
                                  focusNode: _pinPutFocus,
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  showCursor: true,
                                  cursor: TextStyles.cursor,
                                  length: 4,
                                  inputFormatters: [FilteringTextInputFormatter
                                      .digitsOnly,],
                                  pinAnimationType: PinAnimationType.scale,
                                  androidSmsAutofillMethod:
                                      AndroidSmsAutofillMethod.smsRetrieverApi,
                                  defaultPinTheme: TextStyles.defaultPinTheme,
                                  focusedPinTheme: TextStyles.defaultPinTheme
                                      .copyWith(
                                          decoration: TextStyles
                                              .pinPutSelectedDecoration),
                                  errorPinTheme:
                                      TextStyles.defaultPinTheme.copyWith(
                                    decoration: BoxDecoration(
                                      color: AppColors.kMain,
                                      borderRadius: BorderRadius.circular(8),
                                    ),
                                  ),
                                  listenForMultipleSmsOnAndroid: true,
                                  onCompleted: (val) {
                                    codeValue = val;
                                  },
                              )`
    
    opened by smit-locusnine 12
  • FocusTrapArea

    FocusTrapArea

    Error: The method 'FocusTrapArea' isn't defined for the class '_PinputState'.

    • '_PinputState' is from 'package:pinput/src/pinput.dart' ('/C:/Users/paramesh/AppData/Local/Pub/Cache/hosted/pub.dev/pinput-2.2.16/lib/src/pinput.dart'). Try correcting the name to the name of an existing method, or defining a method named 'FocusTrapArea'. child: FocusTrapArea(
    opened by parameshmamidisetti 4
Releases(v2.2.13)
Android test task master - Create PIN code screen, authentication by PIN code screen and menu screen

Here is described test tasks for a android dev. Need to implement three screens:

null 3 Oct 4, 2022
Verify code input. You can create a verify code input.

flutter_verification_code_input A Flutter package that help you create a verification input. Installing flutter_verification_code_input: git:

Tiny Express 49 Dec 7, 2022
Verify code input. You can create a verify code input.

flutter_verification_code_input A Flutter package that help you create a verification input. Installing flutter_verification_code_input: git:

Tiny Express 49 Dec 7, 2022
Become an artist, pixel by pixel.

place Introduction This project was written as a support for my Medium article and is currently running on this website. Getting Started In order to b

Julien Duribreux 11 Dec 16, 2022
A Flutter package that provides a dropdown form field using a dropdown button inside a form field.

Dropdown form field A dropdown form field using a dropdown button inside a form field. Demo Features Can be used as regular form field. Simple to impl

Carlos Eugenio Torres 72 Jan 1, 2023
Flutter package for Android and iOS allow you to show a wide range of hyperlinks either in the input field or in an article view

Tagtly package help you to detect a lot of hyperlink text such as.. email, url, social media tags, hashtag and more either when user type in text field or when appear a text read only.

Mohamed Nasr 4 Jul 25, 2022
Advanced & beautiful animations inspired by animate_do and Animate.css, every animation is a widget that contains default but customizable values 💙

animate_it An animation package inspired by animate_do and Animate.css. Since the original animate_do is not being maintained, I have decided to creat

Luke Moody 3 Oct 1, 2022
Detectable text field - Flutter Text widgets with detection features

detectable_text_field Text widgets with detection features. You can detect hasht

null 0 Feb 2, 2022
A text field that displays text on different languages based on your selection.

translatable_text_field A text field that displays text on different languages based on your selection. Its basic idea is that you place this fields i

null 0 Mar 13, 2022
Flutter Plugin - Simple character blocked input that usually used for redeem/validation input.

Block Input Simple character blocked input that usually used for redeem code or validation code input. Gallery Example Full example import 'package:bl

Enkh-Amar 7 Nov 2, 2022
A simple and robust dart FTP Client Library to interact with FTP Servers with possibility of zip and unzip files.

Flutter FTP Connect Flutter simple and robust dart FTP Connect Library to interact with FTP Servers with possibility of zip and unzip files. Key Featu

Salim Lachdhaf 49 Dec 13, 2022
A simple button that gives you the possibility to transform into a circular one and shows a progress indicator

Progress Button A simple button that gives you the possibility to transform into

Daniel B Schneider 0 Dec 22, 2021
Text analyzer that extracts tokens from text for use in full-text search queries and indexes.

Tokenize text, compute document readbility and compare terms in Natural Language Processing. THIS PACKAGE IS PRE-RELEASE, and SUBJECT TO DAILY BREAKIN

GM Consult Pty Ltd 5 Dec 12, 2022
A Flutter package that help you create a verification input.

flutter_verification_code A Flutter package that help you create a verification input. Based on https://github.com/tiny-express/flutter_verification_c

Alex Awaik 21 Dec 15, 2022
Masked text input formatter for flutter.

mask_text_input_formatter The package provides TextInputFormatter for TextField and TextFormField which format the input by a given mask. Example Chec

Sergey 200 Dec 25, 2022
A new flutter package project which contains lots of beautiful alert dialog that will help you lot to create beautiful awesome alert box very quickly and easily.

A new flutter package project which contains lots of beautiful alert dialog that will help you lot to create beautiful awesome alert box very quickly and easily.

Karan Soni 8 Jan 8, 2022
This package supports an animated icon with some customization.

animated_icon This package supports an animated icon with some customization. It includes an icon type, animation as well as onTap() parameters throug

MindInventory 12 Dec 23, 2022
MindInventory 15 Sep 5, 2022
A package that gives us a modern way to show animated border as a placeholder while loading our widget with easy customization and ready to use.

A package that gives us a modern way to show animated border as a placeholder while loading our widget with easy customization and ready to use.

Mohit Chauhan 8 Oct 3, 2022