This file contains hidden or 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
| import 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:zenrouter/zenrouter.dart'; | |
| final authState = ValueNotifier(true); | |
| abstract class AppRoute extends RouteTarget with RouteUnique {} | |
| typedef RedirectFunction = |
This file contains hidden or 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
| import 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:zenrouter/zenrouter.dart'; | |
| // ==================== Base Route Classes ==================== | |
| abstract class AppRoute extends RouteTarget with RouteUnique {} | |
| // ==================== Master-Detail Layout ==================== |
This file contains hidden or 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
| /// A minimal example demonstrating how to create a Tab-based navigation using ZenRouter. | |
| /// | |
| /// Key concepts: | |
| /// - [TabLayoutCoordinator]: Manages the routing state, specifically the [IndexedStackPath] for tabs. | |
| /// - [TabLayout]: A [RouteLayout] that provides the UI structure (e.g., [BottomNavigationBar]) for its children. | |
| /// - [IndexedStackPath]: Maintains the state of each tab, allowing for preservation of state when switching tabs. | |
| /// | |
| /// To run this example: | |
| /// 1. Fix imports if necessary. | |
| /// 2. Run the `main()` function defined at the bottom of this file. |
This file contains hidden or 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
| import 'package:flutter/material.dart'; | |
| import 'package:zenrouter/zenrouter.dart'; | |
| abstract class AppRoute extends RouteTarget with RouteUnique {} | |
| class Home extends AppRoute { | |
| @override | |
| Uri toUri() => Uri.parse('/'); | |
| @override |
This file contains hidden or 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
| import 'package:flutter/material.dart'; | |
| import 'package:zenrouter/zenrouter.dart'; | |
| import 'package:zenrouter_devtools/zenrouter_devtools.dart'; | |
| void main() { | |
| runApp(MainApp()); | |
| } | |
| class MainApp extends StatelessWidget { | |
| const MainApp({super.key}); |
This file contains hidden or 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
| import 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:zenrouter/zenrouter.dart'; | |
| import 'package:zenrouter_devtools/zenrouter_devtools.dart'; | |
| bool loggedIn = false; | |
| bool loaded = false; | |
| Future<bool> _authCheck() async { |
This file contains hidden or 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
| // GENERATED CODE - DO NOT MODIFY BY HAND | |
| // ignore_for_file: type=lint | |
| import 'package:zenrouter/zenrouter.dart'; | |
| import '(auth)/_layout.dart'; | |
| import '(auth)/login.dart' deferred as auth_login; | |
| import '(auth)/register.dart' deferred as auth_register; | |
| import 'about.dart' deferred as about; | |
| import 'index.dart' deferred as index; |
This file contains hidden or 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
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| class CrtScreen extends StatefulWidget { | |
| final Widget child; | |
| final double scanlineGap; | |
| final double scanlineThickness; | |
| final double verticalLineGap; | |
| final double horizontalShakeRange; |
NewerOlder