class UI::ScreenContext::Native

Overview

Concrete ScreenContext for native targets. Wraps:

Defined in:

asset_pipeline/native_context.cr

Constructors

Instance Method Summary

Instance methods inherited from class UI::ScreenContext

csrf_token : String | Nil csrf_token, design_tokens : UI::DesignTokens::Tokens design_tokens, flash_data : Hash(String, String) flash_data, params : Hash(String, String) params, params_multi : Hash(String, Array(String)) params_multi

Constructor Detail

def self.new(form_state : UI::FormState, session : UI::Session, flash : UI::Flash, design_tokens : UI::DesignTokens::Tokens, navigation : UI::NavigationCoordinator, action_params : Hash(String, String) = {} of String => String) #

[View source]

Instance Method Detail

def action_params : Hash(String, String) #

[View source]
def csrf_token : String | Nil #

Native targets do not have CSRF — the form submission path is an in-process action dispatch, not an HTTP POST. Returns nil explicitly to satisfy the abstract contract and make the absence intentional rather than accidental.


[View source]
def design_tokens : UI::DesignTokens::Tokens #

[View source]
def flash : UI::Flash #

[View source]
def flash_data : Hash(String, String) #

Flash messages for the current screen (snapshot for display).


[View source]
def form_state : UI::FormState #

[View source]
def navigation : UI::NavigationCoordinator #

[View source]
def params : Hash(String, String) #

Snapshot of the per-screen form values. Implements the abstract UI::ScreenContext#params contract for native targets. Always reads via form_state.to_h (which returns a defensive copy in iter 3); does NOT silently merge #action_params.


[View source]
def params_multi : Hash(String, Array(String)) #

Native targets do not carry multi-value form params yet — text inputs are scalar-only. Returns an empty Hash to satisfy the abstract contract. Future multi-select widgets (e.g. checkbox groups) will populate this.


[View source]
def session : UI::Session #

[View source]