Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
cbddae0
feat: prepare the Pin Code Input Component in core
nouha06 Aug 11, 2025
d4857aa
feat:add token textInput
nouha06 Aug 12, 2025
e7fc30c
feat: add textField for code pin input
nouha06 Aug 12, 2025
2b241f9
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Aug 19, 2025
77f41a7
chore: add pin code input component in lib
nouha06 Aug 22, 2025
24f8f25
feat: add pin code input component in app demo
nouha06 Aug 22, 2025
1056439
fix: delete unused import
nouha06 Aug 22, 2025
b7ee172
feat: fix hint text
nouha06 Aug 22, 2025
f7a2401
feat: add variant pin code input in demo app
nouha06 Aug 27, 2025
f1547e5
feat: add OudsDigitInput
nouha06 Sep 9, 2025
53dc338
feat: refactor code and add verification code in demo app
nouha06 Sep 12, 2025
3c3e52c
feat: refactor
nouha06 Sep 12, 2025
c3f77a7
feat: refactor code and documentation, and add verification state in …
nouha06 Sep 16, 2025
5be86f1
feat: prepare the Pin Code Input Component in core
nouha06 Aug 11, 2025
4a04334
feat:add token textInput
nouha06 Aug 12, 2025
829fd82
feat: add textField for code pin input
nouha06 Aug 12, 2025
237772f
chore: add pin code input component in lib
nouha06 Aug 22, 2025
7b0887e
feat: add pin code input component in app demo
nouha06 Aug 22, 2025
11cab16
fix: delete unused import
nouha06 Aug 22, 2025
b22b17f
feat: fix hint text
nouha06 Aug 22, 2025
b28f497
feat: add variant pin code input in demo app
nouha06 Aug 27, 2025
a9a5f76
feat: add OudsDigitInput
nouha06 Sep 9, 2025
08b13f2
feat: refactor code and add verification code in demo app
nouha06 Sep 12, 2025
b62b0cf
feat: refactor
nouha06 Sep 12, 2025
9ae0a63
feat: refactor code and documentation, and add verification state in …
nouha06 Sep 16, 2025
2850478
Merge branch '307-create-component---pin-code-input' of https://githu…
nouha06 Sep 17, 2025
b3aebfc
review : review code
nouha06 Sep 18, 2025
2749813
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Sep 18, 2025
292e254
feat : update dart doc options
nouha06 Sep 18, 2025
42a4baf
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Sep 19, 2025
4928f8b
review : update the documentation of digit input and pin code input
nouha06 Sep 19, 2025
f2affe4
chore: delete the style option from the pin code input component and …
nouha06 Sep 23, 2025
8dfc231
review : refactor code for the component and fix some issues in demo app
nouha06 Sep 25, 2025
8837f7c
review : add use pin code input control state instead of text input c…
nouha06 Sep 25, 2025
e2c6fc3
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Sep 25, 2025
28a93bf
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Sep 26, 2025
d1e56f7
review : update helper text value according to the number of digit in…
nouha06 Sep 26, 2025
1627e3f
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Oct 8, 2025
6e426cc
Merge branch 'refs/heads/develop' into 307-create-component---pin-cod…
nouha06 Oct 9, 2025
714a345
fix: separate Pin Code Input from generic Input component in componen…
nouha06 Oct 9, 2025
d1d2069
fix : digit padding changed according to the length of Pin Code input…
nouha06 Oct 10, 2025
3c6909e
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Oct 14, 2025
23a40ec
review : fix PIN code input error handling
nouha06 Oct 15, 2025
c548616
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Oct 16, 2025
c4cae68
fix: update accessibility
nouha06 Oct 16, 2025
ec3ee02
fix: update accessibility for pin code input
nouha06 Oct 17, 2025
b33449f
fix: Pin Code Input behavior and component ordering
nouha06 Oct 23, 2025
8d1b942
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Oct 23, 2025
9ecab5b
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Oct 31, 2025
f1bf73b
review: Ensure component pages are listed in alphabetical order
nouha06 Oct 31, 2025
bafd7a2
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Oct 31, 2025
2f9ccac
review: allow replacing existing digit without deleting first
nouha06 Oct 31, 2025
dda86cd
Merge branch 'develop' into 307-create-component---pin-code-input
Tayebsed93 Nov 5, 2025
3d2858c
Merge branch 'develop' into 307-create-component---pin-code-input
nouha06 Nov 5, 2025
30392b0
Merge remote-tracking branch 'origin/307-create-component---pin-code-…
nouha06 Nov 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/0.5.0...develop)

