Hi@liyangcheng
You can find S32K142 flash driver source code in this path.

....\S32K1xx_unified_bootloader_demo_V1.0\S32K1xx\Project\S32DS\S32K142_CAN
I did not find S32K144 Flash driver source code, but it should be same,you can try to modifiy S32K142 flash driver to meet your needs.
BR!
Jim,