about text
This commit is contained in:
parent
8c602894a6
commit
2fde531964
11 changed files with 422 additions and 2 deletions
54
lib/read_only.dart
Normal file
54
lib/read_only.dart
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_code_editor/flutter_code_editor.dart';
|
||||
import 'markdown.dart';
|
||||
import 'day.dart';
|
||||
import '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: 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)
|
||||
],
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue