How to find the resource id for a textfield in Flutter?

1.4k Views Asked by At

I would like to register the test account credentials for the Pre-launch report in Google Play. In addition to the username and password, I need to provide resource IDs.

I would like to know how I could obtain the resource ID in a Flutter project to add it to the Pre-launch report.

Google Play Console screenshot

Grateful for any help out there !

2

There are 2 best solutions below

0
On

You can give controller name as resource name

code ->

TextEditingController emailController = TextEditingController();

TextField(
                controller: emailController,
                keyboardType: inputType ?? TextInputType.name,
                obscureText: isObSecure ?? false,
                autofocus: autoFocus ?? false,
                onTap: onTap,
                
                decoration: InputDecoration(
                  
                  border: InputBorder.none,
                  hintText: hint,
                  hintStyle: TextStyle(
                    color: AppColors.onSurfaceColor.withOpacity(.4),
                  ),
                  // contentPadding: EdgeInsets.only(bottom: 8),
                ),
              ),

Image from google play console

0
On

Try use widget key. Example :

TextFormField(
  key: const Key('username'),
  controller: controller,
  decoration: InputDecoration(
    hintText: label,
    suffixIcon: suffixIcon,
    filled: true,
    errorStyle: TextStyle(
      color: Colors.red[400],
      fontWeight: FontWeight.bold,
      fontSize: 13,
    ),
  ),
),

Also you can test in Firebase test lab to confirm does it work or not before actually submiting your app in goog