appBarExpandTitle function

AppBar appBarExpandTitle(
  1. BuildContext context, {
  2. required String title,
  3. required String subTitle,
  4. bool showBack = true,
  5. Widget? action,
  6. Color? colorBackground,
  7. Color? colorText,
})

Implementation

AppBar appBarExpandTitle(BuildContext context,
    {required String title,
    required String subTitle,
    bool showBack = true,
    Widget? action,
    Color? colorBackground,
    Color? colorText}) {
  return AppBar(
    backgroundColor: colorBackground ?? Colors.white,
    centerTitle: Platform.isIOS,
    leading: showBack
        ? BackButton(
            color: titleTextColor,
          )
        : Container(),
    title: Column(
      crossAxisAlignment: Platform.isAndroid
          ? CrossAxisAlignment.start
          : CrossAxisAlignment.center,
      children: [
        Text(title).semiBold16(color: colorText ?? titleTextColor),
        Text(subTitle).regularContext12(color: colorText ?? subTitleTextColor),
      ],
    ),
    actions: [action != null ? action : Container()],
    brightness: Brightness.light,
  );
}