Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh indicator #190

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ANDROID_MAP_API_KEY=<your_android_google_maps_api_key>
IOS_MAP_API_KEY=<your_ios_google_maps_api_key>
HTTP_ENDPOINT=<server's_HTTP_endpoint>(for example: https://beacon.aadibajpai.com/graphql)
WEBSOCKET_ENDPOINT=<server's_websocket_endpoint>(for example: wss://beacon.aadibajpai.com/subscriptions)
HTTP_ENDPOINT=<servers_HTTP_endpoint>(for example: https://beacon.aadibajpai.com/graphql)>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the exact change over here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bit of formatting issue here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this would be a required change. For any formatting issue, the command you ran for the previous commit, would have edited itself.

WEBSOCKET_ENDPOINT=<servers_websocket_endpoint>(for example: wss://beacon.aadibajpai.com/subscriptions)>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here

Copy link
Author

@Rushour0 Rushour0 Mar 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bit of formatting issue here too
The single quote was causing issue, so just kinda did it out of formatting purpose

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this be necessary? Can you show me the error without this change? As it didn't pose any problem with my app or runtime.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates @Rushour0?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry my bad, didnt see this conversation later on

image

The formatting issue was about the .env.example having a string in it like the image attached above vs how it looks now

image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was an extremely minor change but, felt like it would just make the .env.example look better?

2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply from: project(':flutter_config').projectDir.getPath() + "/dotenv.gradle"

android {
compileSdkVersion 31
compileSdkVersion 33
buildToolsVersion '29.0.0'

sourceSets {
Expand Down
Binary file modified android/app/src/main/res/drawable/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions lib/components/reloading_icon.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import 'package:beacon/utilities/constants.dart';
import 'package:flutter/material.dart';

class ReloadIcon extends StatefulWidget {
const ReloadIcon({Key key}) : super(key: key);

@override
State<ReloadIcon> createState() => _ReloadIconState();
}

class _ReloadIconState extends State<ReloadIcon> with TickerProviderStateMixin {
AnimationController _animation;
@override
void initState() {
super.initState();
_animation = AnimationController(
vsync: this,
duration: Duration(seconds: 10),
upperBound: 1,
)..repeat();
}

@override
void dispose() {
_animation.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
_animation..forward();
return RotationTransition(
turns: Tween(begin: 0.0, end: 10.0).animate(_animation),
child: Transform.rotate(
angle: 0.5,
child: Icon(
Icons.refresh,
color: kBlue,
size: 30,
),
),
);
}
}
199 changes: 108 additions & 91 deletions lib/views/auth_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,83 +202,88 @@ class _AuthScreenState extends State<AuthScreen>
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Card(
elevation: 2.0,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
child: Form(
key: model.formKeyLogin,
autovalidateMode: model.loginValidate,
child: Container(
width: screensize.width - 70,
child: Column(
children: <Widget>[
Container(
height: 13.h,
padding: EdgeInsets.symmetric(
horizontal: 10, vertical: 10.0),
child: TextFormField(
autovalidateMode: model.loginValidate,
focusNode: model.emailLogin,
controller: model.loginEmailController,
validator: (value) =>
Validator.validateEmail(value.trimRight()),
keyboardType: TextInputType.emailAddress,
style: TextStyle(fontSize: 16.0, color: Colors.black),
decoration: InputDecoration(
border: InputBorder.none,
icon: Icon(
Icons.mail_outline,
color: Colors.black,
size: 24.0,
),
hintText: "Email Address",
hintStyle: TextStyle(
fontSize: hintsize - 2, color: hintColor),
Form(
key: model.formKeyLogin,
autovalidateMode: model.loginValidate,
child: Wrap(
children: [
Card(
elevation: 2.0,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(screensize.width / 20),
),
child: Container(
// height: 13.h,
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: TextFormField(
autovalidateMode: model.loginValidate,
focusNode: model.emailLogin,
controller: model.loginEmailController,
validator: (value) =>
Validator.validateEmail(value.trimRight()),
keyboardType: TextInputType.emailAddress,
style: TextStyle(fontSize: 16.0, color: Colors.black),
decoration: InputDecoration(
border: InputBorder.none,
icon: Icon(
Icons.mail_outline,
color: Colors.black,
size: 24.0,
),
hintText: "Email Address",
hintStyle: TextStyle(
fontSize: hintsize - 2, color: hintColor),
),
),
separator(),
Container(
height: 13.h,
padding: EdgeInsets.symmetric(
horizontal: 10, vertical: 10.0),
child: TextFormField(
autovalidateMode: model.loginValidate,
focusNode: model.passwordLogin,
controller: model.loginPasswordController,
obscureText: model.obscureTextLogin,
validator: (value) =>
Validator.validatePassword(value),
style: TextStyle(fontSize: 16.0, color: Colors.black),
decoration: InputDecoration(
border: InputBorder.none,
),
),
Card(
elevation: 2.0,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(screensize.width / 20),
),
child: Container(
padding:
EdgeInsets.symmetric(horizontal: 10, vertical: 10.0),
child: TextFormField(
autovalidateMode: model.loginValidate,
focusNode: model.passwordLogin,
controller: model.loginPasswordController,
obscureText: model.obscureTextLogin,
validator: (value) => Validator.validatePassword(value),
style: TextStyle(fontSize: 16.0, color: Colors.black),
decoration: InputDecoration(
border: InputBorder.none,
icon: Icon(
Icons.lock,
size: 24.0,
color: Colors.black,
),
hintText: "Password",
hintStyle: TextStyle(
fontSize: hintsize - 2, color: hintColor),
suffixIcon: IconButton(
onPressed: () => model.displayPasswordLogin(),
icon: Icon(
Icons.lock,
size: 24.0,
model.obscureTextLogin
? Icons.visibility
: Icons.visibility_off,
size: 20.0,
color: Colors.black,
),
hintText: "Password",
hintStyle: TextStyle(
fontSize: hintsize - 2, color: hintColor),
suffixIcon: IconButton(
onPressed: () => model.displayPasswordLogin(),
icon: Icon(
model.obscureTextLogin
? Icons.visibility
: Icons.visibility_off,
size: 20.0,
color: Colors.black,
),
),
),
),
),
],
),
),
),
],
),
),
SizedBox(
Expand All @@ -292,7 +297,7 @@ class _AuthScreenState extends State<AuthScreen>
padding: EdgeInsets.only(
left: 15.0, right: 15.0, top: 15.0, bottom: 15.0),
child: Text(
"Or",
"OR",
style: TextStyle(
color: Colors.black,
fontSize: 16.0,
Expand All @@ -316,21 +321,21 @@ class _AuthScreenState extends State<AuthScreen>
padding: EdgeInsets.only(top: 3.h, left: 8.5.w, right: 8.5.w),
child: Column(
children: <Widget>[
Card(
elevation: 2.0,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
child: Form(
key: model.formKeySignup,
autovalidateMode: model.signupValidate,
child: Container(
width: screensize.width - 70,
// height: 280.0,
child: Column(children: <Widget>[
Container(
height: 13.h,
Form(
key: model.formKeySignup,
autovalidateMode: model.signupValidate,
child: Container(
width: screensize.width - 70,
// height: 280.0,
child: Column(children: <Widget>[
Card(
elevation: 2,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(screensize.width / 20),
),
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10, vertical: 10.0),
child: TextFormField(
Expand All @@ -355,9 +360,15 @@ class _AuthScreenState extends State<AuthScreen>
),
),
),
separator(),
Container(
height: 13.h,
),
Card(
elevation: 2,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(screensize.width / 20),
),
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10, vertical: 10.0),
child: TextFormField(
Expand All @@ -381,9 +392,15 @@ class _AuthScreenState extends State<AuthScreen>
),
),
),
separator(),
Container(
height: 13.h,
),
Card(
elevation: 2,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(screensize.width / 20),
),
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10, vertical: 10.0),
child: TextFormField(
Expand Down Expand Up @@ -418,8 +435,8 @@ class _AuthScreenState extends State<AuthScreen>
),
),
),
])),
),
),
])),
),
SizedBox(
height: 3.5.h,
Expand Down
Loading