Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hydrated_bloc)!: support for WASM #4313

Merged
merged 3 commits into from
Jan 4, 2025
Merged

Conversation

felangel
Copy link
Owner

@felangel felangel commented Jan 4, 2025

Status

READY

Breaking Changes

YES

Description

  • feat(hydrated_bloc)!: support for WASM
    • Introduces HydratedStorageDirectory and modifies HydratedStorage.build signature to use HydratedStorageDirectory instead of Directory from dart:io

Sample Usage

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:hydrated_bloc/hydrated_bloc.dart';
import 'package:path_provider/path_provider.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  HydratedBloc.storage = await HydratedStorage.build(
    storageDirectory: kIsWeb
        ? HydratedStorageDirectory.web
        : HydratedStorageDirectory((await getTemporaryDirectory()).path),
  );
  runApp(const App());
}

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@felangel felangel added enhancement New feature or request breaking change Enhancement candidate would introduce a breaking change pkg:hydrated_bloc This issue is related to the hydrated_bloc package labels Jan 4, 2025
@felangel felangel self-assigned this Jan 4, 2025
Copy link

codecov bot commented Jan 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ed7b27c) to head (c6170eb).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #4313   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           31        32    +1     
  Lines          807       807           
=========================================
  Hits           807       807           
Flag Coverage Δ
hydrated_bloc 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@felangel felangel merged commit 52f7eaf into master Jan 4, 2025
11 checks passed
@felangel felangel deleted the feat/hydrated-bloc-wasm branch January 4, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Enhancement candidate would introduce a breaking change enhancement New feature or request pkg:hydrated_bloc This issue is related to the hydrated_bloc package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant