Added create recipe page
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rezepte/pages/create_recipe_page.dart';
|
||||||
import 'package:rezepte/pages/dashboard_page.dart';
|
import 'package:rezepte/pages/dashboard_page.dart';
|
||||||
|
|
||||||
import 'theme.dart';
|
import 'theme.dart';
|
||||||
@@ -18,6 +19,7 @@ class MyApp extends StatelessWidget {
|
|||||||
darkTheme: darkTheme,
|
darkTheme: darkTheme,
|
||||||
routes: {
|
routes: {
|
||||||
Dashboard.routeName: (_) => const Dashboard(),
|
Dashboard.routeName: (_) => const Dashboard(),
|
||||||
|
CreateRecipe.routeName: (_) => const CreateRecipe(),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
15
lib/pages/create_recipe_page.dart
Normal file
15
lib/pages/create_recipe_page.dart
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class CreateRecipe extends StatelessWidget {
|
||||||
|
const CreateRecipe({super.key});
|
||||||
|
static const routeName = '/createRecipe';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Create Recipe'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,24 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rezepte/pages/create_recipe_page.dart';
|
||||||
|
|
||||||
class Dashboard extends StatelessWidget {
|
class Dashboard extends StatelessWidget {
|
||||||
const Dashboard({super.key});
|
const Dashboard({super.key});
|
||||||
|
|
||||||
static const routeName = '/';
|
static const routeName = '/';
|
||||||
|
|
||||||
|
void _onAddTapped(BuildContext context) =>
|
||||||
|
Navigator.of(context).pushNamed(CreateRecipe.routeName);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Dashboard'),
|
title: const Text('Dashboard'),
|
||||||
),
|
),
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
onPressed: () => _onAddTapped(context),
|
||||||
|
child: const Icon(Icons.add),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user