Skip to content

Commit d3561b4

Browse files
authored
Merge pull request #2404 from airqo-platform/staging
move to production
2 parents 87212ef + fa361ca commit d3561b4

File tree

14 files changed

+498
-136
lines changed

14 files changed

+498
-136
lines changed

k8s/platform/values-prod.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ replicaCount: 1
22
image:
33
repository: eu.gcr.io/airqo-250220/airqo-next-platform
44
pullPolicy: Always
5-
tag: prod-48adfeaa-1737641861
5+
tag: prod-87212ef4-1737696175
66
imagePullSecrets: []
77
nameOverride: ''
88
fullnameOverride: ''
+3
Loading

mobile-v3/assets/images/shared/Frame 26085560.svg

+36
Loading

mobile-v3/lib/main.dart

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import 'package:airqo/src/app/other/places/repository/google_places_repository.d
1616
import 'package:airqo/src/app/other/theme/bloc/theme_bloc.dart';
1717
import 'package:airqo/src/app/other/theme/repository/theme_repository.dart';
1818
import 'package:airqo/src/app/profile/bloc/user_bloc.dart';
19+
import 'package:airqo/src/app/profile/pages/guest_profile%20page.dart';
1920
import 'package:airqo/src/app/profile/repository/user_repository.dart';
2021
import 'package:airqo/src/app/shared/bloc/connectivity_bloc.dart';
2122
import 'package:airqo/src/app/shared/pages/nav_page.dart';

mobile-v3/lib/src/app/auth/bloc/auth_bloc.dart

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
4141
),
4242
);
4343
}
44+
} else if (event is UseAsGuest) {
45+
emit(GuestUser());
4446
}
4547
});
4648
}

mobile-v3/lib/src/app/auth/bloc/auth_event.dart

+4
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ class RegisterUser extends AuthEvent {
1919

2020
const RegisterUser(this.model);
2121
}
22+
23+
class UseAsGuest extends AuthEvent {
24+
const UseAsGuest();
25+
}

mobile-v3/lib/src/app/auth/bloc/auth_state.dart

+3
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ class AuthLoadingError extends AuthState {
2424
}
2525

2626
enum AuthPurpose { LOGIN, REGISTER }
27+
28+
final class GuestUser extends AuthState {}
29+

mobile-v3/lib/src/app/auth/pages/welcome_screen.dart

+116-86
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ import 'package:airqo/src/app/auth/widgets/know_your_air.dart';
55
import 'package:airqo/src/app/auth/widgets/welcome_widget.dart';
66
import 'package:airqo/src/meta/utils/colors.dart';
77
import 'package:flutter/material.dart';
8+
import 'package:flutter_bloc/flutter_bloc.dart';
9+
import 'package:flutter_svg/flutter_svg.dart';
810
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
911

