HomeiOS Developmentandroid - Textual content subject icon and cursor measurement anomaly flutter

android – Textual content subject icon and cursor measurement anomaly flutter


I’ve created a Flutter kind that features a TextFormField. It features completely on smaller screens, however after I take a look at it on bigger screens, I discover that the textual content subject’s icon and cursor measurement shrinks inexplicably. I am struggling to grasp the reason for this concern. Can somebody please present steering on find out how to resolve this downside?
Text field

Type(
  key: _formKey,
  little one: Column(
    kids: [
      TextFormField(
        controller: _emailController,
        decoration: InputDecoration(
          hintStyle: TextStyle(
            fontSize: 12.sp,
          ),
          hintText: 'Email address',
          contentPadding: EdgeInsets.symmetric(
            vertical: 19.h,
            horizontal: 13.w,
          ),
        ),
        validator: (value) {
          if (value?.isEmpty ?? true) {
            return 'Please enter your email';
          }
          if (!(value?.contains('@') ?? false)) {
            return 'Please enter a valid email address';
          }
          return null;
        },
      ),
      SizedBox(
        height: isMailGapVisible ? 20.h : 10.h,
      ),
      TextFormField(
        controller: _passwordController,
        obscureText: !isVisible,
        decoration: InputDecoration(
          isDense: true,
          contentPadding: EdgeInsets.symmetric(
            vertical: 19.h,
            horizontal: 13.w,
          ),
          hintStyle: TextStyle(
            fontSize: 12.sp,
          ),
          hintText: 'Password',
          suffixIcon: isVisible
              ? IconButton(
                  onPressed: () {
                    setState(() {
                      isVisible = false;
                    });
                  },
                  icon: const Icon(
                    Icons.visibility,
                    color: Colors.black26,
                  ),
                )
              : IconButton(
                  onPressed: () {
                    setState(() {
                      isVisible = true;
                    });
                  },
                  icon: const Icon(
                    Icons.visibility_off,
                    color: Colors.black26,
                  ),
                ),
        ),
        validator: (value) {
          if (value?.isEmpty ?? true) {
            return 'Please enter your password';
          }
          if (value!.length < 3) {
            return 'Password must be at least 6 characters long';
          }
          return null;
        },
      ),
      SizedBox(
        height: isPwdGapVisible ? 20.h : 5.h,
      ),
    ],
  ),
)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments