[ui] UI theme should match repertory blue #61
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
2025-08-15 13:41:00 -05:00
parent 98a5c89d6b
commit f41a53c463

View File

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