import 'package:flutter/material.dart';
import 'package:gz_video_player/video_loading_style.dart';

class VideoLoadingView extends StatelessWidget {
  const VideoLoadingView({super.key, required this.loadingStyle});

  final VideoLoadingStyle loadingStyle;

  @override
  Widget build(BuildContext context) {
    return Align(
      alignment: Alignment.center,
      child: Center(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            loadingStyle.customLoadingIcon,
            loadingStyle.customLoadingText != null
                ? loadingStyle.customLoadingText!
                : Container(
              margin: const EdgeInsets.only(top: 10),
              child: Text(
                loadingStyle.loadingText,
                style: TextStyle(
                  color: loadingStyle.loadingTextFontColor,
                  fontSize: loadingStyle.loadingTextFontSize,
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
