Shitty SizedBox hack, that I'd rather not have in production

This commit is contained in:
Felisp 2024-11-09 02:29:23 +01:00
parent 4350f954a0
commit c010047887

View file

@ -12,14 +12,25 @@ import 'package:gophershy/gopherlib.dart';
class GopherText extends StatelessWidget { class GopherText extends StatelessWidget {
final LoadedGopherItem item; final LoadedGopherItem item;
final ScrollController controller = ScrollController();
const GopherText(this.item, {super.key}); GopherText(this.item, {super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// TODO: Figure out how to stop line wrap // TODO: Figure out how to stop line wrap
// TODO: figure out how to switch between line wrap and no wrap // TODO: figure out how to switch between line wrap and no wrap
return ListView.builder( return SizedBox(
width: 4000,
child: SingleChildScrollView(
controller: controller,
scrollDirection: Axis.horizontal,
// Really shitty hack that works half way
// but leaves shitton of space on the right
child: SizedBox(
width: 4000,
child: ListView.builder(
shrinkWrap: true,
itemCount: item.data?.length, itemCount: item.data?.length,
itemBuilder: (context, int n) { itemBuilder: (context, int n) {
return SelectableText( return SelectableText(
@ -35,9 +46,12 @@ class GopherText extends StatelessWidget {
), ),
); );
}, },
),
),
),
); );
} }
} }
//TODO: BinaryWidget with option of downloading it //TODO: BinaryWidget with option of downloading it
//TODO: MediaWidget with option for displaying images, maybe playing WAVs? //TODO: MediaWidget with option for displaying images, maybe playing WAVs?