Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushik committed Dec 12, 2024
1 parent 887ce4c commit 1568410
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 92 deletions.
20 changes: 10 additions & 10 deletions app/lib/ui/flow/home/map/map_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import 'map_view_model.dart';

const defaultCameraZoom = 15.0;
const defaultCameraZoomForSelectedUser = 17.0;
double markerSize = Platform.isAndroid ? 150.0 : 70.0;
double markerRadius = Platform.isAndroid ? 70.0 : 30.0;
double markerSize = Platform.isAndroid ? 124.0 : 70.0;
double markerRadius = Platform.isAndroid ? 60.0 : 30.0;
const placeSize = 80;

class MapScreen extends ConsumerStatefulWidget {
Expand Down Expand Up @@ -127,7 +127,8 @@ class _MapScreenState extends ConsumerState<MapScreen> {
}
},
onDismiss: () => notifier.onDismissMemberDetail(),
currentUserLocation: state.currentUserLocation ?? const LatLng(0.0, 0.0),
currentUserLocation:
state.currentUserLocation ?? const LatLng(0.0, 0.0),
),
Visibility(visible: enabled, child: _permissionFooter(state))
],
Expand Down Expand Up @@ -401,12 +402,13 @@ class _MapScreenState extends ConsumerState<MapScreen> {
void _drawUserName(Canvas canvas, String userName, Color bgColor) {
final textPainter = TextPainter(textDirection: TextDirection.ltr);

canvas.drawCircle(Offset(markerSize / 2, markerSize / 2), 30,
Paint()..color = bgColor);
canvas.drawCircle(Offset(markerSize / 2, markerSize / 2),
Platform.isAndroid ? 50 : 30, Paint()..color = bgColor);

textPainter.text = TextSpan(
text: userName.isNotEmpty ? userName[0] : '',
style: TextStyle(fontSize: Platform.isAndroid ? 70 : 40, color: Colors.white),
style: TextStyle(
fontSize: Platform.isAndroid ? 70 : 40, color: Colors.white),
);
textPainter.layout();
textPainter.paint(
Expand All @@ -428,10 +430,8 @@ class _MapScreenState extends ConsumerState<MapScreen> {
) async {
// Prepare the canvas to draw the rounded rectangle and the image
final recorder = ui.PictureRecorder();
final canvas = ui.Canvas(
recorder,
Rect.fromPoints(
const Offset(0, 0), Offset(markerSize, markerSize)));
final canvas = ui.Canvas(recorder,
Rect.fromPoints(const Offset(0, 0), Offset(markerSize, markerSize)));

// Draw the rounded rectangle
canvas.drawRRect(
Expand Down
24 changes: 12 additions & 12 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1168,18 +1168,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -1224,18 +1224,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
version: "1.12.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -1700,10 +1700,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.0"
time:
dependency: transitive
description:
Expand Down Expand Up @@ -1860,10 +1860,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.2.1"
watcher:
dependency: transitive
description:
Expand Down
86 changes: 16 additions & 70 deletions data/lib/api/space/space_models.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ mixin _$ApiSpace {
String get name => throw _privateConstructorUsedError;
int? get created_at => throw _privateConstructorUsedError;

/// Serializes this ApiSpace to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;

/// Create a copy of ApiSpace
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
$ApiSpaceCopyWith<ApiSpace> get copyWith =>
throw _privateConstructorUsedError;
}
Expand All @@ -53,8 +49,6 @@ class _$ApiSpaceCopyWithImpl<$Res, $Val extends ApiSpace>
// ignore: unused_field
final $Res Function($Val) _then;

/// Create a copy of ApiSpace
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand Down Expand Up @@ -103,8 +97,6 @@ class __$$ApiSpaceImplCopyWithImpl<$Res>
_$ApiSpaceImpl _value, $Res Function(_$ApiSpaceImpl) _then)
: super(_value, _then);

/// Create a copy of ApiSpace
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand Down Expand Up @@ -174,13 +166,11 @@ class _$ApiSpaceImpl extends _ApiSpace {
other.created_at == created_at));
}

@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, id, admin_id, name, created_at);

/// Create a copy of ApiSpace
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$ApiSpaceImplCopyWith<_$ApiSpaceImpl> get copyWith =>
Expand Down Expand Up @@ -213,11 +203,8 @@ abstract class _ApiSpace extends ApiSpace {
String get name;
@override
int? get created_at;

/// Create a copy of ApiSpace
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
_$$ApiSpaceImplCopyWith<_$ApiSpaceImpl> get copyWith =>
throw _privateConstructorUsedError;
}
Expand All @@ -235,12 +222,8 @@ mixin _$ApiSpaceMember {
bool get location_enabled => throw _privateConstructorUsedError;
int? get created_at => throw _privateConstructorUsedError;

/// Serializes this ApiSpaceMember to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;

/// Create a copy of ApiSpaceMember
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
$ApiSpaceMemberCopyWith<ApiSpaceMember> get copyWith =>
throw _privateConstructorUsedError;
}
Expand Down Expand Up @@ -270,8 +253,6 @@ class _$ApiSpaceMemberCopyWithImpl<$Res, $Val extends ApiSpaceMember>
// ignore: unused_field
final $Res Function($Val) _then;

/// Create a copy of ApiSpaceMember
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand Down Expand Up @@ -336,8 +317,6 @@ class __$$ApiSpaceMemberImplCopyWithImpl<$Res>
_$ApiSpaceMemberImpl _value, $Res Function(_$ApiSpaceMemberImpl) _then)
: super(_value, _then);

