authentication_view 0.5.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 59

Authentication View #

A new Flutter package project.

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

[0.5.0] - 07/08/2019 08:25 AM. #

  • Configures setting text style for authentication view.


import 'package:authentication_view/field_style.dart';
import 'package:authentication_view/field_type.dart';
import 'package:example/field_validator.dart';
import 'package:flutter/material.dart';
import 'package:authentication_view/authentication_view.dart';

import 'app_colors.dart';
import 'constants.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.  const FieldType.value(Constants.FIELD_ADDRESS, 30, TextInputType.text, false),
  FieldType _name  =  FieldType.value(Constants.ID_NAME, Constants.FIELD_NAME, 30, TextInputType.text, false);
  FieldType _email  =  FieldType.value(Constants.ID_EMAIL, Constants.FIELD_EMAIL, 50, TextInputType.emailAddress, false);
  FieldType _mobile =  FieldType.value(Constants.ID_MOBILE, Constants.FIELD_MOBILE, 10,, false);
  FieldType _password  =  FieldType.value(Constants.ID_PASSWORD, Constants.FIELD_PASSWORD, 15, TextInputType.text, true);
  FieldType _confirmPassword  =  FieldType.value(Constants.ID_CONFIRM_PASSWORD, Constants.FIELD_CONFIRM_PASSWORD, 15, TextInputType.text, true);
  FieldType _address =  FieldType.value(Constants.ID_ADDRESS, Constants.FIELD_ADDRESS, 30, TextInputType.text, false);
  FieldType _city =     FieldType.value(Constants.ID_CITY, Constants.FIELD_CITY, 20, TextInputType.text, false);
  FieldType _pincode =  FieldType.value(Constants.ID_PINCODE, Constants.FIELD_PINCODE, 6, TextInputType.number, false);
  FieldType _alternateNumber =   FieldType.value(Constants.ID_ALTERNATE_NUMBER,
      Constants.FIELD_ALTERNATE_NUMBER, 10,, false);

  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
      home: Scaffold(
        body: AuthenticationView(
          fieldStyle: FieldStyle.value(0, 8, 24, 24,
              AppColors.underline,, AppColors.text_grey),
          fieldValidator: (id, values) {
            String value = values[id];
              case Constants.ID_NAME:
                return FieldValidator.validateName(value);
              case Constants.ID_MOBILE:
                return FieldValidator.validateMobileNumber(value);
              case Constants.ID_ALTERNATE_NUMBER:
                return FieldValidator.validateMobileNumber(value);
              case Constants.ID_PINCODE:
                return FieldValidator.validatePincode(value);
              case Constants.ID_CITY:
                return FieldValidator.validateCity(value);
              case Constants.ID_ADDRESS:
                return FieldValidator.validateAddress(value);
              case Constants.ID_EMAIL:
                return FieldValidator.validateEmailAddress(value);
              case Constants.ID_PASSWORD:
                return FieldValidator.validatePassword(value);
              case Constants.ID_CONFIRM_PASSWORD:
                return FieldValidator.validateConfirmPassword(values[Constants.ID_PASSWORD], value);
                return null;
          fieldTypes: [
          onValidation: (bool isValidationSuccess, valueMap) {
            debugPrint("Validation success = "+ isValidationSuccess.toString());
            debugPrint("All the values are " + valueMap.toString());

Use this package as a library

1. Depend on it

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

  authentication_view: ^0.5.0

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:authentication_view/authentication_view.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health issues and suggestions

Document public APIs. (-0.28 points)

119 out of 122 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.

Fix lib/authentication_view.dart. (-1.49 points)

Analysis of lib/authentication_view.dart reported 3 hints:

line 12 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: AuthenticationView.fieldTypes, AuthenticationView.onValidation, AuthenticationView.headerLayout, AuthenticationView.titleLayout, AuthenticationView.messageLayout, AuthenticationView.fieldValidator, AuthenticationView.fieldStyle, AuthenticationView.buttonStyle, AuthenticationView.buttonTextStyle, AuthenticationView.placeHolderAboveButton, AuthenticationView.placeHolderBelowButton, AuthenticationView.fieldIcons, AuthenticationView.buttonText

line 134 col 6: Avoid empty statements.

line 180 col 6: Avoid empty statements.

Fix lib/custom_button.dart. (-0.50 points)

Analysis of lib/custom_button.dart reported 1 hint:

line 4 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: CustomButton.buttonStyle, CustomButton.onButtonPressed, CustomButton.buttonText, CustomButton.margin, CustomButton.textStyle

Fix lib/space.dart. (-0.50 points)

Analysis of lib/space.dart reported 1 hint:

line 3 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: Space.height

Fix additional 7 files with analysis or formatting issues. (-0.50 points)

Additional issues in the following files:

  • lib/text_form_field_view.dart (1 hint)
  • lib/auth_colors.dart (Run flutter format to format lib/auth_colors.dart.)
  • lib/button_style.dart (Run flutter format to format lib/button_style.dart.)
  • lib/field_icons.dart (Run flutter format to format lib/field_icons.dart.)
  • lib/field_style.dart (Run flutter format to format lib/field_style.dart.)
  • lib/field_type.dart (Run flutter format to format lib/field_type.dart.)
  • lib/util.dart (Run flutter format to format lib/util.dart.)

Maintenance suggestions

The package description is too short. (-8 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies