added about and help texts, font size slider

This commit is contained in:
randogoth 2025-02-22 20:59:42 +02:00
parent 4fcd6db6fd
commit 750a228921
6 changed files with 230 additions and 9 deletions

67
lib/read_only.dart Normal file
View file

@ -0,0 +1,67 @@
import 'package:flutter/material.dart';
import 'package:flutter_code_editor/flutter_code_editor.dart';
import 'themes//markdown.dart';
import 'themes/day.dart';
import 'themes/night.dart';
import 'codefield.dart'; // Ensure this includes WrappedCodeField
class ReadOnlyPage extends StatelessWidget {
final String title;
final String content;
final bool isDarkMode;
ReadOnlyPage({
required this.title,
required this.content,
required this.isDarkMode,
});
@override
Widget build(BuildContext context) {
final theme = isDarkMode ? nightTheme : dayTheme;
return Scaffold(
appBar: AppBar(title: Text(title)),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15.0),
child: title == "About"
? Column(
children: [
Center(
child: Image.asset(
'assets/blaster_fg.png',
width: 200,
)
),
CodeTheme(
data: CodeThemeData(styles: theme),
child: SingleChildScrollView(
child: WrappedCodeField(
controller: CodeController(
text: content,
language: markdown,
),
wrap: true,
readOnly: true,
),
),
),
]
)
: CodeTheme(
data: CodeThemeData(styles: theme),
child: SingleChildScrollView(
child: WrappedCodeField(
controller: CodeController(
text: content,
language: markdown,
),
wrap: true,
readOnly: true,
),
),
),
),
);
}
}