We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi everyone,
technically not an issue. But for usability, it helps to hide the keyboard, when loosing focus.
Here is the code snippet. Also RPUIChoiceQuestionBody requires a change (on selecting non-freetext options).
RPUITask.dart ` @OverRide Widget build(BuildContext context) { RPLocalizations? locale = RPLocalizations.of(context);
return WillPopScope( onWillPop: () => blocTask.sendStatus(RPStepStatus.Canceled), child: Scaffold( backgroundColor: Theme.of(context).backgroundColor, resizeToAvoidBottomInset: true,
// ***************************** // (1/2) added GestureDetector to remove keyboard on click body: new GestureDetector( onTap: () { FocusScope.of(context).requestFocus(new FocusNode()); }, child: SafeArea( // ***************************** child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ // top bar _carouselBar(), // Body Expanded( child: PageView.builder( itemBuilder: (BuildContext context, int position) { return _activeSteps[position].stepWidget; }, itemCount: _activeSteps.length, controller: _taskPageViewController, physics: NeverScrollableScrollPhysics(), ), ), // Bottom navigation if (![ RPCompletionStep, RPVisualConsentStep, RPConsentReviewStep ].contains(_currentStep.runtimeType)) Padding( padding: EdgeInsets.only(left: 15, right: 15, bottom: 10), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ // if first question or its a navigable task _currentStepIndex == 0 || navigableTask ? Container() : OutlinedButton( onPressed: () => blocTask.sendStatus(RPStepStatus.Back), child: Text( locale?.translate('BACK') ?? 'BACK', // style: TextStyle( // color: Theme.of(context).primaryColor), ), ), StreamBuilder( stream: blocQuestion.questionReadyToProceed, builder: (context, snapshot) { if (snapshot.hasData) { return ElevatedButton( child: Text( RPLocalizations.of(context) ?.translate('NEXT') ?? "NEXT", style: Theme.of(context) .accentTextTheme .button, ), onPressed: snapshot.data! ? () { // ***************************** // (2/2) added GestureDetector to remove keyboard on proceed FocusScope.of(context).unfocus(); // ***************************** blocTask.sendStatus( RPStepStatus.Finished); } : null, ); } else { return Container(); } }, ), ], ), ), ], ), ), )), ); }`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi everyone,
technically not an issue. But for usability, it helps to hide the keyboard, when loosing focus.
Here is the code snippet. Also RPUIChoiceQuestionBody requires a change (on selecting non-freetext options).
RPUITask.dart
`
@OverRide
Widget build(BuildContext context) {
RPLocalizations? locale = RPLocalizations.of(context);
// *****************************
// (1/2) added GestureDetector to remove keyboard on click
body: new GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(new FocusNode());
},
child: SafeArea(
// *****************************
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// top bar
_carouselBar(),
// Body
Expanded(
child: PageView.builder(
itemBuilder: (BuildContext context, int position) {
return _activeSteps[position].stepWidget;
},
itemCount: _activeSteps.length,
controller: _taskPageViewController,
physics: NeverScrollableScrollPhysics(),
),
),
// Bottom navigation
if (![
RPCompletionStep,
RPVisualConsentStep,
RPConsentReviewStep
].contains(_currentStep.runtimeType))
Padding(
padding: EdgeInsets.only(left: 15, right: 15, bottom: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// if first question or its a navigable task
_currentStepIndex == 0 || navigableTask
? Container()
: OutlinedButton(
onPressed: () =>
blocTask.sendStatus(RPStepStatus.Back),
child: Text(
locale?.translate('BACK') ?? 'BACK',
// style: TextStyle(
// color: Theme.of(context).primaryColor),
),
),
StreamBuilder(
stream: blocQuestion.questionReadyToProceed,
builder: (context, snapshot) {
if (snapshot.hasData) {
return ElevatedButton(
child: Text(
RPLocalizations.of(context)
?.translate('NEXT') ??
"NEXT",
style: Theme.of(context)
.accentTextTheme
.button,
),
onPressed: snapshot.data!
? () {
// *****************************
// (2/2) added GestureDetector to remove keyboard on proceed
FocusScope.of(context).unfocus();
// *****************************
blocTask.sendStatus(
RPStepStatus.Finished);
}
: null,
);
} else {
return Container();
}
},
),
],
),
),
],
),
),
)),
);
}`
The text was updated successfully, but these errors were encountered: