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

class FileNameDown extends StatelessWidget {
  final String name;
  final String image;
  final String date;

  const FileNameDown({
    Key? key,
    required this.name,
    required this.image,
    required this.date
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.all(4.0),
      padding: const EdgeInsets.all(4.0),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(2.0),
        boxShadow: const [
          BoxShadow(
            color: Colors.black12,
            spreadRadius: 1.0,
            blurRadius: 2.0,
            offset: Offset(0, 0),
          ),
        ],
      ),
      child: Column(
        children: [
          Container(
            margin: const EdgeInsets.all(4.0),
            child: Text(
              name,
              textAlign: TextAlign.center,
              style: GoogleFonts.roboto(
                fontWeight: FontWeight.bold,
                fontSize: 14.0,
              ),
            ),
          ),
          Expanded(
            child: FadeInImage(
              image: NetworkImage(image),
              placeholder: const AssetImage('assets/loading.gif'),
              fadeInDuration: const Duration(milliseconds: 250),
              fit: BoxFit.fill,
            ),
          ),
          const SizedBox(height: 4.0),
          Text(
            date,
            style: GoogleFonts.roboto(
              color: const Color.fromRGBO(87, 87, 87, 1),
              fontSize: 12.0,
            ),
          )
        ],
      ),
    );
  }
}
