Skip to content

Instantly share code, notes, and snippets.

@samuelnub
Created December 2, 2022 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuelnub/2dc451cc8746b1b032a4091663b5aad9 to your computer and use it in GitHub Desktop.
Save samuelnub/2dc451cc8746b1b032a4091663b5aad9 to your computer and use it in GitHub Desktop.
small thingy dont look!!!
void main() {
final String input = '''
{OPCODE_LOADPATH:['/html/wizard/wifi.html']},
{OPCODE_CLICKELEMENT:['#BasicSettingsTwo_off_twoFour']},
{OPCODE_WAITFORELEMENTGONE:['#submitdynamic']},
{OPCODE_CLICKELEMENT:['#BasicSettingsFive_five_off']},
{OPCODE_WAITFORELEMENTGONE:['#submitdynamic']},
{OPCODE_CLICKELEMENT:['#wifi_wizard_save']},
''';
final String result = input
.replaceAll(RegExp('OPCODE_LOADPATH'), '"loadPath"')
.replaceAll(RegExp('OPCODE_FILLTEXTFIELD'), '"fillTextfield"')
.replaceAll(RegExp('OPCODE_CLICKELEMENT'), '"clickElement"')
.replaceAll(RegExp('OPCODE_WAITFORELEMENTGONE'), '"waitForElementGone"')
.replaceAll(RegExp('OPCODE_WAITFORREDIRECT'), '"waitForRedirect"')
.replaceAll('\'', '"');
print(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment