lb_setup_ui 1.0.6 lb_setup_ui: ^1.0.6 copied to clipboard
Logbot Setup UI to easily implement the Logbot First Setup procedure over Bluetooth to setup a Logbot IoT easily from a mobile app
// 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/ble_setup_page.dart';
import 'package:example/ui/apis/wifi_setup_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';
// ignore: depend_on_referenced_packages
import 'package:lb_setup/lb_setup.dart';
// ignore: depend_on_referenced_packages
import 'package:lb_commons/services/logbot_common_env.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await dotenv.load(fileName: ".env");
await LogbotSetup.init();
if (kDebugMode) {
LogbotCommonEnvironment.enableDebugLogs();
}
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 - Setup Example',
themeMode: ThemeMode.light,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const HomePage(),
initialRoute: '/login',
routes: {
'/home': (context) => const HomePage(),
'/login': (context) => const LoginPage(),
'/bluetooth/setup': (context) => const BleSetupPage(),
'/wifi/setup': (context) => const WifiSetupPage(),
},
);
}
}