lb_state_manager 1.1.3 copy "lb_state_manager: ^1.1.3" to clipboard
lb_state_manager: ^1.1.3 copied to clipboard

Logbot State Manager service to return the state of the devices and device services

example/lib/main.dart

// Copyright 2022 Logbot SRL. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:example/ui/apis/get_current_status_cached_api_page.dart';
import 'package:example/ui/apis/get_updated_at_api_page.dart';
import 'package:example/ui/apis/list_current_status_cached_api_page.dart';
import 'package:example/ui/apis/get_device_status_api_page.dart';
import 'package:example/ui/apis/list_device_status_api_page.dart';
import 'package:example/ui/home_page.dart';
import 'package:example/ui/login_page.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:lb_commons/services/logbot_common_env.dart';
import 'package:lb_state_manager/lb_state_manager.dart';

Future<void> main() async {
  await dotenv.load(fileName: ".env");
  if (kDebugMode) {
    LogbotCommonEnvironment.enableDebugLogs();
  }
  LogbotStateManager.start();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Logbot SDK - State Manager Example',
      themeMode: ThemeMode.light,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const LoginPage(),
      initialRoute: '/login',
      routes: {
        '/home': (context) => const HomePage(),
        '/login': (context) => const LoginPage(),
        '/status/list': (context) => const ListDeviceStatusApiPage(),
        '/status/get': (context) => const GetDeviceStatusApiPage(),
        '/status/list/cached': (context) =>
            const ListCurrentStatusCachedApiPage(),
        '/status/get/cached': (context) =>
            const GetCurrentStatusCachedApiPage(),
        '/status/updated_at': (context) => const GetUpdatedAtApiPage(),
      },
    );
  }
}
0
likes
50
points
74
downloads

Publisher

verified publisherlogbot.cloud

Weekly Downloads

Logbot State Manager service to return the state of the devices and device services

Homepage

Documentation

Documentation

License

BSD-3-Clause (license)

Dependencies

collection, http, intl, lb_auth, lb_commons, lb_core, lb_discovery, meta

More

Packages that depend on lb_state_manager