A quick script to convert TS models to Dart models.
This is a step towards developing a script that can scan through your typescript project files, find the models and turn them into syntactically correct dart models.
This is super useful when working with a project that uses both Angular and Flutter. Your models may be developed already in Typescript and you may need them in your Flutter version of your application as well. Using this script will eliminate possible spelling errors or human made errors when translating your models.
This was super quickly coded up and has plenty of room for improvements!
- Open the folder in your python editor
- Create a folder called
dump
in the root of the project - Run the script and enter the directory of your typescript project
- The script will scan the directory and convert ts syntax to dart, rename the file to have
.dart
and save them to the dump directory
Currently it works only one way (TS to Dart) it would be awesome to go the other way as well. Feel free to submit a PR of your code refactoring or feature additions!