import 'dart:convert';
import 'package:demo_app/screens/reset_pwd.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'login.dart';
import 'package:http/http.dart' as http;
class LandPage extends StatefulWidget {
@override
_LandPageState createState() => _LandPageState();
}
class _LandPageState extends State<LandPage> {
late SharedPreferences sharedPreferences;
var tokenValue = "";
var e;
var p;
@override
void initState() {
super.initState();
checkLoginStatus();
}
void fetchcredentials() async {
SharedPreferences pref = await SharedPreferences.getInstance();
e = pref.getString('email').toString();
p = pref.getString('pass').toString();
//print("Fetch Token Values : " + tokenValue);
}
checkLoginStatus() async {
sharedPreferences = await SharedPreferences.getInstance();
if (sharedPreferences.getString("id") == null) {
print('Logged out');
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(builder: (BuildContext context) => LoginPage()),
(Route<dynamic> route) => false);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Color(0xffffffff),
title: Text("Dash Board", style: TextStyle(color: Colors.white)),
actions: <Widget>[
// ignore: deprecated_member_use
FlatButton(
onPressed: () {
sharedPreferences.remove("email");
// ignore: deprecated_member_use
sharedPreferences.commit();
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (BuildContext context) => LoginPage()),
(Route<dynamic> route) => false);
},
child: Text("Log Out", style: TextStyle(color: Colors.black87)),
),
],
),
body: SizedBox(
height: 900,
width: MediaQuery.of(context).size.width / 0.60,
child: const WebView(
initialUrl:
'https://www.linkwork.in/Authenticate?id=49&enc=ef52f0c009bdbc905292c79b3f634ebe',
javascriptMode: JavascriptMode.unrestricted,
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
sharedPreferences.get("email");
},
),
);
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}