plasmoid/lib/read_only.dart

55 lines
1.4 KiB
Dart
Raw Permalink Normal View History

2025-02-24 15:44:25 +02:00
import 'package:flutter/material.dart';
import 'package:flutter_code_editor/flutter_code_editor.dart';
import 'markdown.dart';
import 'day.dart';
import 'night.dart';
2026-06-19 14:04:15 +03:00
import 'codefield.dart';
2025-02-24 15:44:25 +02:00
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: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Image.asset(
'assets/plasmoid_fg.png',
width: 200,
),
),
SizedBox(height: 20),
CodeTheme(
data: CodeThemeData(styles: theme),
child: WrappedCodeField(
controller: CodeController(
text: content,
language: markdown,
),
wrap: true,
readOnly: true,
),
),
SizedBox(height: 80)
],
)
),
);
}
}