Compare commits
2 Commits
02bce8318a
...
577801423d
| Author | SHA1 | Date | |
|---|---|---|---|
| 577801423d | |||
| a97ec0411d |
@ -166,8 +166,7 @@ class _CreateBusinessDetailState extends State<BusinessDetail> {
|
|||||||
.replaceAll('www.', ''),
|
.replaceAll('www.', ''),
|
||||||
style: const TextStyle(color: Colors.blue)),
|
style: const TextStyle(color: Colors.blue)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
launchUrl(
|
launchUrl(Uri.parse(business.website!));
|
||||||
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('https://${business.website}'));
|
launchUrl(Uri.parse(business.website!));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|||||||
@ -247,6 +247,7 @@ 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('https://${listing.link!}'));
|
launchUrl(Uri.parse(listing.link!));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -151,7 +151,8 @@ class _JobsOverviewState extends State<JobsOverview> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_isRetrying = true;
|
_isRetrying = true;
|
||||||
});
|
});
|
||||||
await widget.updateBusinessesCallback(null, null);
|
await widget.updateBusinessesCallback(
|
||||||
|
null, null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -592,8 +593,7 @@ class _JobHeaderState extends State<_JobHeader> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.link),
|
icon: const Icon(Icons.link),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launchUrl(Uri.parse(
|
launchUrl(Uri.parse(business.listings![0].link!));
|
||||||
'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: 475,
|
height: 450,
|
||||||
width: 500,
|
width: 500,
|
||||||
child: Card(
|
child: Card(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@ -60,9 +60,12 @@ class _SignInPageState extends State<SignInPage> {
|
|||||||
controller: _usernameController,
|
controller: _usernameController,
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
prefixIcon: Icon(Icons.person_outline),
|
prefixIcon: Padding(
|
||||||
labelText: 'Username',
|
padding: EdgeInsets.all(16.0),
|
||||||
border: OutlineInputBorder()),
|
child: Icon(Icons.person_outline),
|
||||||
|
),
|
||||||
|
labelText: 'Username',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@ -107,11 +110,13 @@ class _SignInPageState extends State<SignInPage> {
|
|||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
obscureText: obscurePassword,
|
obscureText: obscurePassword,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
prefixIcon: const Icon(Icons.fingerprint),
|
prefixIcon: const Padding(
|
||||||
|
padding: EdgeInsets.all(16.0),
|
||||||
|
child: Icon(Icons.fingerprint),
|
||||||
|
),
|
||||||
labelText: 'Password',
|
labelText: 'Password',
|
||||||
border: const OutlineInputBorder(),
|
|
||||||
suffixIcon: Padding(
|
suffixIcon: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.only(right: 16.0),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -131,63 +136,110 @@ class _SignInPageState extends State<SignInPage> {
|
|||||||
errorMessage!,
|
errorMessage!,
|
||||||
style: const TextStyle(color: Colors.red),
|
style: const TextStyle(color: Colors.red),
|
||||||
),
|
),
|
||||||
CheckboxListTile(
|
Padding(
|
||||||
value: rememberMe,
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
onChanged: (value) async {
|
child: FilledButton(
|
||||||
setState(() {
|
style: FilledButton.styleFrom(
|
||||||
rememberMe = value!;
|
shape: const RoundedRectangleBorder(
|
||||||
});
|
borderRadius:
|
||||||
},
|
BorderRadius.all(Radius.circular(6)))),
|
||||||
title: const Text('Remember me'),
|
child: SizedBox(
|
||||||
),
|
width: 374,
|
||||||
ElevatedButton.icon(
|
height: 40,
|
||||||
style: ElevatedButton.styleFrom(
|
child: Row(
|
||||||
backgroundColor:
|
mainAxisSize: MainAxisSize.min,
|
||||||
Theme.of(context).colorScheme.primary,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
// padding: const EdgeInsets.only(left: 20.0, right: 20.0, top: 12.0, bottom: 12.0),
|
children: [
|
||||||
),
|
_isloading
|
||||||
icon: _isloading
|
? Padding(
|
||||||
? const SizedBox(
|
padding: EdgeInsets.only(right: 8.0),
|
||||||
width: 20,
|
child: const SizedBox(
|
||||||
height: 20,
|
width: 20,
|
||||||
child: CircularProgressIndicator(
|
height: 20,
|
||||||
color: Colors.white,
|
child: CircularProgressIndicator(
|
||||||
strokeWidth: 3,
|
color: Colors.white,
|
||||||
))
|
strokeWidth: 3,
|
||||||
: const Icon(Icons.done, color: Colors.white),
|
)),
|
||||||
label: const Text('Sign In',
|
)
|
||||||
style: TextStyle(color: Colors.white)),
|
: const Padding(
|
||||||
onPressed: () async {
|
padding: EdgeInsets.only(right: 8.0),
|
||||||
setState(() {
|
child: Icon(Icons.done,
|
||||||
errorMessage = null;
|
color: Colors.white),
|
||||||
_isloading = true;
|
),
|
||||||
});
|
const Text('Sign in',
|
||||||
jwt = await signIn(username, password).timeout(
|
style: TextStyle(
|
||||||
const Duration(seconds: 20), onTimeout: () {
|
color: Colors.white, fontSize: 18)),
|
||||||
_isloading = false;
|
],
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
),
|
||||||
const SnackBar(
|
),
|
||||||
width: 300,
|
onPressed: () async {
|
||||||
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(() {
|
setState(() {
|
||||||
errorMessage = 'Invalid Username/Password';
|
_isloading = true;
|
||||||
_isloading = false;
|
|
||||||
});
|
});
|
||||||
}
|
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(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.bottomLeft,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
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;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user