import 'dart:io';

import 'package:eitc_erm_dental_flutter/exts.dart';
import 'package:eitc_erm_dental_flutter/funcs.dart';
import 'package:flutter/material.dart';

///历史查看页面标题栏
class HistoryViewTitle extends StatelessWidget {
  final String? name;
  final String? area;

  const HistoryViewTitle({super.key, this.name, this.area});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Row(
          children: [
            IconButton(
              onPressed: () => Navigator.pop(context),
              icon: Icon(Platform.isAndroid
                  ? Icons.arrow_back
                  : Icons.arrow_back_ios_new),
              color: Colors.white,
            ),
            Text(
              name ?? "",
              style: context.titleMedium?.copyWith(color: Colors.white),
            ),
          ],
        ),
        Visibility(
            visible: area != null,
            child: Text(
              toothAreaTranslate(area ?? ""),
              style: context.titleLarge?.copyWith(color: Colors.white),
            ))
      ],
    );
  }
}
