# settingsDialog function

dynamic settingsDialog(

1. dynamic item

)

Rename Dialog @param context: context @param item: distro name

## Implementation

    settingsDialog(item) {
      // Get root context by Key
      final context = GlobalVariable.infobox.currentContext!;

      var title = 'settings-text'.i18n();
      final pathController = TextEditingController();
      pathController.text = prefs.getString('StartPath_$item') ?? '';
      final startCmdController = TextEditingController();
      startCmdController.text = prefs.getString('StartCmd_$item') ?? '';
      final userController = TextEditingController();
      userController.text = prefs.getString('StartUser_$item') ?? '';
      plausible.event(page: 'settings_dialog');
      bool isSyncing = false;

      showDialog(
        context: context,
        builder: (childcontext) {
          return ContentDialog(
            constraints: const BoxConstraints(maxHeight: 500.0, maxWidth: 500.0),
            title: Text(title),
            content: StatefulBuilder(builder: (BuildContext context, setState) {
              return SingleChildScrollView(
                child: settingsColumn(pathController, startCmdController,
                    userController, context, item, isSyncing, setState),
              );
            }),
            actions: [
              Button(
                  child: Text('cancel-text'.i18n()),
                  onPressed: () {
                    Navigator.pop(childcontext);
                  }),
              Button(
                  child: Text('save-text'.i18n()),
                  onPressed: () {
                    prefs.setString('StartPath_$item', pathController.text);
                    prefs.setString('StartCmd_$item', startCmdController.text);
                    prefs.setString('StartUser_$item', userController.text);
                    Navigator.pop(childcontext);
                  }),
            ],
          );
        },
      );
    }