|
|
|
|
import 'dart:developer';
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:logger/logger.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:queuing_system/core/api.dart';
|
|
|
|
|
import 'package:queuing_system/home/app_provider.dart';
|
|
|
|
|
import 'package:wakelock_plus/wakelock_plus.dart';
|
|
|
|
|
import 'core/config/size_config.dart';
|
|
|
|
|
import 'home/home_screen.dart';
|
|
|
|
|
|
|
|
|
|
Logger logger = Logger(
|
|
|
|
|
level: Level.debug,
|
|
|
|
|
printer: PrettyPrinter(
|
|
|
|
|
printEmojis: false,
|
|
|
|
|
colors: true,
|
|
|
|
|
printTime: false,
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
|
//TODO: WE HAVE TO UPDATE THIS BEFORE GOING LIVE.
|
|
|
|
|
HttpOverrides.global = MyHttpOverrides();
|
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
WakelockPlus.enable();
|
|
|
|
|
runApp(const MyApp());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//test commit
|
|
|
|
|
|
|
|
|
|
//TODO: WE NEED TO IMPLEMENT THE AVAILABILITY MONITORING OF THE SCREENS LIKE IF THEY ARE TURNED ON OR NOT!!
|
|
|
|
|
|
|
|
|
|
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 LayoutBuilder(
|
|
|
|
|
builder: (context, constraints) {
|
|
|
|
|
return OrientationBuilder(builder: (context, orientation) {
|
|
|
|
|
SizeConfig().init(constraints, orientation);
|
|
|
|
|
SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
|
|
|
|
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
|
|
|
|
|
|
|
|
|
|
return MultiProvider(
|
|
|
|
|
providers: [
|
|
|
|
|
ChangeNotifierProvider<AppProvider>(create: (context) => AppProvider()),
|
|
|
|
|
],
|
|
|
|
|
child: MaterialApp(
|
|
|
|
|
showSemanticsDebugger: false,
|
|
|
|
|
title: 'Doctors App',
|
|
|
|
|
theme: ThemeData(
|
|
|
|
|
primaryColor: Colors.grey,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
dividerColor: Colors.grey[350],
|
|
|
|
|
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.grey).copyWith(background: const Color.fromRGBO(255, 255, 255, 1)),
|
|
|
|
|
),
|
|
|
|
|
home: MyHomePage(),
|
|
|
|
|
debugShowCheckedModeBanner: false,
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|