Moving and welfare?

I'm considering moving states and was wondering how can I apply for welfare or gov. childcare? As soon as I move do I qualify or will I need to be a resident of the state first What qualifies me to be a resident or what requirements will I need?

I left a domestic violence relationship and because of the abuse haven't worked.

If I leave the state will I still qualify for everything