import 'package:fitnessapp/Views/homescreen.dart'; import 'package:fitnessapp/Views/login_view.dart'; import 'package:fitnessapp/Views/new_workout_view.dart'; import 'package:flutter/material.dart'; import 'dart:async'; import 'package:shared_preferences/shared_preferences.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); SharedPreferences prefs = await SharedPreferences.getInstance(); String apiKey = await prefs.getString('api_key'); runApp(MaterialApp( title: 'Flutter Demo', theme: ThemeData( // Define the default brightness and colors. brightness: Brightness.dark, primaryColor: Colors.lightBlue[800], accentColor: Colors.cyan[600], // Define the default font family. fontFamily: 'Verdana', // Define the default TextTheme. Use this to specify the default // text styling for headlines, titles, bodies of text, and more. textTheme: TextTheme( headline: TextStyle(fontSize: 72.0, fontWeight: FontWeight.bold), title: TextStyle(fontSize: 36.0, fontStyle: FontStyle.italic), body1: TextStyle(fontSize: 14.0, fontFamily: 'Verdana'), ), ), home: apiKey == null ? LoginView() : HomescreenView(apiKey), ) ); }