Compare commits
No commits in common. "577801423d83860afc614584e3034cda9fca7fdc" and "02bce8318af08a342c77ecffd139f74edfa6c649" have entirely different histories.
577801423d
...
02bce8318a
@ -166,7 +166,8 @@ class _CreateBusinessDetailState extends State<BusinessDetail> {
|
|||||||
.replaceAll('www.', ''),
|
.replaceAll('www.', ''),
|
||||||
style: const TextStyle(color: Colors.blue)),
|
style: const TextStyle(color: Colors.blue)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
launchUrl(Uri.parse(business.website!));
|
launchUrl(
|
||||||
|
Uri.parse('https://${business.website}'));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -513,7 +513,7 @@ class _BusinessHeaderState extends State<_BusinessHeader> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.link),
|
icon: const Icon(Icons.link),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launchUrl(Uri.parse(business.website!));
|
launchUrl(Uri.parse('https://${business.website}'));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|||||||
@ -247,7 +247,6 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
|||||||
),
|
),
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value != null &&
|
if (value != null &&
|
||||||
value.isNotEmpty &&
|
|
||||||
!RegExp(r'(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?:/[^/\s]*)*')
|
!RegExp(r'(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?:/[^/\s]*)*')
|
||||||
.hasMatch(value)) {
|
.hasMatch(value)) {
|
||||||
return 'Enter a valid Website';
|
return 'Enter a valid Website';
|
||||||
|
|||||||
@ -123,7 +123,7 @@ class _CreateBusinessDetailState extends State<JobListingDetail> {
|
|||||||
.replaceAll('www.', ''),
|
.replaceAll('www.', ''),
|
||||||
style: const TextStyle(color: Colors.blue)),
|
style: const TextStyle(color: Colors.blue)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
launchUrl(Uri.parse(listing.link!));
|
launchUrl(Uri.parse('https://${listing.link!}'));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -151,8 +151,7 @@ class _JobsOverviewState extends State<JobsOverview> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_isRetrying = true;
|
_isRetrying = true;
|
||||||
});
|
});
|
||||||
await widget.updateBusinessesCallback(
|
await widget.updateBusinessesCallback(null, null);
|
||||||
null, null);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -593,7 +592,8 @@ class _JobHeaderState extends State<_JobHeader> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.link),
|
icon: const Icon(Icons.link),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launchUrl(Uri.parse(business.listings![0].link!));
|
launchUrl(Uri.parse(
|
||||||
|
'https://${business.listings![0].link!}'));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class _SignInPageState extends State<SignInPage> {
|
|||||||
heightFactor: 1.0,
|
heightFactor: 1.0,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.fromLTRB(12, 50, 12, 50),
|
padding: const EdgeInsets.fromLTRB(12, 50, 12, 50),
|
||||||
height: 450,
|
height: 475,
|
||||||
width: 500,
|
width: 500,
|
||||||
child: Card(
|
child: Card(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@ -60,12 +60,9 @@ class _SignInPageState extends State<SignInPage> {
|
|||||||
controller: _usernameController,
|
controller: _usernameController,
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
prefixIcon: Padding(
|
prefixIcon: Icon(Icons.person_outline),
|
||||||
padding: EdgeInsets.all(16.0),
|
labelText: 'Username',
|
||||||
child: Icon(Icons.person_outline),
|
border: OutlineInputBorder()),
|
||||||
),
|
|
||||||
labelText: 'Username',
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@ -110,13 +107,11 @@ class _SignInPageState extends State<SignInPage> {
|
|||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
obscureText: obscurePassword,
|
obscureText: obscurePassword,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
prefixIcon: const Padding(
|
prefixIcon: const Icon(Icons.fingerprint),
|
||||||
padding: EdgeInsets.all(16.0),
|
|
||||||
child: Icon(Icons.fingerprint),
|
|
||||||
),
|
|
||||||
labelText: 'Password',
|
labelText: 'Password',
|
||||||
|
border: const OutlineInputBorder(),
|
||||||
suffixIcon: Padding(
|
suffixIcon: Padding(
|
||||||
padding: const EdgeInsets.only(right: 16.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -136,110 +131,63 @@ class _SignInPageState extends State<SignInPage> {
|
|||||||
errorMessage!,
|
errorMessage!,
|
||||||
style: const TextStyle(color: Colors.red),
|
style: const TextStyle(color: Colors.red),
|
||||||
),
|
),
|
||||||
Padding(
|
CheckboxListTile(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
value: rememberMe,
|
||||||
child: FilledButton(
|
onChanged: (value) async {
|
||||||
style: FilledButton.styleFrom(
|
setState(() {
|
||||||
shape: const RoundedRectangleBorder(
|
rememberMe = value!;
|
||||||
borderRadius:
|
});
|
||||||
BorderRadius.all(Radius.circular(6)))),
|
},
|
||||||
child: SizedBox(
|
title: const Text('Remember me'),
|
||||||
width: 374,
|
|
||||||
height: 40,
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
_isloading
|
|
||||||
? Padding(
|
|
||||||
padding: EdgeInsets.only(right: 8.0),
|
|
||||||
child: const SizedBox(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
child: CircularProgressIndicator(
|
|
||||||
color: Colors.white,
|
|
||||||
strokeWidth: 3,
|
|
||||||
)),
|
|
||||||
)
|
|
||||||
: const Padding(
|
|
||||||
padding: EdgeInsets.only(right: 8.0),
|
|
||||||
child: Icon(Icons.done,
|
|
||||||
color: Colors.white),
|
|
||||||
),
|
|
||||||
const Text('Sign in',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white, fontSize: 18)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
setState(() {
|
|
||||||
_isloading = true;
|
|
||||||
});
|
|
||||||
jwt = await signIn(username, password).timeout(
|
|
||||||
const Duration(seconds: 20), onTimeout: () {
|
|
||||||
_isloading = false;
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
const SnackBar(
|
|
||||||
width: 300,
|
|
||||||
behavior: SnackBarBehavior.floating,
|
|
||||||
content:
|
|
||||||
Text('Could not Sign in (timeout)!')),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
if (!jwt.contains('Error:')) {
|
|
||||||
final SharedPreferences prefs =
|
|
||||||
await SharedPreferences.getInstance();
|
|
||||||
await prefs.setString('username', username);
|
|
||||||
await prefs.setString('password', password);
|
|
||||||
await prefs.setBool('rememberMe', rememberMe);
|
|
||||||
widget.refreshAccount(true);
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
} else {
|
|
||||||
setState(() {
|
|
||||||
errorMessage = 'Invalid Username/Password';
|
|
||||||
_isloading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
ElevatedButton.icon(
|
||||||
child: Align(
|
style: ElevatedButton.styleFrom(
|
||||||
alignment: Alignment.bottomLeft,
|
backgroundColor:
|
||||||
child: Row(
|
Theme.of(context).colorScheme.primary,
|
||||||
children: [
|
// padding: const EdgeInsets.only(left: 20.0, right: 20.0, top: 12.0, bottom: 12.0),
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
|
||||||
child: MouseRegion(
|
|
||||||
cursor: SystemMouseCursors.click,
|
|
||||||
child: GestureDetector(
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Checkbox(
|
|
||||||
value: rememberMe,
|
|
||||||
onChanged: (value) {
|
|
||||||
setState(() {
|
|
||||||
rememberMe = value!;
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.all(8.0),
|
|
||||||
child: Text('Remember me'),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
setState(() {
|
|
||||||
rememberMe = !rememberMe;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
icon: _isloading
|
||||||
|
? const SizedBox(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
color: Colors.white,
|
||||||
|
strokeWidth: 3,
|
||||||
|
))
|
||||||
|
: const Icon(Icons.done, color: Colors.white),
|
||||||
|
label: const Text('Sign In',
|
||||||
|
style: TextStyle(color: Colors.white)),
|
||||||
|
onPressed: () async {
|
||||||
|
setState(() {
|
||||||
|
errorMessage = null;
|
||||||
|
_isloading = true;
|
||||||
|
});
|
||||||
|
jwt = await signIn(username, password).timeout(
|
||||||
|
const Duration(seconds: 20), onTimeout: () {
|
||||||
|
_isloading = false;
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
width: 300,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
content:
|
||||||
|
Text('Could not Sign in (timeout)!')),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
if (!jwt.contains('Error:')) {
|
||||||
|
final SharedPreferences prefs =
|
||||||
|
await SharedPreferences.getInstance();
|
||||||
|
await prefs.setString('username', username);
|
||||||
|
await prefs.setString('password', password);
|
||||||
|
await prefs.setBool('rememberMe', rememberMe);
|
||||||
|
widget.refreshAccount(true);
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
errorMessage = 'Invalid Username/Password';
|
||||||
|
_isloading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user