Created
December 2, 2022 15:14
-
-
Save samuelnub/2dc451cc8746b1b032a4091663b5aad9 to your computer and use it in GitHub Desktop.
small thingy dont look!!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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