import 'package:aitrainer_app/bloc/timer/timer_bloc.dart';
import 'package:aitrainer_app/library/clock.dart';
import 'package:flutter/material.dart';

class TimerWidget extends StatelessWidget {
  final TimerBloc bloc;
  const TimerWidget({required this.bloc});

  @override
  Widget build(BuildContext context) {
    return Positioned(
        left: MediaQuery.of(context).size.width - 95,
        top: 28,
        child: Stack(alignment: AlignmentDirectional.topEnd, children: [
          digitalClock(),
        ]));
  }

  Widget digitalClock() {
    return ClipRRect(
        borderRadius: BorderRadius.circular(45.0),
        child: Container(
            width: 90,
            height: 90,
            color: Colors.transparent,
            child: Overlay(initialEntries: <OverlayEntry>[
              OverlayEntry(
                  opaque: true,
                  builder: (BuildContext context) {
                    return Container(color: Colors.transparent, child: Clock(bloc: bloc));
                  })
            ])));
  }
}
