Skip to content

Commit 77b5d2f

Browse files
authored
Pr 20 (#21)
2 parents bf33f09 + aef352e commit 77b5d2f

14 files changed

Lines changed: 673 additions & 327 deletions

.gemini/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"mcpServers": {
3+
"appium-mcp": {
4+
"command": "npx",
5+
"args": [
6+
"-y",
7+
"appium-mcp@latest"
8+
]
9+
}
10+
}
11+
}

android/app/src/main/res/drawable/launch_background.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- Modify this file to customize your launch splash screen -->
33
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4-
<item android:drawable="@android:color/white" />
4+
<item android:drawable="@color/splashBackground" />
55

66
<!-- You can insert your own image assets here -->
77
<!-- <item>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- PetSphere dark surface — matches app theme background (#0F0E0C) -->
4+
<color name="splashBackground">#0F0E0C</color>
5+
</resources>
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4-
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
3+
<!-- Theme applied to the Android Window while the process is starting.
4+
Always uses the dark theme so the splash matches PetSphere's dark UI. -->
5+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
56
<!-- Show a splash screen on the activity. Automatically removed when
67
the Flutter engine draws its first frame -->
78
<item name="android:windowBackground">@drawable/launch_background</item>
@@ -12,7 +13,7 @@
1213
running.
1314
1415
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15-
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
16-
<item name="android:windowBackground">?android:colorBackground</item>
16+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
17+
<item name="android:windowBackground">@color/splashBackground</item>
1718
</style>
1819
</resources>

android/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
org.gradle.jvmargs=-Xmx2G -XX:MaxMetaspaceSize=1G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
# Android Gradle Plugin / Gradle do not run on JDK 26; without a JDK 17–21 toolchain the build fails with "26.0.2" as the only message.
4-
# org.gradle.java.home=C:\\Program Files\\Android\\Android Studio\\jbr
4+
org.gradle.java.home=C:\\Program Files\\Android\\Android Studio\\jbr
55
# Enable parallel build to speed up the build process
66
org.gradle.parallel=true
77
# Enable the Gradle build cache to reuse outputs from previous builds
@@ -12,4 +12,4 @@ org.gradle.configureondemand=true
1212
org.gradle.daemon=true
1313
# Enable Gradle's build scan plugin for better insights into build performance
1414
# org.gradle.scan=true
15-
org.gradle.java.home=/usr/lib/jvm/java-21-openjdk
15+
# org.gradle.java.home=/usr/lib/jvm/java-21-openjdk

docs/plan/cursor_ui_ux_audit_of_flutter_app.md

Lines changed: 233 additions & 0 deletions
Large diffs are not rendered by default.

lib/repositories/feed_repository.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ class FeedRepository {
269269
}) async {
270270
final payload = {
271271
'caption': caption,
272-
if (location != null) 'location': location,
273-
if (taggedPetIds != null) 'tagged_pet_ids': taggedPetIds,
274-
if (taggedPetNames != null) 'tagged_pet_names': taggedPetNames,
272+
'location': ?location,
273+
'tagged_pet_ids': ?taggedPetIds,
274+
'tagged_pet_names': ?taggedPetNames,
275275
};
276276

277277
final data = await supabase

lib/views/add_pet_screen.dart

Lines changed: 61 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,18 @@ class _AddPetScreenState extends ConsumerState<AddPetScreen>
356356
],
357357
),
358358
const SizedBox(height: 8),
359-
ClipRRect(
360-
borderRadius: BorderRadius.circular(4),
361-
child: LinearProgressIndicator(
362-
value: (_currentStep + 1) / 3,
363-
minHeight: 4,
364-
backgroundColor: Theme.of(context).colorScheme.surfaceContainerHighest,
365-
valueColor:
366-
AlwaysStoppedAnimation<Color>(Theme.of(context).colorScheme.primary),
359+
Semantics(
360+
label: 'Step ${_currentStep + 1} of 3: ${_stepTitle()}',
361+
value: '${((_currentStep + 1) / 3 * 100).round()} percent complete',
362+
child: ClipRRect(
363+
borderRadius: BorderRadius.circular(4),
364+
child: LinearProgressIndicator(
365+
value: (_currentStep + 1) / 3,
366+
minHeight: 4,
367+
backgroundColor: Theme.of(context).colorScheme.surfaceContainerHighest,
368+
valueColor:
369+
AlwaysStoppedAnimation<Color>(Theme.of(context).colorScheme.primary),
370+
),
367371
),
368372
),
369373
],
@@ -435,50 +439,58 @@ class _AddPetScreenState extends ConsumerState<AddPetScreen>
435439
final option = _animalOptions[index];
436440
final isSelected = _selectedAnimalType == option.label;
437441
final optionColor = Theme.of(context).colorScheme.primary;
438-
return GestureDetector(
442+
return Semantics(
443+
button: true,
444+
selected: isSelected,
445+
label: option.label,
439446
onTap: () => setState(() => _selectedAnimalType = option.label),
440-
child: AnimatedContainer(
441-
duration: const Duration(milliseconds: 250),
442-
curve: Curves.easeOut,
443-
decoration: BoxDecoration(
444-
color: isSelected
445-
? optionColor.withAlpha(26)
446-
: Theme.of(context).colorScheme.surfaceContainerHigh,
447-
borderRadius: BorderRadius.circular(20),
448-
border: Border.all(
449-
color: isSelected ? optionColor : Theme.of(context).colorScheme.onSurfaceVariant,
450-
width: isSelected ? 2.5 : 1,
451-
),
452-
boxShadow: isSelected
453-
? [
454-
BoxShadow(
455-
color: optionColor.withAlpha(51),
456-
blurRadius: 12,
457-
offset: const Offset(0, 4),
458-
)
459-
]
460-
: [],
461-
),
462-
child: Column(
463-
mainAxisAlignment: MainAxisAlignment.center,
464-
children: [
465-
Icon(
466-
option.icon,
467-
size: 36,
468-
color: isSelected ? optionColor : Theme.of(context).colorScheme.onSurfaceVariant,
469-
),
470-
const SizedBox(height: 8),
471-
Text(
472-
option.label,
473-
style: TextStyle(
474-
fontSize: 15,
475-
fontWeight:
476-
isSelected ? FontWeight.bold : FontWeight.w500,
477-
color:
478-
isSelected ? optionColor : Theme.of(context).colorScheme.onSurfaceVariant,
447+
child: ExcludeSemantics(
448+
child: GestureDetector(
449+
onTap: () => setState(() => _selectedAnimalType = option.label),
450+
child: AnimatedContainer(
451+
duration: const Duration(milliseconds: 250),
452+
curve: Curves.easeOut,
453+
decoration: BoxDecoration(
454+
color: isSelected
455+
? optionColor.withAlpha(26)
456+
: Theme.of(context).colorScheme.surfaceContainerHigh,
457+
borderRadius: BorderRadius.circular(20),
458+
border: Border.all(
459+
color: isSelected ? optionColor : Theme.of(context).colorScheme.onSurfaceVariant,
460+
width: isSelected ? 2.5 : 1,
479461
),
462+
boxShadow: isSelected
463+
? [
464+
BoxShadow(
465+
color: optionColor.withAlpha(51),
466+
blurRadius: 12,
467+
offset: const Offset(0, 4),
468+
)
469+
]
470+
: [],
480471
),
481-
],
472+
child: Column(
473+
mainAxisAlignment: MainAxisAlignment.center,
474+
children: [
475+
Icon(
476+
option.icon,
477+
size: 36,
478+
color: isSelected ? optionColor : Theme.of(context).colorScheme.onSurfaceVariant,
479+
),
480+
const SizedBox(height: 8),
481+
Text(
482+
option.label,
483+
style: TextStyle(
484+
fontSize: 15,
485+
fontWeight:
486+
isSelected ? FontWeight.bold : FontWeight.w500,
487+
color:
488+
isSelected ? optionColor : Theme.of(context).colorScheme.onSurfaceVariant,
489+
),
490+
),
491+
],
492+
),
493+
),
482494
),
483495
),
484496
);

lib/views/adoption_center_screen.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import 'package:cached_network_image/cached_network_image.dart';
33
import 'package:flutter/material.dart';
44
import 'package:flutter_riverpod/flutter_riverpod.dart';
55
import 'package:google_fonts/google_fonts.dart';
6-
import '../theme/app_theme.dart';
7-
import '../widgets/brand_logo.dart';
86

97
class AdoptionCenterScreen extends ConsumerStatefulWidget {
108
const AdoptionCenterScreen({super.key});
@@ -15,7 +13,6 @@ class AdoptionCenterScreen extends ConsumerStatefulWidget {
1513

1614
class _AdoptionCenterScreenState extends ConsumerState<AdoptionCenterScreen> {
1715
int _currentIndex = 0;
18-
double _swipeProgress = 0.0; // -1.0 to 1.0
1916

2017
@override
2118
Widget build(BuildContext context) {
@@ -79,12 +76,11 @@ class _AdoptionCenterScreenState extends ConsumerState<AdoptionCenterScreen> {
7976
pet: _mockPets[actualIndex],
8077
isTop: reverseIndex == 0,
8178
onSwipe: (progress) {
82-
setState(() => _swipeProgress = progress);
79+
// Progress update ignored as it's not currently used for UI effects
8380
},
8481
onComplete: () {
8582
setState(() {
8683
_currentIndex++;
87-
_swipeProgress = 0.0;
8884
});
8985
},
9086
);

lib/views/home_screen.dart

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,25 +1149,27 @@ class _NotificationIconButton extends ConsumerWidget {
11491149
Positioned(
11501150
right: -4,
11511151
top: -4,
1152-
child: Container(
1153-
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
1154-
decoration: BoxDecoration(
1155-
color: Theme.of(context).colorScheme.primary,
1156-
borderRadius: BorderRadius.circular(10),
1157-
border: Border.all(
1158-
color: Theme.of(context).colorScheme.surface,
1159-
width: 1.5,
1152+
child: ExcludeSemantics(
1153+
child: Container(
1154+
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
1155+
decoration: BoxDecoration(
1156+
color: Theme.of(context).colorScheme.primary,
1157+
borderRadius: BorderRadius.circular(10),
1158+
border: Border.all(
1159+
color: Theme.of(context).colorScheme.surface,
1160+
width: 1.5,
1161+
),
11601162
),
1161-
),
1162-
constraints: const BoxConstraints(minWidth: 16, minHeight: 16),
1163-
child: Text(
1164-
unread > 99 ? '99+' : '$unread',
1165-
style: TextStyle(
1166-
color: Theme.of(context).colorScheme.onPrimary,
1167-
fontSize: 10,
1168-
fontWeight: FontWeight.bold,
1163+
constraints: const BoxConstraints(minWidth: 16, minHeight: 16),
1164+
child: Text(
1165+
unread > 99 ? '99+' : '$unread',
1166+
style: TextStyle(
1167+
color: Theme.of(context).colorScheme.onPrimary,
1168+
fontSize: 10,
1169+
fontWeight: FontWeight.bold,
1170+
),
1171+
textAlign: TextAlign.center,
11691172
),
1170-
textAlign: TextAlign.center,
11711173
),
11721174
),
11731175
),
@@ -1196,25 +1198,27 @@ class _MessageIconButton extends ConsumerWidget {
11961198
Positioned(
11971199
right: -4,
11981200
top: -4,
1199-
child: Container(
1200-
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
1201-
decoration: BoxDecoration(
1202-
color: Theme.of(context).colorScheme.primary,
1203-
borderRadius: BorderRadius.circular(10),
1204-
border: Border.all(
1205-
color: Theme.of(context).colorScheme.surface,
1206-
width: 1.5,
1201+
child: ExcludeSemantics(
1202+
child: Container(
1203+
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
1204+
decoration: BoxDecoration(
1205+
color: Theme.of(context).colorScheme.primary,
1206+
borderRadius: BorderRadius.circular(10),
1207+
border: Border.all(
1208+
color: Theme.of(context).colorScheme.surface,
1209+
width: 1.5,
1210+
),
12071211
),
1208-
),
1209-
constraints: const BoxConstraints(minWidth: 16, minHeight: 16),
1210-
child: Text(
1211-
unread > 99 ? '99+' : '$unread',
1212-
style: TextStyle(
1213-
color: Theme.of(context).colorScheme.onPrimary,
1214-
fontSize: 10,
1215-
fontWeight: FontWeight.bold,
1212+
constraints: const BoxConstraints(minWidth: 16, minHeight: 16),
1213+
child: Text(
1214+
unread > 99 ? '99+' : '$unread',
1215+
style: TextStyle(
1216+
color: Theme.of(context).colorScheme.onPrimary,
1217+
fontSize: 10,
1218+
fontWeight: FontWeight.bold,
1219+
),
1220+
textAlign: TextAlign.center,
12161221
),
1217-
textAlign: TextAlign.center,
12181222
),
12191223
),
12201224
),

0 commit comments

Comments
 (0)