// ignore_for_file: public_member_api_docs, sort_constructors_first
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';

import 'package:qadirneyriz/config/config.dart';

class LoadingWidget extends StatelessWidget {
  final Color? color;
  final double size;
  final double strokeWidth;
  final bool? isSmall;

  const LoadingWidget({
    super.key,
    this.color,
    this.size = 20.0,
    this.strokeWidth = 2.0,
    this.isSmall = false,
  });

  @override
  Widget build(BuildContext context) {
    return Center(
      child: SpinKitCubeGrid(
        size: size,
        itemBuilder: (BuildContext context, int index) {
          return DecoratedBox(
            decoration: BoxDecoration(
              borderRadius: const BorderRadius.all(Radius.circular(20)),
              color: color ?? config.ui.mainGreen,
            ),
          );
        },
      ),
    );
  }
}
