summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/demo_3d.dart20
-rw-r--r--lib/homescreen.dart3
-rw-r--r--lib/page_home.dart14
3 files changed, 33 insertions, 4 deletions
diff --git a/lib/demo_3d.dart b/lib/demo_3d.dart
new file mode 100644
index 0000000..9aeda40
--- /dev/null
+++ b/lib/demo_3d.dart
@@ -0,0 +1,20 @@
+import 'package:flutter/material.dart';
+
+// A 3D demo.
+class Demo3dPage extends StatelessWidget {
+ Demo3dPage({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ decoration: BoxDecoration(
+ gradient: LinearGradient(
+ begin: Alignment.topRight,
+ end: Alignment.bottomLeft,
+ colors: [Colors.grey.shade800, Colors.grey.shade900])),
+ child: Texture(
+ textureId: 1,
+ ),
+ );
+ }
+}
diff --git a/lib/homescreen.dart b/lib/homescreen.dart
index edb2acc..944355c 100644
--- a/lib/homescreen.dart
+++ b/lib/homescreen.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:flutter_homescreen/demo_3d.dart';
import 'package:provider/provider.dart';
import 'package:flutter_homescreen/homescreen_model.dart';
import 'package:flutter_homescreen/page_dashboard.dart';
@@ -40,7 +41,7 @@ class _HomescreenState extends State<Homescreen> with TickerProviderStateMixin {
case PageIndex.media:
return MediaPage(key: ValueKey(selectedIndex));
case PageIndex.demo3d:
- return Text('3D demo');
+ return Demo3dPage(key: ValueKey(selectedIndex));
default:
return Text('Undefined');
}
diff --git a/lib/page_home.dart b/lib/page_home.dart
index b985570..0c93c4e 100644
--- a/lib/page_home.dart
+++ b/lib/page_home.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:flutter_homescreen/homescreen.dart';
import 'package:flutter_homescreen/layout_size_helper.dart';
// The Home page.
@@ -27,21 +28,28 @@ class HomePage extends StatelessWidget {
label: "DASHBOARD",
icon: Icons.drive_eta,
onPressed: () {
- onSetNavigationIndex(1);
+ onSetNavigationIndex(PageIndex.dashboard.index);
},
),
_HomePageEntry(
label: "HVAC",
icon: Icons.thermostat,
onPressed: () {
- onSetNavigationIndex(2);
+ onSetNavigationIndex(PageIndex.hvac.index);
},
),
_HomePageEntry(
label: "MEDIA",
icon: Icons.music_note,
onPressed: () {
- onSetNavigationIndex(3);
+ onSetNavigationIndex(PageIndex.media.index);
+ },
+ ),
+ _HomePageEntry(
+ label: "DEMO 3D",
+ icon: Icons.view_in_ar,
+ onPressed: () {
+ onSetNavigationIndex(PageIndex.demo3d.index);
},
),
],