edit method

  1. @override
Future<void> edit({
  1. required BuildContext context,
  2. required Product product,
  3. bool isLoggedInMandatory = true,
})
override

Opens a page to edit that field for that product.

Implementation

@override
Future<void> edit({
  required BuildContext context,
  required Product product,
  bool isLoggedInMandatory = true,
}) async {
  if (!await ProductRefresher().checkIfLoggedIn(
    context,
    isLoggedInMandatory: isLoggedInMandatory,
  )) {
    return;
  }

  AnalyticsHelper.trackProductEdit(
    AnalyticsEditEvents.packagingComponents,
    product,
  );

  if (!context.mounted) {
    return;
  }
  await Navigator.push<void>(
    context,
    MaterialPageRoute<void>(
      builder: (BuildContext context) => EditNewPackagings(
        product: product,
        isLoggedInMandatory: isLoggedInMandatory,
      ),
    ),
  );
}