import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/search_products_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';

import '../../../offers_categorise_page.dart';
import 'GridViewCard.dart';

class GridViewButtons extends StatelessWidget {
  final PharmacyModuleViewModel model;

  GridViewButtons(this.model);

  @override
  Widget build(BuildContext context) {
    final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8;
    return Container(
      child: SizedBox(
        height: gridHeight,
        child: GridView.count(
          childAspectRatio: 2.2,
          crossAxisSpacing: 10,
          mainAxisSpacing: 10,
          controller: new ScrollController(keepScrollOffset: false),
          shrinkWrap: true,
          padding: const EdgeInsets.all(4.0),
          crossAxisCount: 2,
          children: [
            DashboardItem(
              imageName: 'pharmacy_module/bg_1.png',
              hasColorFilter: false,
              opacity: 0.8,
              child: GridViewCard(
                  TranslationBase.of(context).offersAndPromotions,
                  'assets/images/pharmacy_module/offer_icon.png', () {
                Navigator.push(context, FadePage(page: OffersCategorisePage()));
              }),
            ),
            // DashboardItem(
            //   imageName: 'pharmacy_module/bg_2.png',
            //   opacity: 0,
            //   hasColorFilter: false,
            //   child: GridViewCard(TranslationBase.of(context).medicationRefill,
            //       'assets/images/pharmacy_module/medication_icon.png', () {
            //         Navigator.push(
            //             context, FadePage(page: HomePrescriptionsPage()));
            //
            //         // model.checkUserIsActivated().then((isActivated) {
            //         //   if (isActivated) {
            //         //     Navigator.push(context, FadePage(page: LakumMainPage()));
            //         //   } else {
            //         //     Navigator.push(
            //         //         context, FadePage(page: LakumActivationVidaPage()));
            //         //   }
            //         // });
            //       }),
            // ),
            // DashboardItem(
            //   imageName: 'pharmacy_module/bg_3.png',
            //   opacity: 0,
            //   hasColorFilter: false,
            //   child: GridViewCard(TranslationBase.of(context).myPrescriptions,
            //       'assets/images/pharmacy_module/prescription_icon.png', () {
            //         Navigator.push(
            //             context, FadePage(page: HomePrescriptionsPage()));
            //       }),
            // ),
            // DashboardItem(
            //   imageName: 'pharmacy_module/bg_4.png',
            //   opacity: 0,
            //   hasColorFilter: false,
            //   child: GridViewCard(
            //       TranslationBase.of(context).searchAndScanMedication,
            //       'assets/images/pharmacy_module/search_scan_icon.png',
            //           () {Navigator.push(context, FadePage(page: SearchProductsPage()));}),
            // ),
          ],
        ),
      ),
    );
  }
}