mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 12:12:13 +00:00
enable dark mode for registration
This commit is contained in:
parent
ea41158872
commit
805d7a66b3
7 changed files with 61 additions and 33 deletions
|
|
@ -1580,12 +1580,6 @@ abstract class AppLocalizations {
|
|||
/// **'Restore backup'**
|
||||
String get twonlySafeRecoverTitle;
|
||||
|
||||
/// No description provided for @twonlySafeRecoverDesc.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'If you have created a backup with twonly Backup, you can restore it here.'**
|
||||
String get twonlySafeRecoverDesc;
|
||||
|
||||
/// No description provided for @twonlySafeRecoverBtn.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
|
|
|||
|
|
@ -813,10 +813,6 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
@override
|
||||
String get twonlySafeRecoverTitle => 'Backup wiederherstellen';
|
||||
|
||||
@override
|
||||
String get twonlySafeRecoverDesc =>
|
||||
'Wenn du ein Backup mit twonly Backup erstellt hast, kannst du es hier wiederherstellen.';
|
||||
|
||||
@override
|
||||
String get twonlySafeRecoverBtn => 'Backup wiederherstellen';
|
||||
|
||||
|
|
|
|||
|
|
@ -807,10 +807,6 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||
@override
|
||||
String get twonlySafeRecoverTitle => 'Restore backup';
|
||||
|
||||
@override
|
||||
String get twonlySafeRecoverDesc =>
|
||||
'If you have created a backup with twonly Backup, you can restore it here.';
|
||||
|
||||
@override
|
||||
String get twonlySafeRecoverBtn => 'Restore backup';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:twonly/src/utils/misc.dart';
|
||||
import 'package:twonly/src/visual/themes/light.dart';
|
||||
|
||||
class OnboardingWrapper extends StatelessWidget {
|
||||
|
|
@ -10,11 +11,20 @@ class OnboardingWrapper extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = isDarkMode(context);
|
||||
final backgroundColor = isDark ? const Color(0xFF0F172A) : primaryColor;
|
||||
final topBlobColor = isDark
|
||||
? primaryColor.withValues(alpha: 0.15)
|
||||
: Colors.white.withValues(alpha: 0.1);
|
||||
final bottomBlobColor = isDark
|
||||
? primaryColor.withValues(alpha: 0.08)
|
||||
: Colors.black.withValues(alpha: 0.05);
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Scaffold(
|
||||
backgroundColor: primaryColor,
|
||||
backgroundColor: backgroundColor,
|
||||
body: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
|
|
@ -25,7 +35,7 @@ class OnboardingWrapper extends StatelessWidget {
|
|||
height: 300,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.white.withValues(alpha: 0.1),
|
||||
color: topBlobColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -37,7 +47,7 @@ class OnboardingWrapper extends StatelessWidget {
|
|||
height: 200,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.black.withValues(alpha: 0.05),
|
||||
color: bottomBlobColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -66,6 +66,10 @@ class _BackupRecoveryViewState extends State<BackupRecoveryView> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = isDarkMode(context);
|
||||
final cardColor = isDark ? const Color(0xFF1E293B) : Colors.white;
|
||||
final inputColor = isDark ? const Color(0xFF0F172A) : Colors.grey[100];
|
||||
|
||||
return OnboardingWrapper(
|
||||
children: [
|
||||
Row(
|
||||
|
|
@ -118,11 +122,13 @@ class _BackupRecoveryViewState extends State<BackupRecoveryView> {
|
|||
Container(
|
||||
padding: const EdgeInsets.all(24),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: cardColor,
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.1),
|
||||
color: isDark
|
||||
? Colors.black.withValues(alpha: 0.3)
|
||||
: Colors.black.withValues(alpha: 0.1),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
|
|
@ -134,20 +140,25 @@ class _BackupRecoveryViewState extends State<BackupRecoveryView> {
|
|||
TextField(
|
||||
controller: usernameCtrl,
|
||||
onChanged: (value) => setState(() {}),
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: context.lang.registerUsernameDecoration,
|
||||
hintStyle: TextStyle(
|
||||
color: isDark ? Colors.grey[500] : Colors.grey[600],
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey[100],
|
||||
fillColor: inputColor,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
prefixIcon: const Icon(
|
||||
prefixIcon: Icon(
|
||||
Icons.alternate_email,
|
||||
color: isDark ? Colors.grey[400] : Colors.grey[600],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -155,21 +166,26 @@ class _BackupRecoveryViewState extends State<BackupRecoveryView> {
|
|||
TextField(
|
||||
controller: passwordCtrl,
|
||||
onChanged: (value) => setState(() {}),
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
),
|
||||
obscureText: obscureText,
|
||||
decoration: InputDecoration(
|
||||
hintText: context.lang.password,
|
||||
hintStyle: TextStyle(
|
||||
color: isDark ? Colors.grey[500] : Colors.grey[600],
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey[100],
|
||||
fillColor: inputColor,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
prefixIcon: const Icon(
|
||||
prefixIcon: Icon(
|
||||
Icons.lock_outline_rounded,
|
||||
color: isDark ? Colors.grey[400] : Colors.grey[600],
|
||||
),
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () {
|
||||
|
|
@ -182,6 +198,7 @@ class _BackupRecoveryViewState extends State<BackupRecoveryView> {
|
|||
? FontAwesomeIcons.eye
|
||||
: FontAwesomeIcons.eyeSlash,
|
||||
size: 16,
|
||||
color: isDark ? Colors.grey[400] : Colors.grey[600],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -150,6 +150,14 @@ class _RegisterViewState extends State<RegisterView> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = isDarkMode(context);
|
||||
final cardColor = isDark ? const Color(0xFF1E293B) : Colors.white;
|
||||
final inputColor = isDark ? const Color(0xFF0F172A) : Colors.grey[100];
|
||||
final sloganColor = isDark
|
||||
? Colors.white.withValues(alpha: 0.9)
|
||||
: Colors.grey[800];
|
||||
final secondaryButtonColor = isDark ? Colors.grey[400] : Colors.grey[600];
|
||||
|
||||
return OnboardingWrapper(
|
||||
children: [
|
||||
const SizedBox(height: 40),
|
||||
|
|
@ -176,11 +184,13 @@ class _RegisterViewState extends State<RegisterView> {
|
|||
Container(
|
||||
padding: const EdgeInsets.all(24),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: cardColor,
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.1),
|
||||
color: isDark
|
||||
? Colors.black.withValues(alpha: 0.3)
|
||||
: Colors.black.withValues(alpha: 0.1),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
|
|
@ -206,7 +216,7 @@ class _RegisterViewState extends State<RegisterView> {
|
|||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.grey[800],
|
||||
color: sloganColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
|
|
@ -230,20 +240,25 @@ class _RegisterViewState extends State<RegisterView> {
|
|||
RegExp('[a-z0-9A-Z._]'),
|
||||
),
|
||||
],
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: context.lang.registerUsernameDecoration,
|
||||
hintStyle: TextStyle(
|
||||
color: isDark ? Colors.grey[500] : Colors.grey[600],
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey[100],
|
||||
fillColor: inputColor,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
prefixIcon: const Icon(
|
||||
prefixIcon: Icon(
|
||||
Icons.alternate_email,
|
||||
color: isDark ? Colors.grey[400] : Colors.grey[600],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -309,7 +324,7 @@ class _RegisterViewState extends State<RegisterView> {
|
|||
),
|
||||
style: TextButton.styleFrom(
|
||||
minimumSize: const Size.fromHeight(50),
|
||||
foregroundColor: Colors.grey[600],
|
||||
foregroundColor: secondaryButtonColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec
|
|||
|
||||
publish_to: 'none'
|
||||
|
||||
version: 0.2.12+121
|
||||
version: 0.2.13+122
|
||||
|
||||
environment:
|
||||
sdk: ^3.11.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue