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

class FileNameUp extends StatelessWidget {
  final String name;
  final String image;

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

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 94.0,
      margin: const EdgeInsets.symmetric(
        vertical: 8.0,
        horizontal: 16.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,
              maxLines: 2,
              textAlign: TextAlign.center,
              style: GoogleFonts.roboto(
                fontWeight: FontWeight.bold,
                fontSize: 12.0,
                color: const Color.fromRGBO(87, 87, 87, 1),
              ),
            ),
          ),
          Expanded(
            child: FadeInImage(
              image: NetworkImage(image),
              placeholder: const AssetImage('assets/loading.gif'),
              fadeInDuration: const Duration(milliseconds: 250),
              fit: BoxFit.fill,
              width: 94.0,
            ),
          )
        ],
      ),
    );
  }
}
