import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:pharmacy_mobile/widgets/text_widget.dart';

class DropdownWrapperMultiWidget extends StatelessWidget {
  final List list;
  final String text;
  final List<Widget> children;

  const DropdownWrapperMultiWidget({
    super.key,
    required this.list,
    required this.text,
    required this.children,
  });

  @override
  Widget build(BuildContext context) {
    return (list.isEmpty)
        ? Column(
            children: [
              Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  const CircularProgressIndicator(color: Color.fromRGBO(255, 255, 255, 1)),
                  const Gap(16),
                  TextWidget(
                    text: 'Fetching $text',
                    size: 14,
                  )
                ],
              ),
            ],
          )
        : Column(
            children: children,
          );
  }
}
