File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -57,11 +57,26 @@ class AppConfigurationBloc
57
57
AppConfigurationUpdated event,
58
58
Emitter <AppConfigurationState > emit,
59
59
) async {
60
+ if (state.originalRemoteConfig == null ) {
61
+ emit (
62
+ state.copyWith (
63
+ status: AppConfigurationStatus .failure,
64
+ exception: const UnknownException (
65
+ 'Original remote config is not available.' ,
66
+ ),
67
+ ),
68
+ );
69
+ return ;
70
+ }
60
71
emit (state.copyWith (status: AppConfigurationStatus .loading));
61
72
try {
73
+ final configToUpdate = event.remoteConfig.copyWith (
74
+ createdAt: state.originalRemoteConfig! .createdAt,
75
+ updatedAt: DateTime .now (),
76
+ );
62
77
final updatedConfig = await _remoteConfigRepository.update (
63
- id: event.remoteConfig .id,
64
- item: event.remoteConfig ,
78
+ id: configToUpdate .id,
79
+ item: configToUpdate ,
65
80
);
66
81
emit (
67
82
state.copyWith (
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import 'package:flutter_news_app_web_dashboard_full_source_code/app/config/confi
6
6
import 'package:flutter_news_app_web_dashboard_full_source_code/bootstrap.dart' ;
7
7
8
8
// Define the current application environment (production/development/demo).
9
- const AppEnvironment appEnvironment = AppEnvironment .demo ;
9
+ const AppEnvironment appEnvironment = AppEnvironment .development ;
10
10
11
11
@JS ('removeSplashFromWeb' )
12
12
external void removeSplashFromWeb ();
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ packages:
90
90
description:
91
91
path: "."
92
92
ref: HEAD
93
- resolved-ref: "7a1b54f8c0f94f6c04af3404c8110181e080b5c4"
93
+ resolved-ref: f648500814ec636a2930498756029d29b363194a
94
94
url: "https://github.com/flutter-news-app-full-source-code/core.git"
95
95
source: git
96
96
version: "0.0.0"
@@ -269,10 +269,10 @@ packages:
269
269
dependency: "direct main"
270
270
description:
271
271
name: go_router
272
- sha256: c489908a54ce2131f1d1b7cc631af9c1a06fac5ca7c449e959192089f9489431
272
+ sha256: "8b1f37dfaf6e958c6b872322db06f946509433bec3de753c3491a42ae9ec2b48"
273
273
url: "https://pub.dev"
274
274
source: hosted
275
- version: "16.0 .0"
275
+ version: "16.1 .0"
276
276
google_fonts:
277
277
dependency: "direct main"
278
278
description:
You can’t perform that action at this time.
0 commit comments