different between function above widget state and below

Viewed 23

so one of my company developer write this code and i try to understand it why he put it above not below because i usually put all my function below widget state, is there any different by putting function above or below in stateful widget ?

MasterAppointmentCreatePage(
    this.data, {
    Key key,
  }) : super(key: key);
  final dynamic data;
  void showModal({
    double elevation = 1,
    BuildContext context,
    Widget modalContent,
    bool isDismissable = true,
  }) {
    showModalBottomSheet(
        elevation: elevation,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.vertical(top: Radius.circular(25.0)),
        ),
        isScrollControlled: isDismissable,
        context: context,
        isDismissible: false,
        builder: (context) {
          return Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              modalContent,
            ],
          );
        });
  }

enter image description here

0 Answers
Related