import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

// ignore: must_be_immutable
class TreeviewParentWidget extends StatelessWidget {
  final String text;
  final Color backgroundColor;
  final Color? color;
  final double? fontSize;
  Icon? icon;
  //final DateTime lastModified;

  TreeviewParentWidget({
    required this.text,
    this.backgroundColor = Colors.white38,
    this.color,
    this.fontSize = 24,
    this.icon,
  }) {
    if (icon == null) {
      icon = Icon(Icons.person);
    }
  }

  @override
  Widget build(BuildContext context) {
    Widget parentWidget = Text(
      this.text,
      style: GoogleFonts.archivoBlack(fontSize: fontSize, color: color ?? Colors.blue[800]!, backgroundColor: Colors.transparent),
    );

    return Card(
      color: backgroundColor,
      shadowColor: Colors.black54,
      elevation: 0.0,
      child: ListTile(
        leading: icon,
        title: parentWidget,
        //subtitle: lastModifiedWidget,
      ),
    );
  }
}