neom_states 1.0.1 copy "neom_states: ^1.0.1" to clipboard
neom_states: ^1.0.1 copied to clipboard

Frequency state experience system for Cyberneom. Standalone /x/{stateId} links.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:neom_states/neom_states.dart';
import 'package:sint/sint.dart';

void main() {
  runApp(const MyApp());
}

/// Aplicación principal de demostración del módulo neom_states.
class MyApp extends StatelessWidget {
  /// Constructor base de la app de ejemplo.
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return SintMaterialApp(
      title: 'Neom States Demo',
      theme: ThemeData.dark(),
      home: const HomeScreen(),
    );
  }
}

/// Pantalla principal con accesos rápidos al catálogo de estados.
class HomeScreen extends StatelessWidget {
  /// Constructor base de la pantalla de inicio.
  const HomeScreen({super.key});

  @override
  Widget build(BuildContext context) {
    // Ejemplo de creación manual de una fase y estado de frecuencia
    const sleepPhase = FrequencyPhase(
      startAt: Duration.zero,
      leftFrequency: 10.0,
      rightFrequency: 14.0,
      screenColor: Colors.indigo,
    );

    final customSleepState = FrequencyState(
      id: 'custom_sleep',
      names: const {'en': 'Custom Deep Sleep'},
      descriptions: const {'en': 'A manually constructed deep sleep frequency state.'},
      leftFrequency: 10.0,
      rightFrequency: 14.0,
      duration: const Duration(minutes: 30),
      screenColor: Colors.indigo,
      phases: const [sleepPhase],
    );

    return Scaffold(
      appBar: AppBar(
        title: const Text('Neom States Catalog'),
        centerTitle: true,
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(24.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const Icon(
                Icons.spa,
                size: 90,
                color: Colors.lightGreen,
              ),
              const SizedBox(height: 24),
              const Text(
                'Cyberneom Brainwave State Manager',
                style: TextStyle(
                  fontSize: 22,
                  fontWeight: FontWeight.bold,
                  letterSpacing: 1.0,
                ),
                textAlign: TextAlign.center,
              ),
              const SizedBox(height: 12),
              const Text(
                'Manage brainwave entrainment phases (Alpha, Theta, Delta), track streaks, and process bilateral audio sessions.',
                textAlign: TextAlign.center,
                style: TextStyle(color: Colors.white54),
              ),
              const SizedBox(height: 30),
              Card(
                color: Colors.black26,
                elevation: 4,
                child: Padding(
                  padding: const EdgeInsets.all(16.0),
                  child: Column(
                    children: [
                      Text(
                        customSleepState.name('en'),
                        style: const TextStyle(
                          fontSize: 16,
                          fontWeight: FontWeight.bold,
                          color: Colors.indigoAccent,
                        ),
                      ),
                      const SizedBox(height: 8),
                      Text(
                        'Binaural beat target: ${sleepPhase.binauralBeat} Hz',
                        style: const TextStyle(fontSize: 12, color: Colors.white38),
                      ),
                    ],
                  ),
                ),
              ),
              const SizedBox(height: 40),
              ElevatedButton.icon(
                onPressed: () {
                  // Navegar a la página del catálogo
                  Navigator.of(context).push(
                    MaterialPageRoute(
                      builder: (_) => const StateCatalogPage(),
                    ),
                  );
                },
                icon: const Icon(Icons.library_music),
                label: const Text('EXPLORE STATE CATALOG'),
                style: ElevatedButton.styleFrom(
                  backgroundColor: Colors.lightGreen,
                  foregroundColor: Colors.black,
                  padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
                  textStyle: const TextStyle(
                    fontSize: 16,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
140
points
121
downloads

Documentation

API reference

Publisher

verified publisheropenneom.dev

Weekly Downloads

Frequency state experience system for Cyberneom. Standalone /x/{stateId} links.

Homepage

License

Apache-2.0 (license)

Dependencies

cloud_firestore, flutter, flutter_sound, hive_flutter, neom_commons, neom_core, share_plus, sint, url_launcher, web

More

Packages that depend on neom_states