[ui] UI theme should match repertory blue #61
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
This commit is contained in:
@@ -56,7 +56,7 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
}
|
||||
|
||||
setState(() => _enabled = false);
|
||||
var authenticated = await auth.authenticate(
|
||||
final authenticated = await auth.authenticate(
|
||||
_userController.text.trim(),
|
||||
_passwordController.text,
|
||||
);
|
||||
@@ -81,28 +81,46 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(widget.title), scrolledUnderElevation: 0),
|
||||
body: SafeArea(
|
||||
child: Container(
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [Color(0xFF0A0F1F), Color(0xFF1B1C1F)],
|
||||
stops: [0.0, 1.0],
|
||||
),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: const Alignment(0, 0.1),
|
||||
child: IgnorePointer(
|
||||
child: Container(
|
||||
width: 740,
|
||||
height: 740,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
gradient: RadialGradient(
|
||||
colors: [
|
||||
Theme.of(context).colorScheme.primary.withValues(alpha: 0.4),
|
||||
Theme.of(context).colorScheme.surface.withValues(alpha: 0.9),
|
||||
scheme.primary.withValues(alpha: 0.22),
|
||||
Colors.transparent,
|
||||
],
|
||||
stops: const [0.0, 1.0],
|
||||
),
|
||||
),
|
||||
child: Consumer<Auth>(
|
||||
),
|
||||
),
|
||||
),
|
||||
Consumer<Auth>(
|
||||
builder: (context, auth, _) {
|
||||
if (auth.authenticated) {
|
||||
Future.delayed(const Duration(milliseconds: 1), () {
|
||||
if (constants.navigatorKey.currentContext == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Navigator.of(
|
||||
constants.navigatorKey.currentContext!,
|
||||
).pushNamedAndRemoveUntil('/', (r) => false);
|
||||
@@ -178,7 +196,9 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
Text(
|
||||
"Secure access to your mounts",
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.bodyMedium
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.copyWith(
|
||||
color: scheme.onSurface.withValues(
|
||||
alpha: 0.7,
|
||||
@@ -195,12 +215,15 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
'Username',
|
||||
Icons.person,
|
||||
),
|
||||
validator: (v) =>
|
||||
(v == null || v.trim().isEmpty)
|
||||
? 'Enter your username'
|
||||
: null,
|
||||
onFieldSubmitted: (_) =>
|
||||
FocusScope.of(context).nextFocus(),
|
||||
validator: (v) {
|
||||
if (v == null || v.trim().isEmpty) {
|
||||
return 'Enter your username';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context).nextFocus();
|
||||
},
|
||||
),
|
||||
const SizedBox(height: constants.padding),
|
||||
|
||||
@@ -208,8 +231,11 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
controller: _passwordController,
|
||||
obscureText: _obscure,
|
||||
textInputAction: TextInputAction.go,
|
||||
decoration: decoration('Password', Icons.lock)
|
||||
.copyWith(
|
||||
decoration:
|
||||
decoration(
|
||||
'Password',
|
||||
Icons.lock,
|
||||
).copyWith(
|
||||
suffixIcon: IconButton(
|
||||
tooltip: _obscure
|
||||
? 'Show password'
|
||||
@@ -219,15 +245,22 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
),
|
||||
onPressed: () => setState(
|
||||
() => _obscure = !_obscure,
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_obscure = !_obscure;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
validator: (v) => (v == null || v.isEmpty)
|
||||
? 'Enter your password'
|
||||
: null,
|
||||
onFieldSubmitted: (_) => doLogin(auth),
|
||||
validator: (v) {
|
||||
if (v == null || v.isEmpty) {
|
||||
return 'Enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onFieldSubmitted: (_) {
|
||||
doLogin(auth);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: constants.padding),
|
||||
|
||||
@@ -235,11 +268,15 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
height: 44,
|
||||
child: ElevatedButton(
|
||||
onPressed: _enabled
|
||||
? () => doLogin(auth)
|
||||
? () {
|
||||
doLogin(auth);
|
||||
}
|
||||
: null,
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(
|
||||
12,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: _enabled
|
||||
@@ -264,6 +301,7 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user