Skip to content

Commit

Permalink
bruig: Fix unlock page crash when isScreenSmall
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlyp authored and miki-totefu committed Sep 26, 2023
1 parent 8f4b7f5 commit fda0ef0
Showing 1 changed file with 54 additions and 57 deletions.
111 changes: 54 additions & 57 deletions bruig/flutterui/bruig/lib/screens/unlock_ln.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,64 +163,61 @@ class __LNUnlockPageState extends State<_LNUnlockPage> {
)
: const SizedBox(height: 50),
SizedBox(height: MediaQuery.of(context).size.height / 6),
Center(
child: Expanded(
child: TextField(
Expanded(
child: TextField(
enabled: !loading,
autofocus: true,
cursorColor: secondaryTextColor,
decoration: InputDecoration(
enabled: !loading,
autofocus: true,
cursorColor: secondaryTextColor,
decoration: InputDecoration(
enabled: !loading,
labelText: "Password",
labelStyle: TextStyle(
letterSpacing: 0,
color: secondaryTextColor),
errorText:
_validate != "" ? _validate : null,
errorBorder: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10.0)),
borderSide: BorderSide(
color: Colors.red, width: 2.0),
),
focusedBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(
Radius.circular(10.0)),
borderSide: BorderSide(
color: secondaryTextColor,
width: 2.0),
),
border: OutlineInputBorder(
borderRadius: const BorderRadius.all(
Radius.circular(10.0)),
borderSide: BorderSide(
color: cardColor, width: 2.0),
),
hintText: "Password",
hintStyle: TextStyle(
letterSpacing: 0,
fontWeight: FontWeight.w100,
color: secondaryTextColor),
filled: true,
fillColor: cardColor),
style: TextStyle(
letterSpacing: 5,
color: secondaryTextColor,
fontSize: 21),
controller: passCtrl,
obscureText: true,
onSubmitted: (value) {
if (!loading) {
unlock();
}
},
onChanged: (value) {
setState(() {
_validate = value.isEmpty
? "Password cannot be empty"
: "";
});
}))),
labelText: "Password",
labelStyle: TextStyle(
letterSpacing: 0,
color: secondaryTextColor),
errorText: _validate != "" ? _validate : null,
errorBorder: const OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(10.0)),
borderSide:
BorderSide(color: Colors.red, width: 2.0),
),
focusedBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(
Radius.circular(10.0)),
borderSide: BorderSide(
color: secondaryTextColor, width: 2.0),
),
border: OutlineInputBorder(
borderRadius: const BorderRadius.all(
Radius.circular(10.0)),
borderSide:
BorderSide(color: cardColor, width: 2.0),
),
hintText: "Password",
hintStyle: TextStyle(
letterSpacing: 0,
fontWeight: FontWeight.w100,
color: secondaryTextColor),
filled: true,
fillColor: cardColor),
style: TextStyle(
letterSpacing: 5,
color: secondaryTextColor,
fontSize: 21),
controller: passCtrl,
obscureText: true,
onSubmitted: (value) {
if (!loading) {
unlock();
}
},
onChanged: (value) {
setState(() {
_validate = value.isEmpty
? "Password cannot be empty"
: "";
});
})),
_validate == ""
? const SizedBox(height: 22)
: const Empty(),
Expand Down

0 comments on commit fda0ef0

Please sign in to comment.