update
This commit is contained in:
@@ -8,7 +8,6 @@ import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../PinCodeVadidate.dart';
|
||||
import '../Register/register_data.dart';
|
||||
import '../api/api.dart';
|
||||
import '../model/token_model.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
@@ -41,13 +40,9 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
|
||||
Future<void> getProfile() async {
|
||||
Api.get(context, Api.profile).then((value) =>
|
||||
{
|
||||
if (value != null) {
|
||||
initProfile()
|
||||
} else
|
||||
{clearProfile()}
|
||||
});
|
||||
Api.get(context, Api.profile).then((value) => {
|
||||
if (value != null) {initProfile()} else {clearProfile()}
|
||||
});
|
||||
}
|
||||
|
||||
initProfile() async {
|
||||
@@ -69,9 +64,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
|
||||
refresh() {
|
||||
setState(() {
|
||||
|
||||
});
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
String version = "";
|
||||
@@ -90,15 +83,11 @@ class _LoginPageState extends State<LoginPage> {
|
||||
return Scaffold(
|
||||
body: Stack(children: <Widget>[
|
||||
Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
height: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.height,
|
||||
child: Container(color: Colors.white,),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
@@ -124,10 +113,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -168,8 +154,15 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
refresh();
|
||||
},
|
||||
child: context.locale.toString() == "th"?Image.asset("images/home/lang_1.png",width: 80,):Image.asset("images/home/lang_2.png",width: 80,)
|
||||
)
|
||||
child: context.locale.toString() == "th"
|
||||
? Image.asset(
|
||||
"images/home/lang_1.png",
|
||||
width: 80,
|
||||
)
|
||||
: Image.asset(
|
||||
"images/home/lang_2.png",
|
||||
width: 80,
|
||||
))
|
||||
],
|
||||
)),
|
||||
Spacer(),
|
||||
@@ -177,41 +170,29 @@ class _LoginPageState extends State<LoginPage> {
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/LoginValidate');
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
border: Border.all(
|
||||
color: Color(0xff9d001b),
|
||||
width: 1,
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
side: BorderSide(color: ColorCustom.red, width: 1)
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
child: Text(
|
||||
"Log In".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Color(0xff9d001b),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Log In".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: ColorCustom.red,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
InkWell(
|
||||
@@ -229,36 +210,25 @@ class _LoginPageState extends State<LoginPage> {
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Color(0xffd0315a),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
child: Text(
|
||||
"Register".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Register".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.kanit(
|
||||
color: ColorCustom.red,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user