

import 'package:flutter/material.dart';
import 'package:flutter_wisetronic/models/product.dart';

typedef void OnOptionTapped(String name, int quantity, double adjustAmount);

abstract class OptionsBase extends StatefulWidget {
  final Product product;
  final int index;
  final Map<String, dynamic> selections;
  OptionsBase({@required Product product, @required int index, @required Map<String, dynamic> selections})
    : product = product,
      index = index,
      selections = selections;
}

abstract class OptionsBaseState<Base extends OptionsBase> extends State<Base> {
  Product product;
  Map<String, dynamic> selections;
  int index;

  final Color disabledBackgroundColor = new Color(0xFFBCBCBC);

  final Color deselectBackgroundColor = new Color(0x00000000);
  final Color deselectTextColor = new Color(0xFF333333);
  final Color deselectBorderColor = new Color(0xFF888888);

  final Color selectedBackgroundColor = new Color(0xFFFF8908);
  final Color selectedTextColor = new Color(0xFFFFFFFF);
  final Color selectedBorderColor = new Color(0xFF444444);

  @override
  void setState(VoidCallback fn) {
    if(mounted) {
      super.setState(fn);
    }
  }
}