import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/tab_utils.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class TabWidget {
  static Widget tabWidget(
    Size screenSize,
    bool isActive,
    String title, {
    int counter = -1,
    bool isFirst = false,
    bool isMiddle = false,
    bool isLast = false,
    context,
  }) {
    ProjectViewModel projectViewModel = Provider.of(context);
    return Center(
      child: Container(
        height: TabUtils.getTabHeight(context),
        decoration: TabUtils.getBoxTabsBoxDecoration(
            isActive: isActive,
            isFirst: isFirst,
            isMiddle: isMiddle,
            isLast: isLast,
            projectViewModel: projectViewModel),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            TabUtils.getTabText(title: title, isActive: isActive),
            if (counter != -1)
              TabUtils.getTabCounter(isActive: isActive, counter: counter)
          ],
        ),
      ),
    );
  }
}
