You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.7 KiB
Dart
65 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
import 'package:workinghours/widgets/tabsScreen.dart';
|
|
|
|
final theme = ThemeData(
|
|
useMaterial3: true,
|
|
colorScheme: ColorScheme.fromSeed(
|
|
brightness: Brightness.dark,
|
|
seedColor: const Color.fromARGB(255, 131, 57, 0),
|
|
),
|
|
textTheme: GoogleFonts.latoTextTheme(),
|
|
);
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
|
|
|
String? dbProtocol = prefs.getString('dbProtocol');
|
|
String? dbHost = prefs.getString('dbHost');
|
|
String? dbPath = prefs.getString('dbPath');
|
|
String? dbUser = prefs.getString('dbUser');
|
|
String? dbPassword = prefs.getString('dbPassword');
|
|
|
|
// if (dbProtocol == null) {
|
|
//prefs.setString('dbProtocol', 'http');
|
|
prefs.setString('dbProtocol', 'https');
|
|
// }
|
|
// if (dbHost == null) {
|
|
//prefs.setString('dbHost', '192.168.0.70');
|
|
prefs.setString('dbHost', 'api.windesign.at');
|
|
// }
|
|
// if (dbProtocol == null) {
|
|
// prefs.setString('dbProtocol', 'https');
|
|
// }
|
|
// if (dbHost == null) {
|
|
// prefs.setString('dbHost', 'api.windesign.at');
|
|
// }
|
|
if (dbPath == null) {
|
|
prefs.setString('dbPath', '/workinghours.php');
|
|
}
|
|
if (dbUser == null) {
|
|
prefs.setString('dbUser', '');
|
|
}
|
|
if (dbPassword == null) {
|
|
prefs.setString('dbPassword', '');
|
|
}
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
// theme: theme,
|
|
title: 'Multimedia',
|
|
home: const TabsScreen(),
|
|
);
|
|
}
|
|
}
|