It may not be possible to change the basis on which a flat is co-owned if a mortgage company is involved and/or the other owners don't agree.
If you're worried about what will happen to your share of the flat when you die, writing a will ensures that the benefit goes to the person you want.