I’d paint first so you don’t have to worry about getting paint on the floor. It is easier to keep off the walls when installing flooring than trying to not get paint on the new floors. This is my opinion, however, but it is the way I have done it when doing my house as well as when I used to do remodeling for a construction company.