Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Apr 11, 2024
2 parents ec7b46e + 5bccbc4 commit ed82d5f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 63 deletions.
11 changes: 0 additions & 11 deletions lib/redux/app/app_reducer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ AppState appReducer(AppState state, dynamic action) {
return state.rebuild((b) => b
..isLoading = loadingReducer(state.isLoading, action)
..isSaving = savingReducer(state.isSaving, action)
..dismissedFlutterWebWarning = dismissedFlutterWebWarningReducer(
state.dismissedFlutterWebWarning, action)
..lastError = lastErrorReducer(state.lastError, action)
..authState.replace(authReducer(state.authState, action))
..staticState.replace(staticReducer(state.staticState, action))
Expand Down Expand Up @@ -165,12 +163,3 @@ final lastErrorReducer = combineReducers<String>([
return '${action.error}';
}),
]);

final dismissedFlutterWebWarningReducer = combineReducers<bool>([
TypedReducer<bool, DismissFlutterWebWarning>((state, action) {
return true;
}),
TypedReducer<bool, DismissFlutterWebWarningPermanently>((state, action) {
return true;
}),
]);
3 changes: 0 additions & 3 deletions lib/redux/app/app_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
isSaving: false,
isTesting: false,
isWhiteLabeled: isWhiteLabeled,
dismissedFlutterWebWarning: false,
lastError: '',
authState: AuthState(
url: url,
Expand Down Expand Up @@ -126,8 +125,6 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {

bool get isWhiteLabeled;

bool get dismissedFlutterWebWarning;

String get lastError;

AuthState get authState;
Expand Down
24 changes: 0 additions & 24 deletions lib/redux/app/app_state.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 26 additions & 23 deletions lib/ui/app/important_message_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,22 @@ class _ImportantMessageBannerState extends State<ImportantMessageBanner> {
@override
Widget build(BuildContext context) {
final store = StoreProvider.of<AppState>(context);
final state = store.state;
final localization = AppLocalization.of(context)!;

final calculatedLayout = calculateLayout(context);
String? message;
String? messageType;

if (!_dismissedMessage.containsKey(MESSAGE_TYPE_FLUTTER_WEB)) {
if (kIsWeb || !kReleaseMode) {
if ((kIsWeb && !state.prefState.hideFlutterWebWarning) || !kReleaseMode) {
//message = localization.flutterWebWarning;
//messageType = MESSAGE_TYPE_FLUTTER_WEB;
}
}

if (!_dismissedMessage.containsKey(MESSAGE_TYPE_LAYOUT)) {
if (message == null &&
!_dismissedMessage.containsKey(MESSAGE_TYPE_LAYOUT)) {
if (widget.appLayout == AppLayout.mobile &&
widget.suggestedLayout == AppLayout.mobile &&
calculatedLayout == AppLayout.desktop) {
Expand Down Expand Up @@ -98,27 +100,28 @@ class _ImportantMessageBannerState extends State<ImportantMessageBanner> {
setState(() => _dismissedMessage[messageType!] = true);
},
),
AppTextButton(
label: localization.change,
color: Colors.white,
onPressed: () {
final layout =
widget.suggestedLayout == AppLayout.desktop
? AppLayout.mobile
: AppLayout.desktop;
store
.dispatch(UpdateUserPreferences(appLayout: layout));
AppBuilder.of(context)!.rebuild();
WidgetsBinding.instance
.addPostFrameCallback((duration) {
if (layout == AppLayout.mobile) {
store.dispatch(ViewDashboard());
} else {
store.dispatch(ViewMainScreen(addDelay: true));
}
});
},
),
if (messageType == MESSAGE_TYPE_LAYOUT)
AppTextButton(
label: localization.change,
color: Colors.white,
onPressed: () {
final layout =
widget.suggestedLayout == AppLayout.desktop
? AppLayout.mobile
: AppLayout.desktop;
store.dispatch(
UpdateUserPreferences(appLayout: layout));
AppBuilder.of(context)!.rebuild();
WidgetsBinding.instance
.addPostFrameCallback((duration) {
if (layout == AppLayout.mobile) {
store.dispatch(ViewDashboard());
} else {
store.dispatch(ViewMainScreen(addDelay: true));
}
});
},
),
],
),
),
Expand Down
5 changes: 3 additions & 2 deletions lib/ui/invoice/edit/invoice_edit_desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class InvoiceEditDesktopState extends State<InvoiceEditDesktop>
Flexible(
flex: 3,
child: Column(
key: ValueKey('__invoice_${invoice.id}_${invoice.updatedAt}__'),
key: ValueKey('__invoice_${invoice.id}__'),
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down Expand Up @@ -456,7 +456,8 @@ class InvoiceEditDesktopState extends State<InvoiceEditDesktop>
},
),
DatePicker(
key: ValueKey('__terms_${client.id}__'),
key: ValueKey(
'__due_date_${client.id}_${invoice.updatedAt}__'),
labelText: entityType == EntityType.invoice ||
entityType == EntityType.purchaseOrder
? localization.dueDate
Expand Down

0 comments on commit ed82d5f

Please sign in to comment.