Skip to content

Commit

Permalink
feat: added url_strategy.dart to support web more easily
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Dec 24, 2024
1 parent 1dea0b1 commit e5295e7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 0.6.0

## Feat

- Added url_strategy.dart for web support
- Added flutter_web_plugins as a dependency

# 0.5.3

## Fix

- Security update, requires shared_preferences_android to be 2.3.4.

# 0.5.2

## Fix
Expand Down
1 change: 1 addition & 0 deletions lib/impaktfull_architecture.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export 'src/util/storage/key_value/key_value_store.dart';
export 'src/util/storage/secure/secure_store.dart';
export 'src/util/storage/shared_prefs/shared_prefs_store.dart';
export 'src/util/stream/multi_listener_stream_controller.dart';
export 'src/util/url/url_strategy.dart';
export 'src/widget/lifecycle/lifecycle_widget.dart';
export 'src/widget/mixin/after_layout.dart';
export 'src/widget/provider/provider_widget.dart';
Expand Down
5 changes: 5 additions & 0 deletions lib/src/util/url/url_strategy.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'url_strategy_io.dart' if (dart.library.html) 'url_strategy_web.dart';

void setPathUrlStrategy() {
initializeUrlStrategy();
}
4 changes: 4 additions & 0 deletions lib/src/util/url/url_strategy_io.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// Stub implementation for non-web platforms
void initializeUrlStrategy() {
// Do nothing on non-web platforms
}
5 changes: 5 additions & 0 deletions lib/src/util/url/url_strategy_web.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'package:flutter_web_plugins/flutter_web_plugins.dart';

void initializeUrlStrategy() {
setUrlStrategy(PathUrlStrategy());
}
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dependencies:
device_info_plus: ^10.1.0
flutter:
sdk: flutter
flutter_web_plugins:
sdk: flutter
dio: ^5.4.3+1
gap: ^3.0.1
get_it: ^7.7.0
Expand Down

0 comments on commit e5295e7

Please sign in to comment.