editButton method

Widget editButton({
  1. BuildContext? context,
})

Implementation

Widget editButton({BuildContext? context}) => IconButton(
      // padding: EdgeInsets.zero,
      icon: Icon(Icons.edit),
      onPressed: () {
        (context == null)
            ? Text("data")
            : showDialog(
                context: context,
                barrierDismissible: true,
                builder: (BuildContext innerContext) {
                  return Scaffold(
                      body: Align(
                    alignment: Alignment.bottomCenter,
                    child: CheckPointDefectsModel.adder(
                        // withoutdefect: false,
                        parent: Provider.of<CheckPointDefectsModel>(context)
                            .currentData,
                        currentDefect: this,
                        onCancel: () => Navigator.of(context).pop(),
                        onDone: (data) {
                          Provider.of<CheckPointDefectsModel>(context,
                                  listen: false)
                              .update(data);
                          // Navigator.of(context).pop();
                        }),
                  ));
                });
      },
    );