If you own the leasehold on your flat, the landlord (the freeholder) is responsible for insuring the building. But before you buy the leasehold, you'll want to make sure the building is covered in case of disaster. Actually, your mortgage company will probably ask to see a copy of the insurance document to make sure it's adequate.
The cost of this insurance is likely to be included in the service charge you'll be asked to pay when you move in to your flat. This charge covers the costs of general maintenance of the building, gardens and communal areas, plus insurances and any staff wages.