Skip to content

MACOS touch bar show password text #119824

Closed
@theotruvelot

Description

@theotruvelot

Hello, I'm writing a macOS app in flutter,
I make a password TextField, and in touch bar there is the password string.

my code :

final password = SizedBox(
      child: TextField(
        autocorrect: false,
        enableSuggestions: false,
        onSubmitted: (value) {
          if (emailController.text.isNotEmpty &&
              passwordController.text.isNotEmpty) {
            authBloc.add(
              LoginEvent(
                  email: emailController.text,
                  password: passwordController.text),
            );
          } else {
            ScaffoldMessenger.of(context).showSnackBar(
              SnackBar(
                backgroundColor: Constants.primaryColor,
                content: Text(
                  'Veuillez remplir tous les champs',
                  style: GoogleFonts.poppins(),
                ),
              ),
            );
          }
        },
        controller: passwordController,
        autofocus: false,
        obscureText: isObscure,
        decoration: InputDecoration(
          prefixIcon: const Icon(
            Icons.lock,
            color: Colors.grey,
            size: 20,
          ),
          suffixIcon: Padding(
            padding: const EdgeInsets.only(right: 8.0),
            child: IconButton(
              onPressed: () {
                setState(() {
                  isObscure = !isObscure;
                });
              },
              icon: isObscure
                  ? const Icon(Icons.visibility_off,
                      color: Colors.grey, size: 20)
                  : const Icon(Icons.visibility, color: Colors.grey, size: 20),
            ),
          ),
          hintText: 'Password',
          hintStyle: GoogleFonts.poppins(color: Colors.grey),
          contentPadding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
          focusedBorder: OutlineInputBorder(
              borderRadius: BorderRadius.circular(32.0),
              borderSide:
                  const BorderSide(color: Constants.accentColor, width: 2)),
          border: OutlineInputBorder(
              borderRadius: BorderRadius.circular(32.0),
              borderSide:
                  const BorderSide(color: Constants.accentColor, width: 2)),
        ),
      ),
    );

My flutter doctor :
`theotruvelot@Paco-2 developpement/stocknet_client (develop !*%) » flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.0, on macOS 13.1 22C65 darwin-arm64, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.2.1)
[✓] VS Code (version 1.74.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!`

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowengineflutter/engine repository. See also e: labels.found in release: 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-macBuilding on or for macOS specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions