);
}
- return Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- TextFormField(
- decoration: InputDecoration(
- icon: Icon(Icons.vpn_lock),
- labelText: 'Origin',
- ),
- controller: widget.originController,
- enabled: false,
- ),
- TextFormField(
- decoration: InputDecoration(
- icon: Icon(Icons.person),
- labelText: 'Username',
+ return AutofillGroup(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ TextFormField(
+ decoration: InputDecoration(
+ icon: Icon(Icons.vpn_lock),
+ labelText: 'Origin',
+ ),
+ controller: widget.originController,
+ enabled: false,
),
- controller: widget.usernameController,
- validator: (value) {
- if (value.isEmpty) {
- return 'Please enter username';
- }
- return null;
- },
- autofillHints: [AutofillHints.username],
- ),
- DropdownButtonFormField(
- decoration: InputDecoration(icon: Icon(Icons.domain)),
- items: widget.accessDomains
- .map((e) => DropdownMenuItem(
- child: ListTile(
- title: Text(e.realm),
- subtitle: Text(e.comment ?? ''),
- ),
- value: e,
- ))
- .toList(),
- onChanged: widget.onDomainChanged,
- selectedItemBuilder: (context) =>
- widget.accessDomains.map((e) => Text(e.realm)).toList(),
- value: widget.selectedDomain,
- ),
- Stack(
- children: [
- TextFormField(
- decoration: InputDecoration(
- icon: Icon(Icons.lock),
- labelText: 'Password',
- ),
- controller: widget.passwordController,
- obscureText: _obscure,
- autocorrect: false,
- focusNode: passwordFocusNode,
- validator: (value) {
- if (value.isEmpty) {
- return 'Please enter password';
- }
- return null;
- },
- onFieldSubmitted: (value) => widget.onPasswordSubmitted(),
- autofillHints: [AutofillHints.password],
+ TextFormField(
+ decoration: InputDecoration(
+ icon: Icon(Icons.person),
+ labelText: 'Username',
),
- Align(
- alignment: Alignment.bottomRight,
- child: IconButton(
- constraints: BoxConstraints.tight(Size(58, 58)),
- iconSize: 24,
- icon: Icon(_obscure ? Icons.visibility : Icons.visibility_off),
- onPressed: () => setState(() {
- _obscure = !_obscure;
- }),
+ controller: widget.usernameController,
+ validator: (value) {
+ if (value.isEmpty) {
+ return 'Please enter username';
+ }
+ return null;
+ },
+ autofillHints: [AutofillHints.username],
+ ),
+ DropdownButtonFormField(
+ decoration: InputDecoration(icon: Icon(Icons.domain)),
+ items: widget.accessDomains
+ .map((e) => DropdownMenuItem(
+ child: ListTile(
+ title: Text(e.realm),
+ subtitle: Text(e.comment ?? ''),
+ ),
+ value: e,
+ ))
+ .toList(),
+ onChanged: widget.onDomainChanged,
+ selectedItemBuilder: (context) =>
+ widget.accessDomains.map((e) => Text(e.realm)).toList(),
+ value: widget.selectedDomain,
+ ),
+ Stack(
+ children: [
+ TextFormField(
+ decoration: InputDecoration(
+ icon: Icon(Icons.lock),
+ labelText: 'Password',
+ ),
+ controller: widget.passwordController,
+ obscureText: _obscure,
+ autocorrect: false,
+ focusNode: passwordFocusNode,
+ validator: (value) {
+ if (value.isEmpty) {
+ return 'Please enter password';
+ }
+ return null;
+ },
+ onFieldSubmitted: (value) => widget.onPasswordSubmitted(),
+ autofillHints: [AutofillHints.password],
),
- )
- ],
- ),
- ],
+ Align(
+ alignment: Alignment.bottomRight,
+ child: IconButton(
+ constraints: BoxConstraints.tight(Size(58, 58)),
+ iconSize: 24,
+ icon:
+ Icon(_obscure ? Icons.visibility : Icons.visibility_off),
+ onPressed: () => setState(() {
+ _obscure = !_obscure;
+ }),
+ ),
+ )
+ ],
+ ),
+ ],
+ ),
);
}