/// Create a copy of ApiSpaceMember
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand Down Expand Up @@ -426,14 +405,12 @@ class _$ApiSpaceMemberImpl extends _ApiSpaceMember {
other.created_at == created_at));
}

@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType, id, space_id, user_id, role, location_enabled, created_at);

/// Create a copy of ApiSpaceMember
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$ApiSpaceMemberImplCopyWith<_$ApiSpaceMemberImpl> get copyWith =>
Expand Down Expand Up @@ -473,11 +450,8 @@ abstract class _ApiSpaceMember extends ApiSpaceMember {
bool get location_enabled;
@override
int? get created_at;

/// Create a copy of ApiSpaceMember
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
_$$ApiSpaceMemberImplCopyWith<_$ApiSpaceMemberImpl> get copyWith =>
throw _privateConstructorUsedError;
}
Expand All @@ -493,12 +467,8 @@ mixin _$ApiSpaceInvitation {
String get code => throw _privateConstructorUsedError;
int? get created_at => throw _privateConstructorUsedError;

/// Serializes this ApiSpaceInvitation to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;

/// Create a copy of ApiSpaceInvitation
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
$ApiSpaceInvitationCopyWith<ApiSpaceInvitation> get copyWith =>
throw _privateConstructorUsedError;
}
Expand All @@ -522,8 +492,6 @@ class _$ApiSpaceInvitationCopyWithImpl<$Res, $Val extends ApiSpaceInvitation>
// ignore: unused_field
final $Res Function($Val) _then;

/// Create a copy of ApiSpaceInvitation
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand Down Expand Up @@ -572,8 +540,6 @@ class __$$ApiSpaceInvitationImplCopyWithImpl<$Res>
$Res Function(_$ApiSpaceInvitationImpl) _then)
: super(_value, _then);

/// Create a copy of ApiSpaceInvitation
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand Down Expand Up @@ -643,13 +609,11 @@ class _$ApiSpaceInvitationImpl extends _ApiSpaceInvitation {
other.created_at == created_at));
}

@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, id, space_id, code, created_at);

/// Create a copy of ApiSpaceInvitation
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$ApiSpaceInvitationImplCopyWith<_$ApiSpaceInvitationImpl> get copyWith =>
Expand Down Expand Up @@ -683,11 +647,8 @@ abstract class _ApiSpaceInvitation extends ApiSpaceInvitation {
String get code;
@override
int? get created_at;

/// Create a copy of ApiSpaceInvitation
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
_$$ApiSpaceInvitationImplCopyWith<_$ApiSpaceInvitationImpl> get copyWith =>
throw _privateConstructorUsedError;
}
Expand All @@ -701,12 +662,8 @@ mixin _$SpaceInfo {
ApiSpace get space => throw _privateConstructorUsedError;
List<ApiUserInfo> get members => throw _privateConstructorUsedError;

/// Serializes this SpaceInfo to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;

/// Create a copy of SpaceInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
$SpaceInfoCopyWith<SpaceInfo> get copyWith =>
throw _privateConstructorUsedError;
}
Expand All @@ -731,8 +688,6 @@ class _$SpaceInfoCopyWithImpl<$Res, $Val extends SpaceInfo>
// ignore: unused_field
final $Res Function($Val) _then;

/// Create a copy of SpaceInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand All @@ -751,8 +706,6 @@ class _$SpaceInfoCopyWithImpl<$Res, $Val extends SpaceInfo>
) as $Val);
}

/// Create a copy of SpaceInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ApiSpaceCopyWith<$Res> get space {
Expand Down Expand Up @@ -784,8 +737,6 @@ class __$$SpaceInfoImplCopyWithImpl<$Res>
_$SpaceInfoImpl _value, $Res Function(_$SpaceInfoImpl) _then)
: super(_value, _then);

/// Create a copy of SpaceInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Expand Down Expand Up @@ -840,14 +791,12 @@ class _$SpaceInfoImpl extends _SpaceInfo {
const DeepCollectionEquality().equals(other._members, _members));
}

@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType, space, const DeepCollectionEquality().hash(_members));

/// Create a copy of SpaceInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$SpaceInfoImplCopyWith<_$SpaceInfoImpl> get copyWith =>
Expand All @@ -874,11 +823,8 @@ abstract class _SpaceInfo extends SpaceInfo {
ApiSpace get space;
@override
List<ApiUserInfo> get members;

/// Create a copy of SpaceInfo
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
_$$SpaceInfoImplCopyWith<_$SpaceInfoImpl> get copyWith =>
throw _privateConstructorUsedError;
}

0 comments on commit 1568410

Please sign in to comment.