-
Notifications
You must be signed in to change notification settings - Fork 87
TF-3455 Add applicative token login method #3527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tddang-linagora
wants to merge
6
commits into
master
Choose a base branch
from
feature/TF-3455-authenticative-token-login
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
21f4330
TF-3455 Add applicative token login method
tddang-linagora af47e92
fixup! TF-3455 Add applicative token login method
tddang-linagora b084104
fixup! TF-3455 Add applicative token login method
tddang-linagora f609d8b
fixup! TF-3455 Add applicative token login method
tddang-linagora 189b111
fixup! TF-3455 Add applicative token login method
tddang-linagora 6e36f7f
fixup! TF-3455 Add applicative token login method
tddang-linagora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
lib/features/login/presentation/widgets/applicative_token_field.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import 'package:core/presentation/resources/image_paths.dart'; | ||
import 'package:core/presentation/views/text/text_field_builder.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
import 'package:tmail_ui_user/features/base/widget/text_input_decoration_builder.dart'; | ||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart'; | ||
|
||
class ApplicativeTokenField extends StatefulWidget { | ||
final ValueChanged<String> onChanged; | ||
final AppLocalizations appLocalizations; | ||
final ImagePaths? imagePath; | ||
|
||
const ApplicativeTokenField({ | ||
Key? key, | ||
required this.onChanged, | ||
required this.appLocalizations, | ||
this.imagePath, | ||
}) : super(key: key); | ||
|
||
@override | ||
State<ApplicativeTokenField> createState() => _ApplicativeTokenFieldState(); | ||
} | ||
|
||
class _ApplicativeTokenFieldState extends State<ApplicativeTokenField> with SingleTickerProviderStateMixin { | ||
final controller = TextEditingController(); | ||
final focusNode = FocusNode(); | ||
late final AnimationController rotationController; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
rotationController = AnimationController( | ||
duration: const Duration(milliseconds: 200), | ||
vsync: this, | ||
); | ||
} | ||
|
||
@override | ||
void dispose() { | ||
controller.dispose(); | ||
focusNode.dispose(); | ||
rotationController.dispose(); | ||
super.dispose(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ExpansionTile( | ||
title: Text(widget.appLocalizations.advancedSettings), | ||
controlAffinity: ListTileControlAffinity.leading, | ||
leading: widget.imagePath == null | ||
? null | ||
: RotationTransition( | ||
turns: Tween(begin: 0.0, end: 0.5).animate(rotationController), | ||
child: SvgPicture.asset( | ||
widget.imagePath!.icArrowDown, | ||
width: 24, | ||
height: 24, | ||
fit: BoxFit.fill, | ||
), | ||
), | ||
shape: const Border(), | ||
tilePadding: const EdgeInsets.symmetric(horizontal: 32), | ||
childrenPadding: const EdgeInsets.symmetric(horizontal: 32), | ||
onExpansionChanged: (isExpanded) { | ||
if (isExpanded) { | ||
rotationController.forward(); | ||
} else { | ||
rotationController.reverse(); | ||
} | ||
}, | ||
children: [ | ||
Row( | ||
children: [ | ||
Text( | ||
widget.appLocalizations.applicativeToken, | ||
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16), | ||
), | ||
const SizedBox(width: 8), | ||
Expanded( | ||
child: TextFieldBuilder( | ||
controller: controller, | ||
focusNode: focusNode, | ||
autoFocus: true, | ||
onTextChange: widget.onChanged, | ||
maxLines: 1, | ||
decoration: TextInputDecorationBuilder().build(), | ||
), | ||
), | ||
], | ||
), | ||
Text(widget.appLocalizations.someJMAPServicesDoNotSupportLoginViaPassword), | ||
], | ||
); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be careful if the text is too long (multiple language) the token input field will be too small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expanded added