mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-28 14:36:39 +10:00
Refactor autofocus logic in login dialogs for better platform handling
This commit is contained in:
@@ -73,7 +73,7 @@ class RepeaterHubScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Text(
|
Text(
|
||||||
'$repeater.shortPubKeyHex',
|
repeater.shortPubKeyHex,
|
||||||
style: TextStyle(fontSize: 14, color: Colors.grey[600]),
|
style: TextStyle(fontSize: 14, color: Colors.grey[600]),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
|
|||||||
@@ -322,7 +322,9 @@ class _RepeaterLoginDialogState extends State<RepeaterLoginDialog> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSubmitted: (_) => _handleLogin(),
|
onSubmitted: (_) => _handleLogin(),
|
||||||
autofocus: _passwordController.text.isEmpty,
|
autofocus: !(defaultTargetPlatform == TargetPlatform.android ||
|
||||||
|
defaultTargetPlatform == TargetPlatform.iOS) &&
|
||||||
|
_passwordController.text.isEmpty,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
CheckboxListTile(
|
CheckboxListTile(
|
||||||
|
|||||||
@@ -293,7 +293,9 @@ class _RoomLoginDialogState extends State<RoomLoginDialog> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
onSubmitted: (_) => _handleLogin(),
|
onSubmitted: (_) => _handleLogin(),
|
||||||
//autofocus: _passwordController.text.isEmpty,
|
autofocus: !(defaultTargetPlatform == TargetPlatform.android ||
|
||||||
|
defaultTargetPlatform == TargetPlatform.iOS) &&
|
||||||
|
_passwordController.text.isEmpty,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
CheckboxListTile(
|
CheckboxListTile(
|
||||||
|
|||||||
Reference in New Issue
Block a user