# createDialog function

dynamic createDialog()

Create Dialog

## Implementation

    createDialog() {
      WSLApi api = WSLApi();
      final autoSuggestBox = TextEditingController();
      final locationController = TextEditingController();
      final nameController = TextEditingController();
      final userController = TextEditingController();
      plausible.event(page: 'create');

      // Get root context by Key
      final context = GlobalVariable.infobox.currentContext!;

      showDialog(
        useRootNavigator: false,
        context: context,
        builder: (context) {
          return ContentDialog(
            constraints: const BoxConstraints(maxHeight: 500.0, maxWidth: 450.0),
            title: Text('createnewinstance-text'.i18n()),
            content: SingleChildScrollView(
              child: CreateWidget(
                nameController: nameController,
                api: api,
                autoSuggestBox: autoSuggestBox,
                locationController: locationController,
                userController: userController,
              ),
            ),
            actions: [
              Button(
                  child: Text('cancel-text'.i18n()),
                  onPressed: () async {
                    Navigator.pop(context);
                  }),
              Button(
                onPressed: () async {
                  // Run "runner" function from global key
                  GlobalVariable.root.currentState!.runner(
                    createInstance(
                      nameController,
                      locationController,
                      api,
                      autoSuggestBox,
                      userController,
                    ),
                  );
                },
                child: Text('create-text'.i18n()),
              ),
            ],
          );
        },
      );
    }