Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

build/

.idea/
.idea/
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 2.0.1 - 2026-05-05
- fix: SSE connection now pauses when app is backgrounded and resumes when app returns to foreground. Prevents unnecessary battery drain.

## 2.0.0 - 2026-05-04
- Add `FlushbarRemote` for optional remote notification support via FlushKit (api.flushkit.dev)
- Add `FlushbarRemoteEvent` data class for raw event access
- Add `lib/another_flushbar.dart` convenience barrel export
- Add `http: ^1.2.0` dependency
- No breaking changes to existing API

## 1.12.32 - 2025-09-08
- Prevent crashes from null checks in Flushbar route lifecycle (isDismissed, isAppearing, isHiding)
## 1.12.31 - 2025-09-01
- minor improvements
## 1.12.30 - 2023-11-05
- bump version
## 1.12.30-dev.1 - 2023-09-05
Expand Down Expand Up @@ -373,4 +387,4 @@ smooth content transition
- Single button action
- Status listeners
- Left or right icon positioning
- Top or bottom positioning
- Top or bottom positioning
718 changes: 325 additions & 393 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:flutter_lints/flutter.yaml
linter:
rules:
constant_identifier_names: false
constant_identifier_names: false
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
package io.flutter.plugins;

import io.flutter.plugin.common.PluginRegistry;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.Log;

import io.flutter.embedding.engine.FlutterEngine;

/**
* Generated file. Do not edit.
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
public static void registerWith(PluginRegistry registry) {
if (alreadyRegisteredWith(registry)) {
return;
}
}

private static boolean alreadyRegisteredWith(PluginRegistry registry) {
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
if (registry.hasPlugin(key)) {
return true;
}
registry.registrarFor(key);
return false;
private static final String TAG = "GeneratedPluginRegistrant";
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
}
}
4 changes: 2 additions & 2 deletions android/local.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sdk.dir=/Users/hamidwakili/Library/Android/sdk
flutter.sdk=/Users/hamidwakili/flutter
sdk.dir=/Users/hamid.wakili/Library/Android/sdk
flutter.sdk=/Users/hamid.wakili/development/flutter
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: Flutter

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011

COCOAPODS: 1.11.2
COCOAPODS: 1.16.2
8 changes: 4 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -325,7 +325,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -399,7 +399,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -448,7 +448,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -50,6 +50,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
121 changes: 121 additions & 0 deletions example/lib/remote_example.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// An end-to-end example showing how to integrate FlushbarRemote into a Flutter
// app. Replace 'YOUR_FLUSHKIT_API_KEY' with a real key from api.flushkit.dev.
//
// Run with: flutter run -t example/remote_example.dart

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

void main() => runApp(const RemoteExampleApp());

class RemoteExampleApp extends StatelessWidget {
const RemoteExampleApp({super.key});

@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'FlushbarRemote Example',
home: RemoteHomePage(),
);
}
}

class RemoteHomePage extends StatefulWidget {
const RemoteHomePage({super.key});

@override
State<RemoteHomePage> createState() => _RemoteHomePageState();
}

class _RemoteHomePageState extends State<RemoteHomePage> {
FlushbarRemoteEvent? _lastEvent;

@override
void initState() {
super.initState();

// Wait for the first frame so the Navigator is ready to push the Flushbar
// route before we start receiving events.
WidgetsBinding.instance.addPostFrameCallback((_) {
FlushbarRemote.init(
apiKey: 'fk_live_66964da5235433a8fb272fbb11d2c16cf62b952ef501a0379fdaaf53fd5a438d',
context: context,
);

// Subscribe to raw events if you need custom handling in addition to
// (or instead of) the automatic Flushbar display.
FlushbarRemote.events.listen((event) {
setState(() => _lastEvent = event);
});
});
}

@override
void dispose() {
// Always call dispose() so the SSE connection and timers are cleaned up.
FlushbarRemote.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('FlushbarRemote Example')),
body: Padding(
padding: const EdgeInsets.all(24),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Text(
'Waiting for remote notifications from FlushKit…',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16),
),
const SizedBox(height: 32),
if (_lastEvent != null) ...[
const Text(
'Last event (via FlushbarRemote.events stream):',
style: TextStyle(fontWeight: FontWeight.bold),
),
const SizedBox(height: 8),
Card(
color: _lastEvent!.backgroundColor,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (_lastEvent!.title != null)
Text(
_lastEvent!.title!,
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
Text(
_lastEvent!.message,
style: const TextStyle(color: Colors.white),
),
const SizedBox(height: 4),
Text(
'Position: ${_lastEvent!.position.name} '
'Duration: ${_lastEvent!.duration.inSeconds}s',
style: const TextStyle(
color: Colors.white70,
fontSize: 12,
),
),
],
),
),
),
],
],
),
),
);
}
}
Loading