Screen class

Annotation used to annotate screens.

Usage

When a screen is annotated with @Screen(name: 'myScreen') it means that this screen can be used to be injected in Flutter Route context via the KareeRouter's module.

Let assume that MyScreen The next screen of my application,

@Screen(name: 'secondScreen')
class MyScreen extends StatelessScreen{

}
  • Screen loading by Class Name

We can add our screen to the navigation context in push mode like follow

screen(MyScreen(), RouteMode.PUSH)
  • Screen loading by Screen name
screen('secondScreen', RouteMode.PUSH)

Note that, load a new screen by name when the application is running, will not have any effect with hot reload. You must used code generation by running karee source and hot restart

  • Auto loading.

When the property isInitial of a screen is set to true, it means that this screen will be the one that will be displayed as the first screen. General usage of this property is reserved to splash screen or first screen of the application or module.

Annotations
  • @Target({TargetKind.classType})

Constructors

Screen(String name, {bool isInitial = false})
Constructor of Screen's annotation.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isInitial bool
Flag that indicates whether the screen is the first screen of the application or not.
final
name String
The name of this screen. Optional, if specified, it can be used to load this screen by name.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited