mirrored_repositories/Portfolio/lib
import 'dart:html';

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

class AnimatedCounter extends StatelessWidget {
  const AnimatedCounter({ Key? key, required this.value, this.text }) : super(key: key);

  final int value;
  final String? text;

  @override
  Widget build(BuildContext context) {
    return TweenAnimationBuilder(
      tween: IntTween(begin: 0, end: value),
      duration: defaultDuration,
      builder: (context, value, child) => Text(
        "$value$text",
        style: Theme.of(context)
          .textTheme
          .headline6!
          .copyWith(color: primaryColor),
      ),
    );
  }
}