CW-636-1-Unfocus text fields when push to next one (#1460)

* unfocus text fields when push to next one

* unfocus when push to next from new wallet / restore pages[skip ci]]
This commit is contained in:
Serhii
2024-05-31 17:57:40 +03:00
committed by GitHub
parent 43a4477b39
commit 287c2d8b60
10 changed files with 90 additions and 24 deletions
+24 -9
View File
@@ -1,4 +1,5 @@
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/utils/route_aware.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/di.dart';
@@ -32,6 +33,14 @@ abstract class BasePage extends StatelessWidget {
Widget? get endDrawer => null;
Function(BuildContext context)? get pushToWidget => null;
Function(BuildContext context)? get pushToNextWidget => null;
Function(BuildContext context)? get popWidget => null;
Function(BuildContext context)? get popNextWidget => null;
AppBarStyle get appBarStyle => AppBarStyle.regular;
Widget Function(BuildContext, Widget)? get rootWrapper => null;
@@ -162,15 +171,21 @@ abstract class BasePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final root = Scaffold(
key: _scaffoldKey,
backgroundColor: pageBackgroundColor(context),
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
extendBodyBehindAppBar: extendBodyBehindAppBar,
endDrawer: endDrawer,
appBar: appBar(context),
body: body(context),
floatingActionButton: floatingActionButton(context));
final root = RouteAwareWidget(
child: Scaffold(
key: _scaffoldKey,
backgroundColor: pageBackgroundColor(context),
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
extendBodyBehindAppBar: extendBodyBehindAppBar,
endDrawer: endDrawer,
appBar: appBar(context),
body: body(context),
floatingActionButton: floatingActionButton(context)),
pushToWidget: (context) => pushToWidget?.call(context),
pushToNextWidget: (context) => pushToNextWidget?.call(context),
popWidget: (context) => popWidget?.call(context),
popNextWidget: (context) => popNextWidget?.call(context),
);
return rootWrapper?.call(context, root) ?? root;
}