Skip to content

Commit c964d21

Browse files
chore: prepare v1.0.6 release
1 parent 1f77928 commit c964d21

File tree

8 files changed

+129
-95
lines changed

8 files changed

+129
-95
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ app.*.map.json
5757
# Cloudflare Worker configuration (contains real credentials)
5858
/cloudflare-oauth-redirect/wrangler.toml
5959
/cloudflare-oauth-redirect/.wrangler/
60+
/cloudflare-oauth-redirect/node_modules/
61+
/node_modules/
6062

6163
# Keep all example files
6264
!*.example

cloudflare-oauth-redirect/package-lock.json

Lines changed: 63 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/providers/app_state.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class AppState extends ChangeNotifier {
1313
// Upload state
1414
List<UploadTask> _uploadTasks = [];
1515
bool _uploadQueueVisible = false;
16+
bool _uploadQueueUiEnabled = false;
1617

1718
// UI state
1819
bool _isLoading = false;
@@ -27,6 +28,7 @@ class AppState extends ChangeNotifier {
2728
bool get isAuthenticated => _isAuthenticated;
2829
List<UploadTask> get uploadTasks => _uploadTasks;
2930
bool get uploadQueueVisible => _uploadQueueVisible;
31+
bool get uploadQueueUiEnabled => _uploadQueueUiEnabled;
3032
bool get isLoading => _isLoading;
3133
String? get errorMessage => _errorMessage;
3234

@@ -85,6 +87,14 @@ class AppState extends ChangeNotifier {
8587
notifyListeners();
8688
}
8789

90+
void setUploadQueueUiEnabled(bool enabled) {
91+
if (_uploadQueueUiEnabled == enabled) {
92+
return;
93+
}
94+
_uploadQueueUiEnabled = enabled;
95+
notifyListeners();
96+
}
97+
8898
// Loading state
8999
void setLoading(bool loading) {
90100
_isLoading = loading;

lib/screens/home_screen.dart

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,26 @@ class _HomeScreenState extends State<HomeScreen> {
158158
}
159159

160160
void _setupSharingService() {
161-
// _sharingService.onFilesShared = (List<File> files) {
162-
// setState(() {
163-
// _isUploading = true;
164-
// });
165-
// _showSuccessSnackBar('Received ${files.length} file(s) to upload');
166-
// };
161+
_sharingService.onFilesShared = (List<File> files) {
162+
if (!mounted) return;
163+
setState(() {
164+
_isUploading = true;
165+
_uploadProgress = 0.0;
166+
});
167+
};
168+
169+
_sharingService.onProgress = (double progress) {
170+
if (!mounted) return;
171+
setState(() {
172+
_uploadProgress = progress;
173+
});
174+
};
167175

168176
_sharingService.onUploadComplete = (List<Map<String, dynamic>> results) {
169177
setState(() {
170178
_uploadHistory.insertAll(0, results);
171179
_isUploading = false;
180+
_uploadProgress = 0.0;
172181
});
173182
HapticFeedback.lightImpact();
174183
unawaited(_processUploadResults(results));
@@ -178,6 +187,7 @@ class _HomeScreenState extends State<HomeScreen> {
178187
setState(() {
179188
_isUploading = false;
180189
_isUrlShortening = false;
190+
_uploadProgress = 0.0;
181191
});
182192
_showErrorSnackBar(error);
183193
};

lib/services/sharing_service.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class SharingService {
1010
SharingService._internal();
1111

1212
Function(List<File>)? onFilesShared;
13+
Function(double progress)? onProgress;
1314
Function(String)? onError;
1415
Function(List<Map<String, dynamic>>)? onUploadComplete;
1516

@@ -20,9 +21,13 @@ class SharingService {
2021
Future<void> uploadFiles(List<File> files) async {
2122
try {
2223
onFilesShared?.call(files);
24+
onProgress?.call(0.0);
25+
2326
final results = await _uploadService.uploadMultipleFiles(
2427
files,
25-
useQueue: true,
28+
onProgress: (progress) {
29+
onProgress?.call(progress);
30+
},
2631
);
2732
onUploadComplete?.call(results);
2833
} catch (e) {

lib/widgets/upload_queue_overlay.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ class _UploadQueueOverlayState extends State<UploadQueueOverlay>
4848
Widget build(BuildContext context) {
4949
return Consumer<AppState>(
5050
builder: (context, appState, child) {
51+
if (!appState.uploadQueueUiEnabled) {
52+
return widget.child;
53+
}
5154
// Show/hide animation based on state
5255
if (appState.hasActiveUploads && appState.uploadQueueVisible) {
5356
_animationController.forward();
@@ -303,6 +306,9 @@ class UploadQueueFloatingButton extends StatelessWidget {
303306
Widget build(BuildContext context) {
304307
return Consumer<AppState>(
305308
builder: (context, appState, child) {
309+
if (!appState.uploadQueueUiEnabled) {
310+
return const SizedBox.shrink();
311+
}
306312
if (!appState.hasActiveUploads || appState.uploadQueueVisible) {
307313
return const SizedBox.shrink();
308314
}

0 commit comments

Comments
 (0)