import 'dart:io';

import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'datamodel.dart';
import 'addevent.dart';
import 'viewevents.dart';
import 'overview.dart';
import 'configuration.dart';

Future<void> pathstuff() async {


  //Directory downloadsDirectory = await DownloadsPathProvider.downloadsDirectory;

  //Directory appDocDir = await getApplicationDocumentsDirectory();




  //debugPrint(appDocDir.path.toString());
}

void main() {


  //pathstuff();





  EventStoreInstance events = EventStoreInstance();
  final ConfigurationStoreInstance configuration = ConfigurationStoreInstance();

  //Reset old data
  events.reset();  // TODO: load configuration and events from shared preferences.
  configuration.reset();

  configuration.loginInformation.mail = 'admin';  // Sandbox.sensor.de  admin account
  configuration.loginInformation.password ='adminadmin';  //TODO: replace for productive version.


  runApp(MaterialApp(
    title: 'Mobile Event Log',
    theme: ThemeData(
      primarySwatch: Colors.blue,
    ),
    initialRoute: '/',
    routes: {
      '/': (context) => Overview(),
      '/second': (context) => const AddEvent(),
      '/third': (context) => const ViewEvents(),
      '/forth': (context) => const Configuration(),
    },
  ));
}