-
Notifications
You must be signed in to change notification settings - Fork 138
/
Copy pathtex_view_image_video_example.dart
65 lines (63 loc) · 2.51 KB
/
tex_view_image_video_example.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import 'package:flutter/material.dart';
import 'package:flutter_tex/flutter_tex.dart';
class TeXViewImageVideoExample extends StatelessWidget {
const TeXViewImageVideoExample({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("TeXView Image & Video"),
),
body: TeXView(
child: const TeXViewColumn(children: [
TeXViewDocument(
r"""<h2>Flutter \( \rm\\TeX \) Image Example</h2>""",
style: TeXViewStyle(textAlign: TeXViewTextAlign.center)),
TeXViewDocument('Image Loaded From Assets'),
TeXViewContainer(
child: TeXViewImage.asset('assets/flutter_tex_banner.png'),
style: TeXViewStyle(
margin: TeXViewMargin.all(10),
borderRadius: TeXViewBorderRadius.all(20),
),
),
// TeXViewDocument('Video loaded form Youtube link'),
// TeXViewVideo.youtube(
// "https://www.youtube.com/watch?v=YiNbVEXV_NM&lc=Ugyg4ljzrK0D6YfrO854AaABAg"),
TeXViewDocument(
'Image Loaded From Network, this may take some time according to your network speed'),
TeXViewContainer(
child: TeXViewImage.network(
'https://raw.githubusercontent.com/Shahxad-Akram/flutter_tex/master/example/assets/flutter_tex_banner.png'),
style: TeXViewStyle(
margin: TeXViewMargin.all(10),
borderRadius: TeXViewBorderRadius.all(20),
),
),
]),
style: const TeXViewStyle(
margin: TeXViewMargin.all(5),
padding: TeXViewPadding.all(10),
borderRadius: TeXViewBorderRadius.all(10),
border: TeXViewBorder.all(
TeXViewBorderDecoration(
borderColor: Colors.blue,
borderStyle: TeXViewBorderStyle.solid,
borderWidth: 5),
),
backgroundColor: Colors.white,
),
loadingWidgetBuilder: (context) => const Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircularProgressIndicator(),
Text("Rendering...")
],
),
)),
);
}
}