mirrored_repositories/WordPlay/lib
// ignore_for_file: must_be_immutable

import 'package:news/theme/app_theme.dart';
import 'package:news/util/_string.dart';
import 'package:news/util/constants.dart';
import 'package:news/widgets/custom_text.dart';
import 'package:flutter/material.dart';

class CustomAppBar extends StatefulWidget {
  String title;
  double space;
  void Function()? onTap;
  double leftPadding;
  double rightPadding;
  double topPadding;
  double bottomPadding;

  CustomAppBar(
      {required this.title,
      required this.space,
      this.onTap,
      this.leftPadding = Constant.zero,
      this.bottomPadding = Constant.zero,
      this.rightPadding = Constant.zero,
      this.topPadding = Constant.zero});

  @override
  State<CustomAppBar> createState() => _CustomAppBarState();
}

class _CustomAppBarState extends State<CustomAppBar> {
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.only(
          left: widget.leftPadding,
          right: widget.rightPadding,
          top: widget.topPadding,
          bottom: widget.bottomPadding),
      child: InkWell(
        splashColor: AppTheme.colorTransprant,
        highlightColor: AppTheme.colorTransprant,
        onTap: widget.onTap,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            CustomText(
              title: widget.title,
              fontWight: FontWeight.bold,
              fontfamily: Strings.emptyString,
              fontSize: Constant.appbarTitleSize,
            )
          ],
        ),
      ),
    );
  }
}