### Added
- [DemoApp][Library] Create component - `Pin Code Input` ([#307](https://github.com/Orange-OpenSource/ouds-flutter/issues/307))

### Changed

Expand Down
72 changes: 63 additions & 9 deletions app/lib/l10n/gen/ouds_flutter_app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,24 @@ abstract class AppLocalizations {
/// **'Read only'**
String get app_components_common_readOnly_label;

/// No description provided for @app_components_common_placeholder_label.
///
/// In en, this message translates to:
/// **'Placeholder'**
String get app_components_common_placeholder_label;

/// No description provided for @app_components_common_helperText_label.
///
/// In en, this message translates to:
/// **'Helper text'**
String get app_components_common_helperText_label;

/// No description provided for @app_components_common_length_label.
///
/// In en, this message translates to:
/// **'Length'**
String get app_components_common_length_label;

/// No description provided for @app_components_button_label.
///
/// In en, this message translates to:
Expand Down Expand Up @@ -788,23 +806,59 @@ abstract class AppLocalizations {
/// **'Suffix'**
String get app_components_text_input_suffix_label;

/// No description provided for @app_components_text_input_placeholder_label.
/// No description provided for @app_components_text_input_error_label.
///
/// In en, this message translates to:
/// **'Placeholder'**
String get app_components_text_input_placeholder_label;
/// **'This field can’t be empty.'**
String get app_components_text_input_error_label;

/// No description provided for @app_components_text_input_helperText_label.
/// No description provided for @app_components_pin_code_input_label.
///
/// In en, this message translates to:
/// **'Helper text'**
String get app_components_text_input_helperText_label;
/// **'Pin code input'**
String get app_components_pin_code_input_label;

/// No description provided for @app_components_text_input_error_label.
/// No description provided for @app_components_pin_code_input_description_text.
///
/// In en, this message translates to:
/// **'This field can’t be empty.'**
String get app_components_text_input_error_label;
/// **'A PIN code input is a specialized form field used to capture short, fixed-length numeric codes, typically for authentication or confirmation purposes, such as a 4, 6 or 8-digit personal identification number (PIN).'**
String get app_components_pin_code_input_description_text;

/// No description provided for @app_components_pin_code_input_helperText_description_text_4.
///
/// In en, this message translates to:
/// **'Enter the 4-digit code sent to your phone.'**
String get app_components_pin_code_input_helperText_description_text_4;

/// No description provided for @app_components_pin_code_input_helperText_description_text_6.
///
/// In en, this message translates to:
/// **'Enter the 6-digit code sent to your phone.'**
String get app_components_pin_code_input_helperText_description_text_6;

/// No description provided for @app_components_pin_code_input_helperText_description_text_8.
///
/// In en, this message translates to:
/// **'Enter the 8-digit code sent to your phone.'**
String get app_components_pin_code_input_helperText_description_text_8;

/// No description provided for @app_components_pin_code_input_error_label.
///
/// In en, this message translates to:
/// **'Please enter the verification code.'**
String get app_components_pin_code_input_error_label;

/// No description provided for @app_components_pin_code_input_verification_error_label.
///
/// In en, this message translates to:
/// **'Verification failed. Check and enter the correct code.'**
String get app_components_pin_code_input_verification_error_label;

/// No description provided for @app_components_pin_code_input_hidden_password_label.
///
/// In en, this message translates to:
/// **'Hidden Password'**
String get app_components_pin_code_input_hidden_password_label;

/// No description provided for @app_about_name_label.
///
Expand Down
42 changes: 38 additions & 4 deletions app/lib/l10n/gen/ouds_flutter_app_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ class AppLocalizationsAr extends AppLocalizations {
@override
String get app_components_common_readOnly_label => 'اقرأ فقط';

@override
String get app_components_common_placeholder_label => 'العنصر النائب';

@override
String get app_components_common_helperText_label => 'نص مساعد';

@override
String get app_components_common_length_label => 'الطول';

@override
String get app_components_button_label => 'زر';

Expand Down Expand Up @@ -379,14 +388,39 @@ class AppLocalizationsAr extends AppLocalizations {
String get app_components_text_input_suffix_label => 'لاحقة';

@override
String get app_components_text_input_placeholder_label => 'العنصر النائب';
String get app_components_text_input_error_label =>
'لا يمكن أن يكون هذا الحقل فارغًا.';

@override
String get app_components_text_input_helperText_label => 'نص مساعد';
String get app_components_pin_code_input_label => 'إدخال الرقم السري الشخصي';

@override
String get app_components_text_input_error_label =>
'لا يمكن أن يكون هذا الحقل فارغًا.';
String get app_components_pin_code_input_description_text =>
'حقل إدخال الرقم السري الشخصي هو حقل مخصص لإدخال رموز رقمية قصيرة وثابتة الطول، يُستخدم عادةً للمصادقة أو لتأكيد العمليات، مثل الرقم السري الشخصي المكوَّن من 4 أو 6 أو 8 أرقام.';

@override
String get app_components_pin_code_input_helperText_description_text_4 =>
'أدخل الرقم السري المكوَّن من 4 أرقام المُرسَل إلى هاتفك.';

@override
String get app_components_pin_code_input_helperText_description_text_6 =>
'أدخل الرقم السري المكوَّن من 6 أرقام المُرسَل إلى هاتفك.';

@override
String get app_components_pin_code_input_helperText_description_text_8 =>
'أدخل الرقم السري المكوَّن من 8 أرقام المُرسَل إلى هاتفك.';

@override
String get app_components_pin_code_input_error_label =>
'يرجى إدخال رمز التحقق.';

@override
String get app_components_pin_code_input_verification_error_label =>
'فشلت عملية التحقق. يُرجى التحقق وإدخال الرمز الصحيح.';

@override
String get app_components_pin_code_input_hidden_password_label =>
'إخفاء كلمة المرور';

@override
String get app_about_name_label => 'أداة نظام التصميم';
Expand Down
42 changes: 38 additions & 4 deletions app/lib/l10n/gen/ouds_flutter_app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get app_components_common_readOnly_label => 'Read only';

@override
String get app_components_common_placeholder_label => 'Placeholder';

@override
String get app_components_common_helperText_label => 'Helper text';

@override
String get app_components_common_length_label => 'Length';

@override
String get app_components_button_label => 'Button';

Expand Down Expand Up @@ -379,14 +388,39 @@ class AppLocalizationsEn extends AppLocalizations {
String get app_components_text_input_suffix_label => 'Suffix';

@override
String get app_components_text_input_placeholder_label => 'Placeholder';
String get app_components_text_input_error_label =>
'This field can’t be empty.';

@override
String get app_components_text_input_helperText_label => 'Helper text';
String get app_components_pin_code_input_label => 'Pin code input';

@override
String get app_components_text_input_error_label =>
'This field can’t be empty.';
String get app_components_pin_code_input_description_text =>
'A PIN code input is a specialized form field used to capture short, fixed-length numeric codes, typically for authentication or confirmation purposes, such as a 4, 6 or 8-digit personal identification number (PIN).';

@override
String get app_components_pin_code_input_helperText_description_text_4 =>
'Enter the 4-digit code sent to your phone.';

@override
String get app_components_pin_code_input_helperText_description_text_6 =>
'Enter the 6-digit code sent to your phone.';

@override
String get app_components_pin_code_input_helperText_description_text_8 =>
'Enter the 8-digit code sent to your phone.';

@override
String get app_components_pin_code_input_error_label =>
'Please enter the verification code.';

@override
String get app_components_pin_code_input_verification_error_label =>
'Verification failed. Check and enter the correct code.';

@override
String get app_components_pin_code_input_hidden_password_label =>
'Hidden Password';

@override
String get app_about_name_label => 'Design System Toolbox';
Expand Down
15 changes: 13 additions & 2 deletions app/lib/l10n/ouds_flutter_ar.arb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
"app_components_common_icon_a11y": "أيقونة",
"app_components_common_style_label": "نمط",
"app_components_common_readOnly_label": "اقرأ فقط",
"app_components_common_placeholder_label": "العنصر النائب",
"app_components_common_helperText_label": "نص مساعد",
"app_components_common_length_label": "الطول",

"@_components_button": {},
"app_components_button_label": "زر",
Expand Down Expand Up @@ -144,10 +147,18 @@
"app_components_text_input_trailingIcon_label": "عمل زائدة",
"app_components_text_input_prefix_label": "بادئة",
"app_components_text_input_suffix_label": "لاحقة",
"app_components_text_input_placeholder_label": "العنصر النائب",
"app_components_text_input_helperText_label": "نص مساعد",
"app_components_text_input_error_label": "لا يمكن أن يكون هذا الحقل فارغًا.",

"@_components_pin_code_input": {},
"app_components_pin_code_input_label": "إدخال الرقم السري الشخصي",
"app_components_pin_code_input_description_text": "حقل إدخال الرقم السري الشخصي هو حقل مخصص لإدخال رموز رقمية قصيرة وثابتة الطول، يُستخدم عادةً للمصادقة أو لتأكيد العمليات، مثل الرقم السري الشخصي المكوَّن من 4 أو 6 أو 8 أرقام.",
"app_components_pin_code_input_helperText_description_text_4": "أدخل الرقم السري المكوَّن من 4 أرقام المُرسَل إلى هاتفك.",
"app_components_pin_code_input_helperText_description_text_6": "أدخل الرقم السري المكوَّن من 6 أرقام المُرسَل إلى هاتفك.",
"app_components_pin_code_input_helperText_description_text_8": "أدخل الرقم السري المكوَّن من 8 أرقام المُرسَل إلى هاتفك.",
"app_components_pin_code_input_error_label": "يرجى إدخال رمز التحقق.",
"app_components_pin_code_input_verification_error_label": "فشلت عملية التحقق. يُرجى التحقق وإدخال الرمز الصحيح.",
"app_components_pin_code_input_hidden_password_label": "إخفاء كلمة المرور",

"@_about_screen": {},
"app_about_name_label": "أداة نظام التصميم",
"app_about_privacyPolicy_label": "سياسة الخصوصية",
Expand Down
15 changes: 13 additions & 2 deletions app/lib/l10n/ouds_flutter_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"app_components_common_icon_a11y": "Icon",
"app_components_common_style_label": "Style",
"app_components_common_readOnly_label": "Read only",
"app_components_common_placeholder_label": "Placeholder",
"app_components_common_helperText_label": "Helper text",
"app_components_common_length_label": "Length",

"@_components_button": {},
"app_components_button_label": "Button",
Expand Down Expand Up @@ -185,10 +188,18 @@
"app_components_text_input_trailingIcon_label": "Trailing action",
"app_components_text_input_prefix_label": "Prefix",
"app_components_text_input_suffix_label": "Suffix",
"app_components_text_input_placeholder_label": "Placeholder",
"app_components_text_input_helperText_label": "Helper text",
"app_components_text_input_error_label": "This field can’t be empty.",

"@_components_pin_code_input": {},
"app_components_pin_code_input_label": "Pin code input",
"app_components_pin_code_input_description_text": "A PIN code input is a specialized form field used to capture short, fixed-length numeric codes, typically for authentication or confirmation purposes, such as a 4, 6 or 8-digit personal identification number (PIN).",
"app_components_pin_code_input_helperText_description_text_4": "Enter the 4-digit code sent to your phone.",
"app_components_pin_code_input_helperText_description_text_6": "Enter the 6-digit code sent to your phone.",
"app_components_pin_code_input_helperText_description_text_8": "Enter the 8-digit code sent to your phone.",
"app_components_pin_code_input_error_label": "Please enter the verification code.",
"app_components_pin_code_input_verification_error_label": "Verification failed. Check and enter the correct code.",
"app_components_pin_code_input_hidden_password_label": "Hidden Password",

"@_about_screen": {},
"app_about_name_label": "Design System Toolbox",
"app_about_privacyPolicy_label": "Privacy policy",
Expand Down
5 changes: 5 additions & 0 deletions app/lib/ui/components/components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import 'package:ouds_flutter_demo/ui/components/switch/switch_demo_screen.dart';
import 'package:ouds_flutter_demo/ui/components/switch/switch_item_demo_screen.dart';
import 'package:ouds_flutter_demo/ui/components/tag/tag_demo_screen.dart';
import 'package:ouds_flutter_demo/ui/components/tag/tag_input_demo_screen.dart';
import 'package:ouds_flutter_demo/ui/components/text_input/pin_code_input/pin_code_input_demo_screen.dart';
import 'package:ouds_flutter_demo/ui/components/text_input/text_input_demo_screen.dart';
import 'package:ouds_theme_contract/ouds_theme.dart';

Expand Down Expand Up @@ -241,6 +242,10 @@ List<Component> components(BuildContext context) {
context.l10n.app_components_text_input_label,
TextInputDemoScreen(),
),
VariantComponent(
context.l10n.app_components_pin_code_input_label,
PinCodeInputDemoScreen()
)
],
),
];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* // Software Name: OUDS Flutter
* // SPDX-FileCopyrightText: Copyright (c) Orange SA
* // SPDX-License-Identifier: MIT
* //
* // This software is distributed under the MIT license,
* // the text of which is available at https://opensource.org/license/MIT/
* // or see the "LICENSE" file for more details.
* //
* // Software description: Flutter library of reusable graphical components
* //
*/
import 'package:flutter/material.dart';
import 'package:ouds_flutter_demo/l10n/app_localizations.dart';
import 'package:ouds_flutter_demo/ui/components/text_input/pin_code_input/pin_code_input_enum.dart';
import 'package:ouds_flutter_demo/ui/components/text_input/text_input_customization.dart';
import 'package:ouds_flutter_demo/ui/components/text_input/text_input_customization_utils.dart';

class PinCodeInputCodeGenerator {
static String updateCode(BuildContext context) {
final TextInputCustomizationState? state = TextInputCustomization.of(context);

if (state == null) return "OudsPinCodeInput(),";

List<String> lines = [];

lines.add(" controllers: controllers,");

if (state.hasHelperText && !state.hasError) {
lines.add(
' helperText: "${TextInputCustomizationUtils.getPinCodeHelperText(state, PinCodeLengthEnum.getHelperText(context, state.selectedPinCodeLength))}",');
}

if (state.hasError) {
lines.add(" isError: ${state.hasError},");
lines.add(' errorText: "${TextInputCustomizationUtils.getPinCodeErrorText(state,context.l10n.app_components_pin_code_input_error_label)}",');
}

final length = TextInputCustomizationUtils.getLength(state.selectedPinCodeLength);
lines.add(' length: $length,');

lines.add(' onCompleted: (value) {\n //handle completed pin code\n},');
lines.add(' onError: (isError) {\n // handle error state\n},');

final String decoration = _digitDecorationCode(state);

return [
"OudsPinCodeInput(",
...lines,
decoration,
"),"
].join("\n");
}

static String _digitDecorationCode(TextInputCustomizationState state) {
List<String> props = [];

if (state.pinCodePlaceholderText.isNotEmpty) {
final hint = TextInputCustomizationUtils.getPinCodePlaceholderText(state);
props.add(' hintText: "$hint",');
}

if (state.hasRoundedCorner) {
props.add(' roundedCorner: ${state.hasRoundedCorner},');
}

if (state.hasHiddenPassword) {
props.add(' hiddenPassword: ${state.hasHiddenPassword},');
}

final style = TextInputCustomizationUtils.getStyle(state.selectedStyle);
props.add(' style: $style,');

if (props.isEmpty) {
return "digitInputDecoration: OudsDigitInputDecoration(),";
}

return "digitInputDecoration: OudsDigitInputDecoration(\n${props.join("\n")}\n),";
}
}
Loading
Loading