12+
import '../../shared/pages/nav_page.dart';
13+
import '../bloc/auth_bloc.dart';
14+
1015
class WelcomeScreen extends StatefulWidget {
1116
const WelcomeScreen({super.key});
1217

@@ -38,101 +43,126 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
3843

3944
@override
4045
Widget build(BuildContext context) {
41-
return Scaffold(
42-
body: Column(
43-
children: [
44-
Stack(
45-
children: [
46-
SizedBox(
47-
height: MediaQuery.of(context).size.height * 0.6,
48-
child: PageView(
49-
controller: controller,
50-
onPageChanged: changeIndex,
51-
children: [
52-
WelcomeWidget(),
53-
BreatheClean(),
54-
KnowYourAir(),
55-
],
46+
return BlocListener<AuthBloc, AuthState>(
47+
listener: (context, state) {
48+
if (state is GuestUser) {
49+
Future.microtask(() => Navigator.of(context).pushReplacement(
50+
MaterialPageRoute(builder: (context) => NavPage()),
51+
));
52+
}
53+
},
54+
child: Scaffold(
55+
body: Column(
56+
children: [
57+
Stack(
58+
children: [
59+
SizedBox(
60+
height: MediaQuery.of(context).size.height * 0.6,
61+
child: PageView(
62+
controller: controller,
63+
onPageChanged: changeIndex,
64+
children: [
65+
WelcomeWidget(),
66+
BreatheClean(),
67+
KnowYourAir(),
68+
],
69+
),
5670
),
57-
),
58-
Container(
59-
width: double.infinity,
60-
height: MediaQuery.of(context).size.height * 0.6,
61-
child: Column(
62-
mainAxisAlignment: MainAxisAlignment.end,
63-
children: [
64-
AnimatedSmoothIndicator(
65-
activeIndex: currentIndex,
66-
count: 3,
67-
effect: ExpandingDotsEffect(
68-
dotWidth: 7,
69-
radius: 7,
70-
dotColor: Color(0xff60646C),
71-
// activeDotColor: Color(0xffF6F6F7),
72-
activeDotColor: AppColors.primaryColor,
73-
dotHeight: 7),
74-
),
75-
SizedBox(height: 16)
76-
],
71+
Container(
72+
width: double.infinity,
73+
height: MediaQuery.of(context).size.height * 0.6,
74+
child: Column(
75+
mainAxisAlignment: MainAxisAlignment.end,
76+
children: [
77+
AnimatedSmoothIndicator(
78+
activeIndex: currentIndex,
79+
count: 3,
80+
effect: ExpandingDotsEffect(
81+
dotWidth: 7,
82+
radius: 7,
83+
dotColor: Color(0xff60646C),
84+
// activeDotColor: Color(0xffF6F6F7),
85+
activeDotColor: AppColors.primaryColor,
86+
dotHeight: 7),
87+
),
88+
SizedBox(height: 16)
89+
],
90+
),
7791
),
78-
),
79-
],
80-
),
81-
SizedBox(
82-
height: MediaQuery.of(context).size.height * 0.4,
83-
child: Padding(
84-
padding: const EdgeInsets.symmetric(horizontal: 16 * 2),
85-
child: Column(
86-
mainAxisAlignment: MainAxisAlignment.center,
87-
children: [
88-
InkWell(
89-
onTap: () => Navigator.of(context).push(MaterialPageRoute(
90-
builder: (context) => CreateAccountScreen())),
91-
child: Container(
92-
height: 56,
93-
decoration: BoxDecoration(
94-
color: AppColors.primaryColor,
95-
borderRadius: BorderRadius.circular(4)),
96-
child: Center(
97-
child: Text(
98-
"Create Account",
99-
style: TextStyle(
100-
fontWeight: FontWeight.w500,
101-
color: Colors.white,
92+
],
93+
),
94+
SizedBox(
95+
height: MediaQuery.of(context).size.height * 0.4,
96+
child: Padding(
97+
padding: const EdgeInsets.symmetric(horizontal: 16 * 2),
98+
child: Column(
99+
mainAxisAlignment: MainAxisAlignment.center,
100+
children: [
101+
InkWell(
102+
onTap: () => Navigator.of(context).push(MaterialPageRoute(
103+
builder: (context) => CreateAccountScreen())),
104+
child: Container(
105+
height: 56,
106+
decoration: BoxDecoration(
107+
color: AppColors.primaryColor,
108+
borderRadius: BorderRadius.circular(4)),
109+
child: Center(
110+
child: Text(
111+
"Create Account",
112+
style: TextStyle(
113+
fontWeight: FontWeight.w500,
114+
color: Colors.white,
115+
),
116+
),
117+
),
118+
),
119+
),
120+
SizedBox(height: 18),
121+
InkWell(
122+
onTap: () => Navigator.of(context).push(
123+
MaterialPageRoute(builder: (context) => LoginPage())),
124+
child: Container(
125+
height: 56,
126+
decoration: BoxDecoration(
127+
color: Theme.of(context).brightness == Brightness.dark
128+
? Colors.white
129+
: Theme.of(context).highlightColor,
130+
borderRadius: BorderRadius.circular(4)),
131+
child: Center(
132+
child: Text(
133+
"Login Here",
134+
style: TextStyle(
135+
fontWeight: FontWeight.w500, color: Colors.black),
102136
),
103137
),
104138
),
105139
),
106-
),
107-
SizedBox(height: 16),
108-
InkWell(
109-
onTap: () => Navigator.of(context).push(
110-
MaterialPageRoute(builder: (context) => LoginPage())),
111-
child: Container(
112-
height: 56,
113-
decoration: BoxDecoration(
114-
color: Theme.of(context).brightness == Brightness.dark
115-
? Colors.white
116-
: Theme.of(context).highlightColor,
117-
borderRadius: BorderRadius.circular(4)),
140+
SizedBox(height: 18),
141+
142+
InkWell(
143+
onTap: () =>context.read<AuthBloc>().add(UseAsGuest()),
118144
child: Center(
119-
child: Text(
120-
"Login Here",
121-
style: TextStyle(
122-
fontWeight: FontWeight.w500, color: Colors.black),
145+
child: Row(
146+
mainAxisAlignment: MainAxisAlignment.center,
147+
children: [
148+
Text("Continue as guest ",
149+
style: TextStyle(
150+
color: AppColors.boldHeadlineColor2,
151+
fontWeight: FontWeight.w500)),
152+
SvgPicture.asset('assets/icons/chevron-right.svg',
153+
height: 16.0,
154+
width: 16.0,
155+
color: AppColors.boldHeadlineColor2,)
156+
],
123157
),
124158
),
125159
),
126-
),
127-
SizedBox(height: 16),
128-
Text(
129-
"",
130-
style: TextStyle(color: AppColors.boldHeadlineColor),
131-
)
132-
],
133-
),
134-
))
135-
],
136-
));
160+
161+
],
162+
),
163+
))
164+
],
165+
)),
166+
);
137167
}
138168
}

0 commit comments

Comments
 (0)