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