Compare commits

..

No commits in common. "c0100478876cf9c780f3478f9c5dd63f41ea8da8" and "26dd27a435a0752b4fcd363a453adc88bfde80ab" have entirely different histories.

2 changed files with 18 additions and 32 deletions

View file

@ -129,7 +129,7 @@ class _GopherLoaderState extends State<GopherLoader> {
builder: (cont, snap) { builder: (cont, snap) {
print("${snap.connectionState}"); print("${snap.connectionState}");
if (snap.connectionState != ConnectionState.done) { if (snap.connectionState != ConnectionState.done) {
return const Center(child: CircularProgressIndicator()); return const CircularProgressIndicator();
} else { } else {
if (snap.hasData) { if (snap.hasData) {
print( print(

View file

@ -12,46 +12,32 @@ import 'package:gophershy/gopherlib.dart';
class GopherText extends StatelessWidget { class GopherText extends StatelessWidget {
final LoadedGopherItem item; final LoadedGopherItem item;
final ScrollController controller = ScrollController();
GopherText(this.item, {super.key}); const 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 SizedBox( return ListView.builder(
width: 4000, itemCount: item.data?.length,
child: SingleChildScrollView( itemBuilder: (context, int n) {
controller: controller, return Text(
scrollDirection: Axis.horizontal, utf8.decode(item.data![n], allowMalformed: true),
// Really shitty hack that works half way style: const TextStyle(
// but leaves shitton of space on the right fontFamily: "SourceCodePro",
child: SizedBox( fontWeight: FontWeight.w400,
width: 4000, height: 1.0,
child: ListView.builder( // Might need to be tuned for ASCII art
shrinkWrap: true, letterSpacing: 1,
itemCount: item.data?.length, wordSpacing: 1,
itemBuilder: (context, int n) { overflow: TextOverflow.clip
return SelectableText(
utf8.decode(item.data![n], allowMalformed: true),
style: const TextStyle(
fontFamily: "SourceCodePro",
fontWeight: FontWeight.w600,
height: 1.0,
// Might need to be tuned for ASCII art
letterSpacing: 1,
wordSpacing: 1,
overflow: TextOverflow.clip
),
);
},
),
), ),
), );
},
); );
}
} }
}
//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?