-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add router class and add placeholder subpages * feat: add routing methods at correct places in code and some placeholder stuff * feat: add tests for routing in the pages itself * feat: add app_router unit tests
- Loading branch information
Showing
12 changed files
with
395 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:deskify/features/presentation/subpages/subpages.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
/// This class provides the routing of the subpages for the application. | ||
/// | ||
/// The actual pages, which can be clicked in the BottomNavigationBar, are | ||
/// defined in the [App] class. | ||
class AppRouter { | ||
static const String homeStandingAnalyticsPath = '/home/standing_analytics'; | ||
static const String homeSittingAnalyticsPath = '/home/sitting_analytics'; | ||
static const String homeAddPresetPath = '/home/add_preset'; | ||
static const String homeEditPresetPath = '/home/edit_preset'; | ||
static const String homeMoveDeskPath = '/home/move_desk'; | ||
static const String addDeskAddPresetPath = '/add_desk/add_preset'; | ||
static const String addDeskEditPresetPath = '/add_desk/edit_preset'; | ||
|
||
Route? onGenerateRoute(RouteSettings settings) { | ||
switch (settings.name) { | ||
//! HomePage | ||
case homeStandingAnalyticsPath: | ||
return MaterialPageRoute(builder: (_) => const AnalyticsPage()); | ||
case homeSittingAnalyticsPath: | ||
return MaterialPageRoute(builder: (_) => const AnalyticsPage()); | ||
case homeAddPresetPath: | ||
return MaterialPageRoute(builder: (_) => const PresetPage()); | ||
case homeEditPresetPath: | ||
return MaterialPageRoute(builder: (_) => const PresetPage()); | ||
case homeMoveDeskPath: | ||
return MaterialPageRoute(builder: (_) => const MoveDeskPage()); | ||
//! AddDeskPage | ||
case addDeskAddPresetPath: | ||
return MaterialPageRoute(builder: (_) => const PresetPage()); | ||
case addDeskEditPresetPath: | ||
return MaterialPageRoute(builder: (_) => const PresetPage()); | ||
default: | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AnalyticsPage extends StatefulWidget { | ||
const AnalyticsPage({super.key}); | ||
|
||
@override | ||
State<AnalyticsPage> createState() => _AnalyticsPageState(); | ||
} | ||
|
||
class _AnalyticsPageState extends State<AnalyticsPage> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('Analytics Page'), | ||
), | ||
body: const Placeholder(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class MoveDeskPage extends StatefulWidget { | ||
const MoveDeskPage({super.key}); | ||
|
||
@override | ||
State<MoveDeskPage> createState() => _MoveDeskPageState(); | ||
} | ||
|
||
class _MoveDeskPageState extends State<MoveDeskPage> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('Move Desk Page'), | ||
), | ||
body: const Placeholder(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class PresetPage extends StatefulWidget { | ||
const PresetPage({super.key}); | ||
|
||
@override | ||
State<PresetPage> createState() => _PresetPageState(); | ||
} | ||
|
||
class _PresetPageState extends State<PresetPage> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('Preset Page'), | ||
), | ||
body: const Placeholder(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export 'analytics_page.dart'; | ||
export 'move_desk_page.dart'; | ||
export 'preset_page.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.