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

Settings screen redesign #2396

Merged
merged 8 commits into from
Jan 24, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public static void registerWith(@NonNull FlutterEngine flutterEngine) {
} catch (Exception e) {
Log.e(TAG, "Error registering plugin google_maps_flutter_android, io.flutter.plugins.googlemaps.GoogleMapsPlugin", e);
}
try {
flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin package_info_plus, dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
} catch (Exception e) {
Expand Down
7 changes: 7 additions & 0 deletions mobile-v3/ios/Runner/GeneratedPluginRegistrant.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
@import google_maps_flutter_ios;
#endif

#if __has_include(<package_info_plus/FPPPackageInfoPlusPlugin.h>)
#import <package_info_plus/FPPPackageInfoPlusPlugin.h>
#else
@import package_info_plus;
#endif

#if __has_include(<path_provider_foundation/PathProviderPlugin.h>)
#import <path_provider_foundation/PathProviderPlugin.h>
#else
Expand All @@ -29,6 +35,7 @@ @implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[ConnectivityPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"ConnectivityPlusPlugin"]];
[FLTGoogleMapsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTGoogleMapsPlugin"]];
[FPPPackageInfoPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FPPPackageInfoPlusPlugin"]];
[PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]];
}

Expand Down
153 changes: 80 additions & 73 deletions mobile-v3/lib/src/app/profile/pages/profile_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'package:airqo/src/app/profile/bloc/user_bloc.dart';
import 'package:airqo/src/app/profile/pages/widgets/devices_widget.dart';
import 'package:airqo/src/app/profile/pages/widgets/exposure_widget.dart';
import 'package:airqo/src/app/profile/pages/widgets/settings_widget.dart';
import 'package:airqo/src/meta/utils/colors.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -29,7 +27,7 @@ class _ProfilePageState extends State<ProfilePage> {
String firstName = state.model.users[0].firstName;
String lastName = state.model.users[0].lastName;
return DefaultTabController(
length: 3,
length: 1,
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
Expand All @@ -44,69 +42,78 @@ class _ProfilePageState extends State<ProfilePage> {
children: [
SizedBox(
height: 100,
child: Row(
children: [
Container(
margin: const EdgeInsets.symmetric(horizontal: 16),
child: CircleAvatar(
backgroundColor: Theme.of(context).highlightColor,
child: Center(
child: SvgPicture.asset(
"assets/icons/user_icon.svg"),
),
radius: 50,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
child: LayoutBuilder(
builder: (context, constraints) {
return Row(
children: [
Text(
"${firstName} ${lastName}",
style: TextStyle(
color: AppColors.boldHeadlineColor,
fontSize: 24,
fontWeight: FontWeight.w700,
Container(
margin:
const EdgeInsets.symmetric(horizontal: 16),
child: CircleAvatar(
backgroundColor:
Theme.of(context).highlightColor,
child: Center(
child: SvgPicture.asset(
"assets/icons/user_icon.svg"),
),
radius: 50,
),
),
Spacer(),
Row(
children: [
Container(
padding: const EdgeInsets.symmetric(
horizontal: 32),
height: 50,
child: Center(
child: Text("Edit your profile")),
// child: InkWell(
// onTap: () => Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// EditProfile())),
// child: Text(
// "Edit your profile",
// style: TextStyle(
// fontWeight: FontWeight.w500,
// color: Colors.white,
// ),
// ),
//)),
decoration: BoxDecoration(
color: Theme.of(context).highlightColor,
borderRadius:
BorderRadius.circular(200)),
),
SizedBox(width: 8),
CircleAvatar(
backgroundColor:
Theme.of(context).highlightColor,
radius: 26,
child: SvgPicture.asset(
"assets/icons/notification.svg"))
],
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${firstName} ${lastName}",
style: TextStyle(
color: AppColors.boldHeadlineColor,
fontSize: 24,
fontWeight: FontWeight.w700,
),
),
Spacer(),
Row(
children: [
Container(
padding: const EdgeInsets.symmetric(
horizontal: 32),
height: 50,
child: Center(
child: Text("Edit your profile")),
// child: InkWell(
// onTap: () => Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// EditProfile())),
// child: Text(
// "Edit your profile",
// style: TextStyle(
// fontWeight: FontWeight.w500,
// color: Colors.white,
// ),
// ),
//)),
decoration: BoxDecoration(
color: Theme.of(context)
.highlightColor,
borderRadius:
BorderRadius.circular(200)),
),
SizedBox(width: 8),
CircleAvatar(
backgroundColor:
Theme.of(context).highlightColor,
radius: 26,
child: SvgPicture.asset(
"assets/icons/notification.svg"))
],
)
],
),
)
],
)
],
);
},
),
),
SizedBox(height: 32),
Expand All @@ -123,21 +130,21 @@ class _ProfilePageState extends State<ProfilePage> {
? Colors.white
: AppColors.primaryColor,
tabs: [
Tab(
height: 60,
icon: TabIcon(
image: "assets/profile/exposure.svg",
label: "Exposure")),
// Tab(
// height: 60,
// icon: TabIcon(
// image: "assets/profile/exposure.svg",
// label: "Exposure")),
// Tab(
// height: 60,
// icon: TabIcon(
// image: "assets/profile/places.svg",
// label: "Places")),
Tab(
height: 60,
icon: TabIcon(
image: "assets/profile/devices.svg",
label: "Devices")),
// Tab(
// height: 60,
// icon: TabIcon(
// image: "assets/profile/devices.svg",
// label: "Devices")),
Tab(
height: 60,
icon: TabIcon(
Expand All @@ -146,9 +153,9 @@ class _ProfilePageState extends State<ProfilePage> {
]),
Expanded(
child: TabBarView(children: [
ExposureWidget(),
// ExposureWidget(),
// Container(child: Text("devices")),
DevicesWidget(),
// DevicesWidget(),
SettingsWidget()
]),
)
Expand Down
Loading
Loading