2025-02-22 20:59:42 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2026-10-13 10:47:34 +03:00
|
|
|
import 'markdown_editing.dart';
|
|
|
|
|
import 'markdown_view.dart';
|
2025-02-22 20:59:42 +02:00
|
|
|
import 'themes/day.dart';
|
|
|
|
|
import 'themes/night.dart';
|
|
|
|
|
|
|
|
|
|
class ReadOnlyPage extends StatelessWidget {
|
|
|
|
|
final String title;
|
|
|
|
|
final String content;
|
|
|
|
|
|
|
|
|
|
ReadOnlyPage({
|
|
|
|
|
required this.title,
|
|
|
|
|
required this.content,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2026-10-13 10:47:34 +03:00
|
|
|
final view = MarkdownView(
|
|
|
|
|
controller: MarkdownController(
|
|
|
|
|
text: content,
|
2026-10-13 11:31:14 +03:00
|
|
|
theme: Theme.of(context).brightness == Brightness.dark
|
|
|
|
|
? nightTheme
|
|
|
|
|
: dayTheme,
|
2026-10-13 10:47:34 +03:00
|
|
|
),
|
|
|
|
|
);
|
2025-02-22 20:59:42 +02:00
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
)
|
|
|
|
|
),
|
2026-10-13 10:47:34 +03:00
|
|
|
Expanded(child: view),
|
2025-02-22 20:59:42 +02:00
|
|
|
]
|
|
|
|
|
)
|
2026-10-13 10:47:34 +03:00
|
|
|
: view,
|
2025-02-22 20:59:42 +02:00
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-10-13 10:47:34 +03:00
|
|
|
}
|