From 6223d7848a3353e66ef0582c874de5acb0d1eab6 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Mon, 12 Apr 2021 17:02:26 -0700 Subject: [PATCH] Fix Unlock Styling --- lib/opaque.dart | 7 +++++ lib/views/profilemgrview.dart | 56 +++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/lib/opaque.dart b/lib/opaque.dart index 0eb68b5..1224232 100644 --- a/lib/opaque.dart +++ b/lib/opaque.dart @@ -1362,6 +1362,13 @@ ThemeData mkThemeData(Settings opaque) { overlayColor: MaterialStateProperty.all(opaque.current().defaultButtonActiveColor()), padding: MaterialStateProperty.all(EdgeInsets.all(20))), ), + elevatedButtonTheme: ElevatedButtonThemeData( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(opaque.current().defaultButtonColor()), + foregroundColor: MaterialStateProperty.all(opaque.current().defaultButtonTextColor()), + overlayColor: MaterialStateProperty.all(opaque.current().defaultButtonActiveColor()), + padding: MaterialStateProperty.all(EdgeInsets.all(20))), + ), dialogTheme: DialogTheme( backgroundColor: opaque.current().backgroundPaneColor(), titleTextStyle: TextStyle(color: opaque.current().mainTextColor()), diff --git a/lib/views/profilemgrview.dart b/lib/views/profilemgrview.dart index 6b32cd0..e7015e5 100644 --- a/lib/views/profilemgrview.dart +++ b/lib/views/profilemgrview.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_app/settings.dart'; +import 'package:flutter_app/widgets/passwordfield.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_app/widgets/profilerow.dart'; import 'package:provider/provider.dart'; @@ -94,32 +95,35 @@ class _ProfileMgrViewState extends State { context: context, builder: (BuildContext context) { return Container( - height: 200, // bespoke value courtesy of the [TextField] docs - color: Colors.pink[50], - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Text(AppLocalizations.of(context).enterProfilePassword), - TextField( - obscureText: true, - controller: ctrlrPassword, - decoration: InputDecoration( - border: OutlineInputBorder(), - labelText: AppLocalizations.of(context).password1Label, - ), - ), - ElevatedButton( - child: Text(AppLocalizations.of(context).unlock, semanticsLabel: AppLocalizations.of(context).unlock), - onPressed: () { - Provider.of(context, listen: false).cwtch.LoadProfiles(ctrlrPassword.value.text); - Navigator.pop(context); - }, - ), - ], - )), - ); + height: 200, // bespoke value courtesy of the [TextField] docs + child: Center( + child: Padding( + padding: EdgeInsets.all(10.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Text(AppLocalizations.of(context).enterProfilePassword), + SizedBox( + height: 20, + ), + CwtchPasswordField( + controller: ctrlrPassword, + ), + SizedBox( + height: 20, + ), + ElevatedButton( + child: Text(AppLocalizations.of(context).unlock, semanticsLabel: AppLocalizations.of(context).unlock), + onPressed: () { + Provider.of(context, listen: false).cwtch.LoadProfiles(ctrlrPassword.value.text); + ctrlrPassword.text = ""; + Navigator.pop(context); + }, + ), + ], + )), + )); }); }