There are literally dozens of posts that cover this question. Have a quick search for these.
Long story short, yes you can fly. Flamingo Air flies twice daily, so you could make this a day trip to Staniel Cay. But you will need to make arrangements to get from Staniel to the pigs -- about 2 miles by boat. Flamingo offers day return rates which are slightly lower than regular fares.
Save your money for something better. The piggies are nothing but a dirty tourist trap and they can be aggressive.