codeview 0.0.8
codeview: ^0.0.8 copied to clipboard
A package with header, codeview, paragraph and much more to help you make an article style page.
example/example.dart
import 'package:codeview/codeview.dart';
import 'package:flutter/material.dart';
class Example extends StatelessWidget {
const Example({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: CodeView(
maxWidth: 800, //Maximum width of the widget.
maxHeight: 300, //Maximum height of the widget.
run: RunPage(), //Place your result class here as a showcase.
code: """
MaterialButton(
child: Text("Click here"),
onPressed: () {
print("Clicked")
},
),
""",
), // Place your code like this """SOURCECODE""".
),
);
}
}
class RunPage extends StatelessWidget {
const RunPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: MaterialButton(
child: Text("Click here"),
onPressed: () {
print("Clicked");
},
),
),
);
}
}