Automated null-safety fixes driven by dart analyze (no corruption): - unchecked_use_of_nullable_value: insert '!' on receiver (property/method/[]/op) - not_initialized field/var: mark 'late' - missing_default_value_for_parameter: nullable param Errors: 2374(peak) -> 907
39 lines
1.2 KiB
Dart
39 lines
1.2 KiB
Dart
|
|
|
|
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> {
|
|
late Product product;
|
|
late Map<String, dynamic> selections;
|
|
late 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);
|
|
}
|
|
}
|
|
} |