overrideLocalizations method

Widget overrideLocalizations({
  1. required BuildContext context,
  2. required Widget child,
})

在@override#build中调用

Implementation

Widget overrideLocalizations({required BuildContext context, required Widget child}) {
  return SafeArea(
    child: PopScope(
      child: Scaffold(
        backgroundColor: backgroundColor,
        appBar: onActionBar(),
        resizeToAvoidBottomInset: resizeToAvoidBottomInset,
        body: Localizations.override(
          context: context,
          locale: _locale,
          child: GestureDetector(
            child: child,
            onTap: () => SoftUtils.hideSoft(context),
          ),
        ),
      ),
      onPopInvoked: (bool didPop) {
        onBackClick(didPop);
      },
      canPop: canPopScope,
    ),
    top: topSafeArea,
    bottom: bottomSafeArea,
  );
}