sahha_flutter 0.3.3 copy "sahha_flutter: ^0.3.3" to clipboard
sahha_flutter: ^0.3.3 copied to clipboard

Sahha Flutter Plugin

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:sahha_flutter/sahha_flutter.dart';
import 'package:sahha_flutter_example/Views/HomeView.dart';
import 'package:sahha_flutter_example/Views/AuthenticationView.dart';
import 'package:sahha_flutter_example/Views/ProfileView.dart';
import 'package:sahha_flutter_example/Views/SensorPermissionView.dart';
import 'package:sahha_flutter_example/Views/SleepView.dart';
import 'package:sahha_flutter_example/Views/PedometerView.dart';
import 'package:sahha_flutter_example/Views/AnalyzationView.dart';

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

class App extends StatefulWidget {
  const App({Key? key}) : super(key: key);

  @override
  State<App> createState() => AppState();
}

class AppState extends State<App> {
  @override
  void initState() {
    super.initState();

    // Use default values
    SahhaFlutter.configure(environment: SahhaEnvironment.sandbox)
        .then((success) => {debugPrint(success.toString())})
        .catchError((error, stackTrace) => {debugPrint(error.toString())});

/*
    // Android only
    var notificationSettings = {
      'icon': 'Custom Icon',
      'title': 'Custom Title',
      'shortDescription': 'Custom Description'
    };

    // Use custom values
    SahhaFlutter.configure(
            environment: SahhaEnvironment.production,
            sensors: [SahhaSensor.device],
            notificationSettings: notificationSettings)
        .then((success) => {debugPrint(success.toString())})
        .catchError((error, stackTrace) => {debugPrint(error.toString())});
        */
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      initialRoute: '/',
      routes: <String, WidgetBuilder>{
        '/': (BuildContext context) => const HomeView(),
        '/authentication': (BuildContext context) => const AuthenticationView(),
        '/profile': (BuildContext context) => const ProfileView(),
        '/permissions': (BuildContext context) => const SensorPermissionView(),
        '/analyzation': (BuildContext context) => const AnalyzationView(),
      },
    );
  }
}
0
likes
0
pub points
65%
popularity

Publisher

unverified uploader

Sahha Flutter Plugin

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

file, flutter

More

Packages that depend on sahha_flutter