import 'package:flutter/material.dart';
import 'package:get/get.dart';

class WxScaffold extends StatelessWidget {
  final Widget body;
  final String title;
  final String? parentRoute;
  const WxScaffold({
    Key? key,
    required this.body,
    required this.title,
    this.parentRoute,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: InkWell(
          child: Center(
            child: Icon(
              Icons.arrow_back_ios,
              color: Color.fromARGB(255, 77, 77, 77),
            ),
          ),
          onTap: () {
            // if (parentRoute == null) {
            //   Get.back();
            //   return;
            // }
            // Get.offNamed(parentRoute!);
            Get.back();
          },
        ),
        title: Text(title),
        backgroundColor: Color.fromARGB(255, 247, 247, 247),
        foregroundColor: Color.fromARGB(255, 77, 77, 77),
        elevation: 0,
      ),
      body: SafeArea(child: body),
    );
  }
}
