Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] landscape mode keyboard configured

Aman Raj Singh Mourya39d232a937ba
diff --git a/mobile/lib/ui/settings/TEMP/lock_screen_option_confirm_password.dart b/mobile/lib/ui/settings/TEMP/lock_screen_option_confirm_password.dart
index e86b362c8d..915152b576 100644
--- a/mobile/lib/ui/settings/TEMP/lock_screen_option_confirm_password.dart
+++ b/mobile/lib/ui/settings/TEMP/lock_screen_option_confirm_password.dart
@@ -98,67 +98,67 @@ class _LockScreenOptionConfirmPasswordState
),
floatingActionButtonLocation: fabLocation(),
floatingActionButtonAnimator: NoScalingAnimation(),
- body: Center(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- const SizedBox(
- height: 60,
- ),
- SizedBox(
- height: 120,
- width: 120,
- child: Stack(
- children: [
- Align(
- alignment: Alignment.center,
- child: SizedBox(
- height: 75,
- width: 75,
- child: CircularProgressIndicator(
- backgroundColor: colorTheme.fillStrong,
- value: 1,
- strokeWidth: 1.5,
+ body: SingleChildScrollView(
+ child: Center(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ SizedBox(
+ height: 120,
+ width: 120,
+ child: Stack(
+ children: [
+ Align(
+ alignment: Alignment.center,
+ child: SizedBox(
+ height: 75,
+ width: 75,
+ child: CircularProgressIndicator(
+ backgroundColor: colorTheme.fillStrong,
+ value: 1,
+ strokeWidth: 1.5,
+ ),
),
),
- ),
- Align(
- alignment: Alignment.center,
- child: IconButtonWidget(
- size: 30,
- icon: Icons.lock,
- iconButtonType: IconButtonType.primary,
- iconColor: colorTheme.tabIcon,
+ Align(
+ alignment: Alignment.center,
+ child: IconButtonWidget(
+ size: 30,
+ icon: Icons.lock,
+ iconButtonType: IconButtonType.primary,
+ iconColor: colorTheme.tabIcon,
+ ),
),
- ),
- ],
+ ],
+ ),
+ ),
+ Text(
+ 'Re-enter Password',
+ style: textTheme.bodyBold,
),
- ),
- Text(
- 'Re-enter Password',
- style: textTheme.bodyBold,
- ),
- const Padding(padding: EdgeInsets.all(24)),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: TextInputWidget(
- hintText: S.of(context).confirmPassword,
- focusNode: _focusNode,
- enableFillColor: false,
- textCapitalization: TextCapitalization.none,
- textEditingController: _confirmPasswordController,
- isPasswordInput: true,
- onChange: (p0) {
- _isFormValid.value =
- _confirmPasswordController.text.isNotEmpty;
- },
- onSubmit: (p0) {
- return _confirmPasswordMatch();
- },
- submitNotifier: _submitNotifier,
+ const Padding(padding: EdgeInsets.all(12)),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: TextInputWidget(
+ hintText: S.of(context).confirmPassword,
+ focusNode: _focusNode,
+ enableFillColor: false,
+ textCapitalization: TextCapitalization.none,
+ textEditingController: _confirmPasswordController,
+ isPasswordInput: true,
+ onChange: (p0) {
+ _isFormValid.value =
+ _confirmPasswordController.text.isNotEmpty;
+ },
+ onSubmit: (p0) {
+ return _confirmPasswordMatch();
+ },
+ submitNotifier: _submitNotifier,
+ ),
),
- ),
- ],
+ const Padding(padding: EdgeInsets.all(12)),
+ ],
+ ),
),
),
);
diff --git a/mobile/lib/ui/settings/TEMP/lock_screen_option_confirm_pin.dart b/mobile/lib/ui/settings/TEMP/lock_screen_option_confirm_pin.dart
index 2a24ffbe07..38be79bb83 100644
--- a/mobile/lib/ui/settings/TEMP/lock_screen_option_confirm_pin.dart
+++ b/mobile/lib/ui/settings/TEMP/lock_screen_option_confirm_pin.dart
@@ -1,7 +1,9 @@
import "package:flutter/material.dart";
import "package:flutter/services.dart";
import "package:photos/core/configuration.dart";
+import "package:photos/theme/colors.dart";
import "package:photos/theme/ente_theme.dart";
+import "package:photos/theme/text_style.dart";
import "package:photos/ui/components/buttons/icon_button_widget.dart";
import "package:pinput/pinput.dart";
@@ -61,7 +63,6 @@ class _LockScreenOptionConfirmPinState
Widget build(BuildContext context) {
final colorTheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
-
return Scaffold(
appBar: AppBar(
elevation: 0,
@@ -75,241 +76,258 @@ class _LockScreenOptionConfirmPinState
),
),
),
- body: Center(
- child: Column(
- children: [
- const SizedBox(
- height: 60,
- ),
- SizedBox(
- height: 120,
- width: 120,
- child: Stack(
- children: [
- Align(
- alignment: Alignment.center,
- child: SizedBox(
- height: 75,
- width: 75,
- child: ValueListenableBuilder(
- valueListenable: _confirmPinController,
- builder: (context, value, child) {
- return TweenAnimationBuilder<double>(
- tween: Tween<double>(
- begin: 0,
- end: _confirmPinController.text.length / 4,
- ),
- curve: Curves.ease,
- duration: const Duration(milliseconds: 250),
- builder: (context, value, _) =>
- CircularProgressIndicator(
- backgroundColor: colorTheme.fillStrong,
- value: value,
- color: colorTheme.primary400,
- strokeWidth: 1.5,
- ),
- );
- },
- ),
+ body: OrientationBuilder(
+ builder: (context, orientation) {
+ return orientation == Orientation.portrait
+ ? _getBody(colorTheme, textTheme, isPortrait: true)
+ : SingleChildScrollView(
+ child: _getBody(colorTheme, textTheme, isPortrait: false),
+ );
+ },
+ ),
+ );
+ }
+
+ Widget _getBody(colorTheme, textTheme, {required bool isPortrait}) {
+ return Center(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ SizedBox(
+ height: 120,
+ width: 120,
+ child: Stack(
+ children: [
+ Align(
+ alignment: Alignment.center,
+ child: SizedBox(
+ height: 75,
+ width: 75,
+ child: ValueListenableBuilder(
+ valueListenable: _confirmPinController,
+ builder: (context, value, child) {
+ return TweenAnimationBuilder<double>(
+ tween: Tween<double>(
+ begin: 0,
+ end: _confirmPinController.text.length / 4,
+ ),
+ curve: Curves.ease,
+ duration: const Duration(milliseconds: 250),
+ builder: (context, value, _) =>
+ CircularProgressIndicator(
+ backgroundColor: colorTheme.fillStrong,
+ value: value,
+ color: colorTheme.primary400,
+ strokeWidth: 1.5,
+ ),
+ );
+ },
),
),
- Align(
- alignment: Alignment.center,
- child: IconButtonWidget(
- size: 30,
- icon: Icons.lock,
- iconButtonType: IconButtonType.primary,
- iconColor: colorTheme.tabIcon,
- ),
+ ),
+ Align(
+ alignment: Alignment.center,
+ child: IconButtonWidget(
+ size: 30,
+ icon: Icons.lock,
+ iconButtonType: IconButtonType.primary,
+ iconColor: colorTheme.tabIcon,
),
- ],
- ),
- ),
- Text(
- 'Re-enter PIN',
- style: textTheme.bodyBold,
+ ),
+ ],
),
- const Padding(padding: EdgeInsets.all(12)),
- Pinput(
- length: 4,
- useNativeKeyboard: false,
- controller: _confirmPinController,
- defaultPinTheme: _pinPutDecoration,
- submittedPinTheme: _pinPutDecoration.copyWith(
- textStyle: textTheme.h3Bold,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- border: Border.all(
- color: colorTheme.fillBase,
- ),
+ ),
+ Text(
+ 'Re-enter PIN',
+ style: textTheme.bodyBold,
+ ),
+ const Padding(padding: EdgeInsets.all(12)),
+ Pinput(
+ length: 4,
+ controller: _confirmPinController,
+ defaultPinTheme: _pinPutDecoration,
+ submittedPinTheme: _pinPutDecoration.copyWith(
+ textStyle: textTheme.h3Bold,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ border: Border.all(
+ color: colorTheme.fillBase,
),
),
- followingPinTheme: _pinPutDecoration.copyWith(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- border: Border.all(
- color: colorTheme.fillMuted,
- ),
+ ),
+ followingPinTheme: _pinPutDecoration.copyWith(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ border: Border.all(
+ color: colorTheme.fillMuted,
),
),
- focusedPinTheme: _pinPutDecoration,
- errorPinTheme: _pinPutDecoration.copyWith(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- border: Border.all(
- color: colorTheme.fillBase,
- ),
+ ),
+ focusedPinTheme: _pinPutDecoration,
+ errorPinTheme: _pinPutDecoration.copyWith(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ border: Border.all(
+ color: colorTheme.fillBase,
),
- textStyle:
- textTheme.h3Bold.copyWith(color: colorTheme.warning400),
),
- errorText: '',
- obscureText: true,
- obscuringCharacter: '*',
- validator: (value) {
- if (value == widget.pin) {
- return null;
- } else {
- value = null;
- return 'PIN does not match';
- }
- },
- onCompleted: (value) async {
- await Future.delayed(const Duration(milliseconds: 250));
- await _confirmPinMatch();
- },
+ textStyle:
+ textTheme.h3Bold.copyWith(color: colorTheme.warning400),
),
- const Spacer(),
- Container(
- padding: const EdgeInsets.all(2),
- color: colorTheme.strokeFainter,
- child: Column(
- children: [
- Row(
- children: [
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- text: '',
- number: '1',
- onTap: () {
- _onKeyTap('1');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- text: "ABC",
- number: '2',
- onTap: () {
- _onKeyTap('2');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- text: "DEF",
- number: '3',
- onTap: () {
- _onKeyTap('3');
- },
- ),
- ],
- ),
- Row(
- children: [
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '4',
- text: "GHI",
- onTap: () {
- _onKeyTap('4');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '5',
- text: 'JKL',
- onTap: () {
- _onKeyTap('5');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '6',
- text: 'MNO',
- onTap: () {
- _onKeyTap('6');
- },
- ),
- ],
- ),
- Row(
- children: [
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '7',
- text: 'PQRS',
- onTap: () {
- _onKeyTap('7');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '8',
- text: 'TUV',
- onTap: () {
- _onKeyTap('8');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '9',
- text: 'WXYZ',
- onTap: () {
- _onKeyTap('9');
- },
- ),
- ],
- ),
- Row(
- children: [
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '',
- text: '',
- muteButton: true,
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '0',
- text: '',
- onTap: () {
- _onKeyTap('0');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '',
- text: '',
- icons: const Icon(Icons.backspace_outlined),
- onTap: () {
- _onBackspace();
- },
- ),
- ],
- ),
- ],
- ),
+ errorText: '',
+ obscureText: true,
+ obscuringCharacter: '*',
+ validator: (value) {
+ if (value == widget.pin) {
+ return null;
+ } else {
+ value = null;
+ return 'PIN does not match';
+ }
+ },
+ onCompleted: (value) async {
+ await Future.delayed(const Duration(milliseconds: 250));
+ await _confirmPinMatch();
+ },
+ ),
+ isPortrait
+ ? const Spacer()
+ : const Padding(padding: EdgeInsets.all(12)),
+ customKeyPad(colorTheme, textTheme),
+ ],
+ ),
+ );
+ }
+
+ Widget customKeyPad(EnteColorScheme colorTheme, EnteTextTheme textTheme) {
+ return SafeArea(
+ child: Container(
+ padding: const EdgeInsets.all(2),
+ color: colorTheme.strokeFainter,
+ child: Column(
+ children: [
+ Row(
+ children: [
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ text: '',
+ number: '1',
+ onTap: () {
+ _onKeyTap('1');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ text: "ABC",
+ number: '2',
+ onTap: () {
+ _onKeyTap('2');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ text: "DEF",
+ number: '3',
+ onTap: () {
+ _onKeyTap('3');
+ },
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '4',
+ text: "GHI",
+ onTap: () {
+ _onKeyTap('4');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '5',
+ text: 'JKL',
+ onTap: () {
+ _onKeyTap('5');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '6',
+ text: 'MNO',
+ onTap: () {
+ _onKeyTap('6');
+ },
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '7',
+ text: 'PQRS',
+ onTap: () {
+ _onKeyTap('7');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '8',
+ text: 'TUV',
+ onTap: () {
+ _onKeyTap('8');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '9',
+ text: 'WXYZ',
+ onTap: () {
+ _onKeyTap('9');
+ },
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '',
+ text: '',
+ muteButton: true,
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '0',
+ text: '',
+ onTap: () {
+ _onKeyTap('0');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '',
+ text: '',
+ icons: const Icon(Icons.backspace_outlined),
+ onTap: () {
+ _onBackspace();
+ },
+ ),
+ ],
),
],
),
diff --git a/mobile/lib/ui/settings/TEMP/lock_screen_option_password.dart b/mobile/lib/ui/settings/TEMP/lock_screen_option_password.dart
index 87e92e82d2..298998f7aa 100644
--- a/mobile/lib/ui/settings/TEMP/lock_screen_option_password.dart
+++ b/mobile/lib/ui/settings/TEMP/lock_screen_option_password.dart
@@ -111,67 +111,67 @@ class _LockScreenOptionPasswordState extends State<LockScreenOptionPassword> {
),
floatingActionButtonLocation: fabLocation(),
floatingActionButtonAnimator: NoScalingAnimation(),
- body: Center(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- const SizedBox(
- height: 60,
- ),
- SizedBox(
- height: 120,
- width: 120,
- child: Stack(
- children: [
- Align(
- alignment: Alignment.center,
- child: SizedBox(
- height: 75,
- width: 75,
- child: CircularProgressIndicator(
- backgroundColor: colorTheme.fillStrong,
- value: 1,
- strokeWidth: 1.5,
+ body: SingleChildScrollView(
+ child: Center(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ SizedBox(
+ height: 120,
+ width: 120,
+ child: Stack(
+ children: [
+ Align(
+ alignment: Alignment.center,
+ child: SizedBox(
+ height: 75,
+ width: 75,
+ child: CircularProgressIndicator(
+ backgroundColor: colorTheme.fillStrong,
+ value: 1,
+ strokeWidth: 1.5,
+ ),
),
),
- ),
- Align(
- alignment: Alignment.center,
- child: IconButtonWidget(
- size: 30,
- icon: Icons.lock,
- iconButtonType: IconButtonType.primary,
- iconColor: colorTheme.tabIcon,
+ Align(
+ alignment: Alignment.center,
+ child: IconButtonWidget(
+ size: 30,
+ icon: Icons.lock,
+ iconButtonType: IconButtonType.primary,
+ iconColor: colorTheme.tabIcon,
+ ),
),
- ),
- ],
+ ],
+ ),
+ ),
+ Text(
+ widget.isAuthenticating ? 'Enter Password' : 'Set new Password',
+ textAlign: TextAlign.center,
+ style: textTheme.bodyBold,
),
- ),
- Text(
- widget.isAuthenticating ? 'Enter Password' : 'Set new Password',
- textAlign: TextAlign.center,
- style: textTheme.bodyBold,
- ),
- const Padding(padding: EdgeInsets.all(24)),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: TextInputWidget(
- hintText: S.of(context).password,
- focusNode: _focusNode,
- enableFillColor: false,
- textCapitalization: TextCapitalization.none,
- textEditingController: _passwordController,
- isPasswordInput: true,
- onChange: (p0) {
- _isFormValid.value = _passwordController.text.isNotEmpty;
- },
- onSubmit: (p0) {
- return _confirmPassword();
- },
- submitNotifier: _submitNotifier,
+ const Padding(padding: EdgeInsets.all(12)),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: TextInputWidget(
+ hintText: S.of(context).password,
+ focusNode: _focusNode,
+ enableFillColor: false,
+ textCapitalization: TextCapitalization.none,
+ textEditingController: _passwordController,
+ isPasswordInput: true,
+ onChange: (p0) {
+ _isFormValid.value = _passwordController.text.isNotEmpty;
+ },
+ onSubmit: (p0) {
+ return _confirmPassword();
+ },
+ submitNotifier: _submitNotifier,
+ ),
),
- ),
- ],
+ const Padding(padding: EdgeInsets.all(12)),
+ ],
+ ),
),
),
);
diff --git a/mobile/lib/ui/settings/TEMP/lock_screen_option_pin.dart b/mobile/lib/ui/settings/TEMP/lock_screen_option_pin.dart
index 1add61527c..f7956b7efc 100644
--- a/mobile/lib/ui/settings/TEMP/lock_screen_option_pin.dart
+++ b/mobile/lib/ui/settings/TEMP/lock_screen_option_pin.dart
@@ -1,6 +1,8 @@
import "package:flutter/material.dart";
import "package:flutter/services.dart";
+import "package:photos/theme/colors.dart";
import "package:photos/theme/ente_theme.dart";
+import "package:photos/theme/text_style.dart";
import "package:photos/ui/components/buttons/icon_button_widget.dart";
import "package:photos/ui/settings/TEMP/lock_screen_option_confirm_pin.dart";
import 'package:pinput/pinput.dart';
@@ -91,246 +93,263 @@ class _LockScreenOptionPinState extends State<LockScreenOptionPin> {
),
),
),
- body: Center(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- // mainAxisAlignment: MainAxisAlignment.center,
- mainAxisSize: MainAxisSize.min,
- children: [
- const SizedBox(
- height: 60,
- ),
- SizedBox(
- height: 120,
- width: 120,
- child: Stack(
- children: [
- Align(
- alignment: Alignment.center,
- child: SizedBox(
- height: 75,
- width: 75,
- child: ValueListenableBuilder(
- valueListenable: _pinController,
- builder: (context, value, child) {
- return TweenAnimationBuilder<double>(
- tween: Tween<double>(
- begin: 0,
- end: _pinController.text.length / 4,
- ),
- curve: Curves.ease,
- duration: const Duration(milliseconds: 250),
- builder: (context, value, _) =>
- CircularProgressIndicator(
- backgroundColor: colorTheme.fillStrong,
- value: value,
- color: colorTheme.primary400,
- strokeWidth: 1.5,
- ),
- );
- },
- ),
+ body: OrientationBuilder(
+ builder: (context, orientation) {
+ return orientation == Orientation.portrait
+ ? _getBody(colorTheme, textTheme, isPortrait: true)
+ : SingleChildScrollView(
+ child: _getBody(colorTheme, textTheme, isPortrait: false),
+ );
+ },
+ ),
+ );
+ }
+
+ Widget _getBody(
+ EnteColorScheme colorTheme,
+ EnteTextTheme textTheme, {
+ required bool isPortrait,
+ }) {
+ return Center(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ SizedBox(
+ height: 120,
+ width: 120,
+ child: Stack(
+ children: [
+ Align(
+ alignment: Alignment.center,
+ child: SizedBox(
+ height: 75,
+ width: 75,
+ child: ValueListenableBuilder(
+ valueListenable: _pinController,
+ builder: (context, value, child) {
+ return TweenAnimationBuilder<double>(
+ tween: Tween<double>(
+ begin: 0,
+ end: _pinController.text.length / 4,
+ ),
+ curve: Curves.ease,
+ duration: const Duration(milliseconds: 250),
+ builder: (context, value, _) =>
+ CircularProgressIndicator(
+ backgroundColor: colorTheme.fillStrong,
+ value: value,
+ color: colorTheme.primary400,
+ strokeWidth: 1.5,
+ ),
+ );
+ },
),
),
- Align(
- alignment: Alignment.center,
- child: IconButtonWidget(
- size: 30,
- icon: Icons.lock,
- iconButtonType: IconButtonType.primary,
- iconColor: colorTheme.tabIcon,
- ),
+ ),
+ Align(
+ alignment: Alignment.center,
+ child: IconButtonWidget(
+ size: 30,
+ icon: Icons.lock,
+ iconButtonType: IconButtonType.primary,
+ iconColor: colorTheme.tabIcon,
),
- ],
- ),
- ),
- Text(
- widget.isAuthenticating ? 'Enter PIN' : 'Set new PIN',
- style: textTheme.bodyBold,
+ ),
+ ],
),
- const Padding(padding: EdgeInsets.all(12)),
- Pinput(
- length: 4,
- useNativeKeyboard: false,
- controller: _pinController,
- defaultPinTheme: _pinPutDecoration,
- submittedPinTheme: _pinPutDecoration.copyWith(
- textStyle: textTheme.h3Bold,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- border: Border.all(
- color: colorTheme.fillBase,
- ),
+ ),
+ Text(
+ widget.isAuthenticating ? 'Enter PIN' : 'Set new PIN',
+ style: textTheme.bodyBold,
+ ),
+ const Padding(padding: EdgeInsets.all(12)),
+ Pinput(
+ length: 4,
+ useNativeKeyboard: false,
+ controller: _pinController,
+ defaultPinTheme: _pinPutDecoration,
+ submittedPinTheme: _pinPutDecoration.copyWith(
+ textStyle: textTheme.h3Bold,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ border: Border.all(
+ color: colorTheme.fillBase,
),
),
- followingPinTheme: _pinPutDecoration.copyWith(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- border: Border.all(
- color: colorTheme.fillMuted,
- ),
+ ),
+ followingPinTheme: _pinPutDecoration.copyWith(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ border: Border.all(
+ color: colorTheme.fillMuted,
),
),
- focusedPinTheme: _pinPutDecoration,
- errorPinTheme: _pinPutDecoration.copyWith(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10.0),
- border: Border.all(
- color: colorTheme.fillBase,
- ),
+ ),
+ focusedPinTheme: _pinPutDecoration,
+ errorPinTheme: _pinPutDecoration.copyWith(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ border: Border.all(
+ color: colorTheme.fillBase,
),
- textStyle:
- textTheme.h3Bold.copyWith(color: colorTheme.warning400),
),
- validator: widget.isAuthenticating
- ? (value) {
- if (widget.authPin == value) {
- return null;
- }
- return 'Invalid PIN';
+ textStyle:
+ textTheme.h3Bold.copyWith(color: colorTheme.warning400),
+ ),
+ validator: widget.isAuthenticating
+ ? (value) {
+ if (widget.authPin == value) {
+ return null;
}
- : null,
- errorText: '',
- obscureText: true,
- obscuringCharacter: '*',
- onCompleted: (value) async {
- await Future.delayed(const Duration(milliseconds: 250));
- await _confirmPin(_pinController.text);
- },
+ return 'Invalid PIN';
+ }
+ : null,
+ errorText: '',
+ obscureText: true,
+ obscuringCharacter: '*',
+ onCompleted: (value) async {
+ await Future.delayed(const Duration(milliseconds: 250));
+ await _confirmPin(_pinController.text);
+ },
+ ),
+ isPortrait
+ ? const Spacer()
+ : const Padding(padding: EdgeInsets.all(12)),
+ customKeyPad(colorTheme, textTheme),
+ ],
+ ),
+ );
+ }
+
+ Widget customKeyPad(EnteColorScheme colorTheme, EnteTextTheme textTheme) {
+ return SafeArea(
+ child: Container(
+ padding: const EdgeInsets.all(2),
+ color: colorTheme.strokeFainter,
+ child: Column(
+ children: [
+ Row(
+ children: [
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ text: '',
+ number: '1',
+ onTap: () {
+ _onKeyTap('1');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ text: "ABC",
+ number: '2',
+ onTap: () {
+ _onKeyTap('2');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ text: "DEF",
+ number: '3',
+ onTap: () {
+ _onKeyTap('3');
+ },
+ ),
+ ],
),
- const Spacer(),
- SafeArea(
- child: Container(
- padding: const EdgeInsets.all(2),
- color: colorTheme.strokeFainter,
- child: Column(
- children: [
- Row(
- children: [
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- text: '',
- number: '1',
- onTap: () {
- _onKeyTap('1');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- text: "ABC",
- number: '2',
- onTap: () {
- _onKeyTap('2');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- text: "DEF",
- number: '3',
- onTap: () {
- _onKeyTap('3');
- },
- ),
- ],
- ),
- Row(
- children: [
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '4',
- text: "GHI",
- onTap: () {
- _onKeyTap('4');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '5',
- text: 'JKL',
- onTap: () {
- _onKeyTap('5');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '6',
- text: 'MNO',
- onTap: () {
- _onKeyTap('6');
- },
- ),
- ],
- ),
- Row(
- children: [
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '7',
- text: 'PQRS',
- onTap: () {
- _onKeyTap('7');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '8',
- text: 'TUV',
- onTap: () {
- _onKeyTap('8');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '9',
- text: 'WXYZ',
- onTap: () {
- _onKeyTap('9');
- },
- ),
- ],
- ),
- Row(
- children: [
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '',
- text: '',
- muteButton: true,
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '0',
- text: '',
- onTap: () {
- _onKeyTap('0');
- },
- ),
- buttonWidget(
- colorTheme: colorTheme,
- textTheme: textTheme,
- number: '',
- text: '',
- icons: const Icon(Icons.backspace_outlined),
- onTap: () {
- _onBackspace();
- },
- ),
- ],
- ),
- ],
+ Row(
+ children: [
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '4',
+ text: "GHI",
+ onTap: () {
+ _onKeyTap('4');
+ },
),
- ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '5',
+ text: 'JKL',
+ onTap: () {
+ _onKeyTap('5');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '6',
+ text: 'MNO',
+ onTap: () {
+ _onKeyTap('6');
+ },
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '7',
+ text: 'PQRS',
+ onTap: () {
+ _onKeyTap('7');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '8',
+ text: 'TUV',
+ onTap: () {
+ _onKeyTap('8');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '9',
+ text: 'WXYZ',
+ onTap: () {
+ _onKeyTap('9');
+ },
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '',
+ text: '',
+ muteButton: true,
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '0',
+ text: '',
+ onTap: () {
+ _onKeyTap('0');
+ },
+ ),
+ buttonWidget(
+ colorTheme: colorTheme,
+ textTheme: textTheme,
+ number: '',
+ text: '',
+ icons: const Icon(Icons.backspace_outlined),
+ onTap: () {
+ _onBackspace();
+ },
+ ),
+ ],
),
],
),