mirrored_repositories/flutter_movie/lib/features/movie/presentation/ui
import 'package:flutter/material.dart';
import 'package:flutter_movie/features/movie/domain/entities/movie_details_entity.dart';

import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter_movie/core/utils/apis.utils.dart';

class DetailsPage extends StatelessWidget {
  final MovieDetailsEntity movie;
  const DetailsPage({Key? key, required this.movie}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(movie.title),
      ),
      body: SingleChildScrollView(
        child: Padding(
          padding: const EdgeInsets.all(24),
          child: Column(
            children: [
              SizedBox(
                height: MediaQuery.of(context).size.height * .55,
                width: MediaQuery.of(context).size.width,
                child: Hero(
                  tag: movie.id,
                  child: CachedNetworkImage(
                    progressIndicatorBuilder: (context, url, progress) =>
                        CircularProgressIndicator.adaptive(),
                    imageUrl: API.REQUEST_IMG(movie.posterPath),
                  ),
                ),
              ),
              SizedBox(height: 20),
              Text(
                movie.overview,
                style: Theme.of(context).textTheme.subtitle1,
              ),
              SizedBox(height: 20),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Icon(Icons.title),
                  Text(movie.originalTitle),
                ],
              ),
              SizedBox(height: 8),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Icon(Icons.new_releases),
                  Text(movie.releaseDate),
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}
