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.
118 lines
4.1 KiB
Dart
118 lines
4.1 KiB
Dart
|
2 months ago
|
import 'dart:async';
|
||
|
|
import 'dart:convert';
|
||
|
|
import 'dart:io';
|
||
|
|
|
||
|
|
import 'package:flutter/foundation.dart';
|
||
|
|
import 'package:flutter/material.dart';
|
||
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
||
|
|
import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart';
|
||
|
|
import 'package:hmg_patient_app_new/presentation/home/landing_page.dart';
|
||
|
|
import 'package:provider/provider.dart';
|
||
|
|
|
||
|
|
import 'core/utils/LocalNotification.dart';
|
||
|
|
import 'core/utils/push-notification-handler.dart';
|
||
|
|
|
||
|
|
class SplashPage extends StatefulWidget {
|
||
|
|
@override
|
||
|
|
_SplashScreenState createState() => _SplashScreenState();
|
||
|
|
}
|
||
|
|
|
||
|
|
class _SplashScreenState extends State<SplashPage> {
|
||
|
|
@override
|
||
|
|
void initState() {
|
||
|
|
super.initState();
|
||
|
|
print("Splash init called.............");
|
||
|
|
Timer(Duration(seconds: 1, milliseconds: 500), () async {
|
||
|
|
LocalNotification.init(onNotificationClick: (payload) {});
|
||
|
|
Navigator.of(context).pushReplacement(
|
||
|
|
MaterialPageRoute(
|
||
|
|
builder: (BuildContext context) => LandingPage(),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
// } else {}
|
||
|
|
});
|
||
|
|
// },
|
||
|
|
// );
|
||
|
|
|
||
|
|
var zoom = ZoomVideoSdk();
|
||
|
|
InitConfig initConfig = InitConfig(
|
||
|
|
domain: "zoom.us",
|
||
|
|
enableLog: true,
|
||
|
|
);
|
||
|
|
zoom.initSdk(initConfig);
|
||
|
|
|
||
|
|
// AppSharedPreferences().getAll().then((value) {
|
||
|
|
// debugPrint("ALL SHARED PREFERENCES!!!!!");
|
||
|
|
// debugPrint(jsonEncode(value));
|
||
|
|
// });
|
||
|
|
}
|
||
|
|
|
||
|
|
/// load the Privilege from service
|
||
|
|
Future loadPrivilege() async {
|
||
|
|
// ProjectViewModel projectProvider = Provider.of<ProjectViewModel>(context, listen: false);
|
||
|
|
// projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList);
|
||
|
|
// projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel);
|
||
|
|
// projectProvider.setHMCProjectList(_privilegeService.hMCProjectListModel);
|
||
|
|
// projectProvider.setProjectsDetailList(_privilegeService.projectDetailListModel);
|
||
|
|
// double lat = await AppSharedPreferences().getDouble(USER_LAT) ?? 0.0;
|
||
|
|
// double long = await AppSharedPreferences().getDouble(USER_LONG) ?? 0.0;
|
||
|
|
// AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch
|
||
|
|
// await AppSharedPreferences().setDouble(USER_LAT, lat);
|
||
|
|
// await AppSharedPreferences().setDouble(USER_LONG, long);
|
||
|
|
// AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en");
|
||
|
|
// var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);
|
||
|
|
// themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins'));
|
||
|
|
PushNotificationHandler().init(context); // Asyncronously
|
||
|
|
}
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return Scaffold(
|
||
|
|
backgroundColor: Color(0xffF8F8F8),
|
||
|
|
body: Stack(
|
||
|
|
alignment: Alignment.center,
|
||
|
|
children: [
|
||
|
|
Padding(
|
||
|
|
padding: EdgeInsets.symmetric(horizontal: 53),
|
||
|
|
child: Image.asset(
|
||
|
|
'assets/images/new/hmg_logo.png',
|
||
|
|
fit: BoxFit.fitWidth,
|
||
|
|
width: MediaQuery.of(context).size.width,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
Align(
|
||
|
|
alignment: Alignment.bottomCenter,
|
||
|
|
child: Column(
|
||
|
|
mainAxisSize: MainAxisSize.min,
|
||
|
|
children: [
|
||
|
|
Text(
|
||
|
|
"Powered by",
|
||
|
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xff333C45), letterSpacing: -0.56, height: 16 / 14),
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 5,
|
||
|
|
),
|
||
|
|
SvgPicture.asset(
|
||
|
|
'assets/images/new/cloud_logo.svg',
|
||
|
|
width: 40,
|
||
|
|
height: 40,
|
||
|
|
),
|
||
|
|
SizedBox(
|
||
|
|
height: 7,
|
||
|
|
),
|
||
|
|
// Text(
|
||
|
|
// "Version 1.1.0",
|
||
|
|
// style: TextStyle(fontSize: 10, fontWeight: FontWeight.w400, color: Color(0xff3989898), letterSpacing: 0, height: 12 / 10),
|
||
|
|
// ),
|
||
|
|
SizedBox(
|
||
|
|
height: 18,
|
||
|
|
)
|
||
|
|
],
|
||
|
|
),
|
||
|
|
)
|
||
|
|
],
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|