feat: add local-first private AI digest workflow
Migrate app code into canonical feature slices, add phone-only AI digest scheduling and review, wire local notification/background task support, and cover the flow with tests.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
# Core Network
|
||||
|
||||
This folder owns shared networking infrastructure. It is the right place for
|
||||
transport concerns like reachability and interceptors, not feature business logic.
|
||||
@@ -0,0 +1,4 @@
|
||||
# Network Interceptors
|
||||
|
||||
Request and response interception belongs here. Keep these classes stateless and
|
||||
transport-focused so features do not need to know about client plumbing.
|
||||
@@ -0,0 +1,4 @@
|
||||
# Reachability
|
||||
|
||||
Network availability checks and platform-specific reachability code live here.
|
||||
This folder should answer "can we talk to the network?" and nothing more.
|
||||
@@ -30,19 +30,17 @@ class IoNetworkReachability implements NetworkReachability {
|
||||
Stream<bool> watch({Duration timeout = const Duration(seconds: 2)}) {
|
||||
final Stream<dynamic> changes =
|
||||
_connectivity.onConnectivityChanged as Stream<dynamic>;
|
||||
return changes
|
||||
.asyncMap((dynamic event) async {
|
||||
final Iterable<ConnectivityResult> results =
|
||||
_normalizeConnectivityResults(event);
|
||||
final bool hasTransport = results.any(
|
||||
(ConnectivityResult result) => result != ConnectivityResult.none,
|
||||
);
|
||||
if (!hasTransport) {
|
||||
return false;
|
||||
}
|
||||
return isReachable(timeout: timeout);
|
||||
})
|
||||
.distinct();
|
||||
return changes.asyncMap((dynamic event) async {
|
||||
final Iterable<ConnectivityResult> results =
|
||||
_normalizeConnectivityResults(event);
|
||||
final bool hasTransport = results.any(
|
||||
(ConnectivityResult result) => result != ConnectivityResult.none,
|
||||
);
|
||||
if (!hasTransport) {
|
||||
return false;
|
||||
}
|
||||
return isReachable(timeout: timeout);
|
||||
}).distinct();
|
||||
}
|
||||
|
||||
Iterable<ConnectivityResult> _normalizeConnectivityResults(dynamic event) {
|
||||
|
||||
Reference in New Issue
Block a user