Intended to be a comment, but bad habit to remove comments and move them in to chat, limits etc
Primum, OP should take look at
Isaac Arthur
, Megastructures - it is just obligatory to watch in chronological order, I conclude that based on his comments.
Secundo, I have to address 2d vs 3d solutions.
All available surface of that 1ly2 city, can be packed in way much smaller 3d structure, but there is one argument against it - less outer surface you have, less energy you can use inside of that object.
Even kingledion suggestion will use 2 times less energy then flat one, because flat one have 2 emitting surfaces, sphere will have only one, if mass of solutions is the same, so it is 2 times less efficient per mass of the construction.
This way there are arguments why someone may like to build flat, instead of more complex shapes.
However OP is controversial here:
Imagine a city floating in space like a fabric - look like a flat surface to me, or not a flat surface
A square light year is simply a measure of the city's area, but not necessarily a description of its geometry. - looks like a sphere to me.
someone asks - Why would the population density be high?
Answer is simply, because a human need about 10kW 24.7.365 or less for his needs, so potentially this city may have 1 human per about 20 square meters of outer surface, and it is a tiny bit denser then Top1 from the list List of cities by population density, so probably it depends on definition of what we should call as high population density.
Yes, OP have to define how much people he want, how much energy they should use, which shape of city should be etc.
However, I should point a flat city of this size is possible, and I would estimate its mass as less then 1/1000 of milky way mass, significantly less(orders of magnitude, about 10t or less per human). Depends on technology, implementation may be different, but for gravity I suggest space habitats approach(rotating small block with 20-200 millions of people inside, it may also help with management organization, which is another OP's Q).
Amount of the energy they may use, it will be about 1/1000 of milky way's energy production.
Flat is ok as shape, twice of energy dissipation per same mass it a good deal, in situation where they should dissemble 2 times less of other star systems.
Also I recommend to build it near Massive Black hole, it will help them to solve energy problems, maybe star going to be supernova will be a good place to start as it will give significant boost on initial stage by giving the energy needed to operate/manipulate with other stars, although you should be a bit better prepared then it mention in that answer, have enough active matter.
Super massive Black hole would be perfect place for the city too.
But first of all you have to decide what is the goal of the city, what wish they(citizens) to achieve? Answering that question may determine what it should be, and it will do that better, then answering a question - how can I have a object with impressive size.