
import 'package:flutter/material.dart';
import '../../generated/l10n.dart';
import '../../utils/double_back_to_close_app.dart';

class DoubleBackToCloseAppWrapper extends StatelessWidget {
  final Widget child;

  const DoubleBackToCloseAppWrapper({Key? key, required this.child}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return DoubleBackToCloseApp(
      snackBar: SnackBar(
        content: Container(
          alignment: Alignment.center,
          height: 24.0,
          child: Text(
            S.of(context).tap_back_again_to_exit,
          ),
        ),
      ),
      child: child,
    );
  }
}