[ad_1]
I am having bother saving consumer credentials on ios model of my flutter app.
I’ve carried out the AutofillGroup
and autofillHints
additionally I added the affiliate domains, right here you’ll be able to see the code and the Xcode setup:
import 'bundle:easy_localization/easy_localization.dart';
import 'bundle:flutter/materials.dart';
import 'bundle:flutter/companies.dart';
import 'bundle:flutter_bloc/flutter_bloc.dart';
import 'bundle:flutter_fimber/flutter_fimber.dart';
import 'bundle:get_it/get_it.dart';
import 'bundle:medfyle/bloc/auth/auth_form_cubit.dart';
import 'bundle:medfyle/presentation/theme/theme.dart';
import '../../../bloc/consumer/user_bloc.dart';
import '../../../navigator.dart';
import '../../element/mixin/custom_tracker.dart';
import '../../element/mixin/loading.dart';
import '../../element/mixin/manage_error.dart';
import '../../element/widget/appbar/base_app_bar.dart';
import '../../element/widget/custom_button.dart';
class LoginPage extends StatefulWidget {
static const routeName="/login_page";
const LoginPage({Key? key}) : tremendous(key: key);
@override
State<LoginPage> createState() => _LoginPageState();
}
class _LoginPageState extends State<LoginPage>
with Loading, ManageError, CustomTracker {
@override
Widget construct(BuildContext context) {
trackScreenWithName(traceName: LoginPage.routeName);
return BlocProvider<AuthFormBlocCubit>(
create: (BuildContext context) => GetIt.occasion.get<AuthFormBlocCubit>(),
little one: Scaffold(
appBar: BaseAppBar(label: "auth.login.title".tr()),
physique: SafeArea(
little one: BlocListener<UserBloc, UserState>(
listener: (context, state) {
if (state is UserIsLoading) {
showLoader(context);
}
if (state is UserLoginError) {
manageError(context, state.error,
showDialog: state.showDialog,
showSnack: false,
dialogCb: hideLoader(context));
hideLoader(context);
Fimber.e(state.error.toString());
}
if (state is UserIsLogged) {
N.goToHome(context);
}
},
little one: Padding(
padding: kDefaultPadding,
little one: BlocBuilder<AuthFormBlocCubit, AuthFormState>(
builder: (context, state) {
return AutofillGroup(
little one: Column(
kids: <Widget>[
TextFormField(
onChanged: (v) {
context.read<AuthFormBlocCubit>().changeEmail(v);
},
autofillHints: const [
AutofillHints.email,
AutofillHints.username,
AutofillHints.newUsername
],
keyboardType: TextInputType.emailAddress,
ornament: InputDecoration(
hintText: "auth.kind.e mail".tr(),
labelText: "auth.kind.e mail".tr(),
),
),
const SizedBox(peak: 16),
TextFormField(
onChanged: (v) {
context.learn<AuthFormBlocCubit>().changePassword(v);
},
keyboardType: TextInputType.visiblePassword,
obscureText: true,
autofillHints: const [
AutofillHints.password,
AutofillHints.newPassword
],
ornament: InputDecoration(
hintText: "auth.kind.password".tr(),
labelText: "auth.kind.password".tr(),
),
),
const SizedBox(peak: 8),
const Spacer(),
CustomButton.fullWidth(
label: "auth.login.btn_enter".tr(),
onPressed: state.validLoginForm
? () {
context.learn<UserBloc>().add(Login(
state.e mail!.trim(),
state.password!.trim()));
TextInput.finishAutofillContext();
}
: null,
),
],
),
);
}),
),
),
)),
);
}
}
Flutter physician:
[✓] Flutter (Channel secure, 3.7.12, on macOS 13.0 22A380 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android gadgets (Android SDK model 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the online
[✓] Android Studio (model 2021.2)
[✓] VS Code (model 1.80.2)
[✓] Related machine (3 out there)
[✓] HTTP Host Availability
That is what I am getting:
I am lacking the “save” popup after logging in:
Additionally, how can I make the suggestion work like this (as an alternative of straightforward “Password” suggestion which I am getting for the time being):
[ad_2]
Source link