StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.
| 1 | use strato_core::inspector::{inspector, InspectorConfig}; |
| 2 | use strato_core::Result; |
| 3 | use strato_sdk::{InitBuilder, InitConfig}; |
| 4 | |
| 5 | fn main() -> Result<()> { |
| 6 | println!("StratoUI Custom Initialization Example"); |
| 7 | println!("====================================="); |
| 8 | |
| 9 | // Example 1: Basic initialization with default config |
| 10 | println!("\n1. Basic initialization with default config:"); |
| 11 | let mut builder = InitBuilder::new(); |
| 12 | builder.init_all()?; |
| 13 | |
| 14 | inspector().configure(InspectorConfig { |
| 15 | enabled: true, |
| 16 | ..Default::default() |
| 17 | }); |
| 18 | |
| 19 | println!(" Core: ✓"); |
| 20 | println!(" Widgets: ✓"); |
| 21 | println!(" Platform: ✓"); |
| 22 | println!(" Inspector: ✓ Enabled for runtime overlays"); |
| 23 | println!(" Complete: ✓"); |
| 24 | |
| 25 | // Example 2: Check global text renderer |
| 26 | println!("\n2. Global text renderer status:"); |
| 27 | match strato_sdk::get_text_renderer() { |
| 28 | Some(_renderer) => { |
| 29 | println!(" Global text renderer: ✓ Available"); |
| 30 | } |
| 31 | None => { |
| 32 | println!(" Global text renderer: ✗ Not available"); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | println!("\nExample completed successfully!"); |
| 37 | println!("The new initialization system provides:"); |
| 38 | println!(" • Granular control over initialization steps"); |
| 39 | println!(" • Better error handling and reporting"); |
| 40 | println!(" • Improved text rendering capabilities"); |
| 41 | println!(" • Font management and filtering"); |
| 42 | |
| 43 | Ok(()) |
| 44 | } |
| 45 |