From ef2ffc3e14f549a3db670a491a5436188f143f21 Mon Sep 17 00:00:00 2001 From: SomnusVeritas Date: Mon, 2 Oct 2023 19:02:14 +0200 Subject: [PATCH] added routing --- lib/main.dart | 8 ++++---- lib/pages/dashboard_page.dart | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 lib/pages/dashboard_page.dart diff --git a/lib/main.dart b/lib/main.dart index ca35425..04b2391 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:rezepte/pages/dashboard_page.dart'; import 'theme.dart'; @@ -15,10 +16,9 @@ class MyApp extends StatelessWidget { title: 'Flutter Demo', theme: lightTheme, darkTheme: darkTheme, - home: Scaffold( - appBar: AppBar( - title: Text('ietn'), - )), + routes: { + Dashboard.routeName: (_) => const Dashboard(), + }, ); } } diff --git a/lib/pages/dashboard_page.dart b/lib/pages/dashboard_page.dart new file mode 100644 index 0000000..def6d99 --- /dev/null +++ b/lib/pages/dashboard_page.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class Dashboard extends StatelessWidget { + const Dashboard({super.key}); + static const routeName = '/'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Dashboard'), + ), + ); + } +}