forked from juicycleff/flutter-unity-view-widget
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmenu_screen.dart
More file actions
108 lines (101 loc) · 2.59 KB
/
menu_screen.dart
File metadata and controls
108 lines (101 loc) · 2.59 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import 'package:flutter/material.dart';
class MenuScreen extends StatefulWidget {
const MenuScreen({Key? key}) : super(key: key);
@override
State<MenuScreen> createState() => _MenuScreenState();
}
class _MenuScreenState extends State<MenuScreen> {
bool enableAR = true;
List<_MenuListItem> menus = [
_MenuListItem(
description: 'Simple demonstration of unity flutter library',
route: '/simple',
title: 'Simple Unity Demo',
enableAR: false,
),
_MenuListItem(
description: 'No interaction of unity flutter library',
route: '/none',
title: 'No Interaction Unity Demo',
enableAR: false,
),
_MenuListItem(
description: 'Unity load and unload unity demo',
route: '/loader',
title: 'Safe mode Demo',
enableAR: false,
),
_MenuListItem(
description:
'This example shows various native API exposed by the library',
route: '/api',
title: 'Native exposed API demo',
enableAR: false,
),
_MenuListItem(
title: 'Test Orientation',
route: '/orientation',
description: 'test orientation change',
enableAR: false,
),
_MenuListItem(
description: 'Unity native activity demo',
route: '/activity',
title: 'Native Activity Demo ',
enableAR: true,
),
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Menu List'),
actions: [
Row(
children: [
const Text("Enable AR"),
Checkbox(
value: enableAR,
onChanged: (changed) {
if (changed != null) {
setState(() {
enableAR = changed;
});
}
},
),
],
),
],
),
body: Center(
child: ListView.builder(
itemCount: menus.length,
itemBuilder: (BuildContext context, int i) {
return ListTile(
title: Text(menus[i].title),
subtitle: Text(menus[i].description),
onTap: () {
Navigator.of(context).pushNamed(
menus[i].route,
);
},
);
},
),
),
);
}
}
class _MenuListItem {
final String title;
final String description;
final String route;
final bool enableAR;
_MenuListItem({
required this.title,
required this.description,
required this.route,
required this.enableAR,
});
}