katana_router library

A package to automatically create routing configurations with build_runner to enable type-safe routing.

To use, import package:katana_router/katana_router.dart.

Classes

Api
Provides static methods for making HTTP requests.
AppPageRoute<T>
Default PageRoute.
AppRoute
Automatically generates routing for the entire application.
AppRouter
Controller to define routing for the entire app.
AppRouteScope
InheritedWidget for placing AppRouter on the widget tree.
BootRouteQueryBuilder
RouteQueryBuilder for building the boot page (the page that is displayed only when the application is launched).
ConsoleLoggerAdapter
LoggerAdapter for outputting logs to the console.
DateDuration
A class that represents a date period.
DateFormat
DateFormat is for formatting and parsing dates in a locale-sensitive manner.
Immutable
Used to annotate a class.
InitialRouteInformation
LocalLoggerAdapter
Logging can be done locally on the terminal LoggerAdapter.
Loggable
Interface for objects that can be passed directly to Logger.send.
Logger
Used for active logging.
LoggerAdapter
Base class for defining platform adapters for storing logs.
LoggerAdapterScope
Place it on top of MaterialApp, etc., and set LoggerAdapter for the entire app.
LoggerDatabase
A simple database for logging information.
LoggerExporter
Import and export DynamicMap data used in LoggerDatabase to external files.
LoggerTrace
LoggerTraceValue
Base class for tracing logs and measuring performance.
LogValue
Class for defining log values for viewing.
NestedAppRouter
Class for creating nested AppRouter.
NestedPage
Pages for use in nested navigators rather than at the top level.
PageParam
Annotation to map each widget parameter to a variable in the page root.
PagePath
Annotation defining the page.
PageRouteQuery
Annotation to define the RouteQuery of the page.
QueryParam
Annotation to map each widget parameter to a query parameter in the page path.
RedirectQuery
Class for defining the page to be displayed in different locations depending on conditions.
Required
Used to annotate a named parameter p in a method or function f.
RouteQuery
Base class for creating queries to perform page transitions.
RouteQueryBuilder
Class for building page queries.
RuntimeLoggerAdapter
Logging in memory LoggerAdapter.
TransitionQuery
Route queries for page transitions.
UnknownRouteQueryBuilder
RouteQueryBuilder for building a page (404 page) to display if the page passed to AppRouter is not a hit for the entered path (URL).
UseResult
See useResult for more details.

Enums

RouteLoggerEvent
Routing events for logging.

Extensions

DateTimeExtensions on DateTime
Provides extended methods for DateTime.
DateTimeIterableExtensions on Iterable<DateTime>
Provides extended methods for DateTime arrays.
DoubleExtensions on double
Provides extended methods for double.
DoubleIterableExtensions on Iterable<double>
Provides extended methods for double arrays.
DurationExtensions on Duration
Provides extended methods for Duration.
DynamicMapExtensions on Map<String, dynamic>
Provides extended methods for DynamicMap.
InterableOfIterableExtensions on Iterable<Iterable<T>>
Provides extended methods for Iterable arrays.
IntExtensions on int
Provides extended methods for int.
IntIterableExtensions on Iterable<int>
Provides extended methods for int arrays.
IterableExtensions on Iterable<T>
Provides extended methods for T arrays.
JsonDynamicListExtensions on DynamicList
Provides Json extension methods for DynamicList.
JsonDynamicMapExtensions on DynamicMap
Provides Json extension methods for DynamicMap.
ListExtensions on List<T>
Provides extended methods for List in T.
MapExtensions on Map<K, V>
Provides extended methods for Map.
NullableDoubleExtensions on double?
Provides an extension method for double that is nullable.
NullableIntExtensions on int?
Provides an extension method for int that is nullable.
NullableIterableExtensions on Iterable<T>?
Provides an extension method for Iterable that is nullable.
NullableListExtensions on List<T>?
Provides an extension method for List that is nullable.
NullableMapExtensions on Map<K, V>?
Provides an extension method for Map that is nullable.
NullableNumExtensions on num?
Provides an extension method for num that is nullable.
NullableObjectExtensions on Object?
Provides an extension method for List that is nullable.
NullableSetExtensions on Set<T>?
Provides an extension method for Set that is nullable.
NullableStringExtensions on String?
Provides an extension method for String that is nullable.
NullableValueIterableExtensions on Iterable<T?>
Provides an extension method for Iterable whose value is nullable.
RandomExtensions on Random
Provides extended methods for Random.
RoutingBuildContedxtExtensions on BuildContext
Provides extension methods for BuildContext.
RoutingNavigatorStateExtensions on NavigatorState
Provides extension methods for NavigatorState.
SetExtensions on Set<T>
Provides extended methods for Set.
StringExtensions on String
Provides extended methods for String.

Constants

appRoute → const AppRoute
Automatically generates routing for the entire application.
kTransitionDuration → const Duration
Duration of page transitions.
nestedPage → const NestedPage
Pages for use in nested navigators rather than at the top level.
nullOfBool → const bool?
A null object with a defined type of bool?
nullOfDouble → const double?
A null object with a defined type of double?
nullOfDynamicList → const DynamicList?
A null object with a defined type of DynamicList?
nullOfDynamicMap → const DynamicMap?
A null object with a defined type of DynamicMap?
nullOfInt → const int?
A null object with a defined type of int?
nullOfNum → const num?
A null object with a defined type of num?
nullOfString → const String?
A null object with a defined type of String?
pageParam → const PageParam
Annotation to map each widget parameter to a variable in the page root.
pageRouteQuery → const PageRouteQuery
Annotation to define the RouteQuery of the page.
queryParam → const QueryParam
Annotation to map each widget parameter to a query parameter in the page path.
useResult → const UseResult
Used to annotate a method, field, or getter within a class, mixin, or extension, or a or top-level getter, variable or function to indicate that the value obtained by invoking it should be used. A value is considered used if it is assigned to a variable, passed to a function, or used as the target of an invocation, or invoked (if the result is itself a function).
zeroOfNum → const num
A 0 object with a defined type of num?

Properties

sprintf ↔ PrintFormat
getter/setter pair
uuid String
Generate and retrieve the UUID for Version 4.
no setter

Functions

generateCode(int length, {int seed = 0, String charSet = "23456789abcdefghjkmnpqrstuvwxy"}) String
Generates and returns a random string with the number of characters given by length.
initializeDateFormatting([String? locale, String? ignored]) Future<void>
This should be called for at least one locale before any date formatting methods are called. It sets up the lookup for date symbols. Both the locale and ignored parameter are ignored, as the data for all locales is directly available.
jsonDecodeAsList<T extends Object?>(String json, [List<T> defaultValue = const []]) List<T>
Converts json to a Json-decoded List
jsonDecodeAsMap<T extends Object?>(String json, [Map<String, T> defaultValue = const {}]) Map<String, T>
Converts json to a Json-decoded Map<String, dynamic> object.
jsonEncodable(Object? o) bool
If this object is Json encodable, true is returned.
nullOfList<T>() List<T>?
A null object with a defined type of List<T>?
nullOfMap<K, V>() Map<K, V>?
A null object with a defined type of Map<K, V>?
nullOfSet<T>() Set<T>?
A null object with a defined type of Set<T>?
wait(Iterable futures) Future<void>
Wait until all Futures given in futures are completed.

Typedefs

ApiResponse = Response
An HTTP response where the entire response body is known in advance.
ApiResquest = Request
An HTTP request where the entire request body is known in advance.
DynamicList = List
Represents the type of List<dynamic>.
DynamicMap = Map<String, dynamic>
Represents the type of Map<String, dynamic>.