mirrored_repositories/last_eartqueke_and_gobag_flutter/lib
import 'package:flutter/material.dart';

class GenericAppbar extends StatelessWidget {
  final String appBarTitle;
  final List<Widget> actions;
  final bool backButton;
  const GenericAppbar(
      {Key key, this.appBarTitle, this.actions, this.backButton = false})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 75,
      decoration: BoxDecoration(
          color: Theme.of(context).primaryColor,
          borderRadius: BorderRadius.only(
              bottomLeft: Radius.circular(15),
              bottomRight: Radius.circular(15))),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        children: <Widget>[
          if (backButton)
            IconButton(
              color: Colors.white,
              icon: Icon(Icons.arrow_back_ios),
              onPressed: () {
                Navigator.of(context).pop();
              },
            ),
          Padding(
            padding: EdgeInsets.only(left: 25),
            child: Text(
              appBarTitle,
              style: TextStyle(
                color: Colors.white,
                fontSize: 24,
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
          if (actions != null)
            Expanded(
              child: Padding(
                padding: const EdgeInsets.symmetric(horizontal: 8),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.end,
                  children: actions,
                ),
              ),
            )
        ],
      ),
    );
  }
}
