Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,10 @@ android/gradlew.bat
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
/packages/**/lib/src/generated/

# FVM Version Cache
.fvm/
.fvmrc

#vscode settings
.vscode/
169 changes: 143 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,156 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
# Instabug Flutter SDK

For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/tools/pub/writing-package-pages).
Welcome to the Instabug Flutter SDK monorepo! This repository contains the official Flutter packages for integrating [Instabug](https://instabug.com/) - a comprehensive bug reporting, crash monitoring, and user feedback platform for mobile apps.

For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/to/develop-packages).
-->
## What's Inside

TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.
This monorepo houses four interconnected packages that work together to provide seamless Instabug integration for Flutter applications:

## Features
### Core Package
- **[instabug_flutter](packages/instabug_flutter/)** - The main SDK with bug reporting, crash monitoring, APM, surveys, and more

TODO: List what your package can do. Maybe include images, gifs, or videos.
### Network Logging Add-ons
- **[instabug_dio_interceptor](packages/instabug_dio_interceptor/)** - Network request logging for [Dio](https://pub.dev/packages/dio) HTTP client
- **[instabug_http_client](packages/instabug_http_client/)** - Network request logging for the standard [http](https://pub.dev/packages/http) package

## Getting started
### Navigation Integration
- **[instabug_flutter_modular](packages/instabug_flutter_modular/)** - Screen loading tracking for [Flutter Modular](https://pub.dev/packages/flutter_modular) routing

TODO: List prerequisites and provide or point to information on how to
start using the package.
Each package has its own README with detailed usage instructions and examples.

## Usage
## Development Setup

TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.
Contributing to this project? Here's how to get your development environment ready.

```dart
const like = 'sample';
### Prerequisites

- **Flutter SDK** (3.0.0 or higher recommended)
- **[FVM](https://fvm.app/)** for Flutter version management (optional but recommended)
- **Git** for version control

### Quick Start for Developers

1. **Clone the repository**
```bash
git clone https://github.com/Instabug/Instabug-Flutter.git
cd Instabug-Flutter
```

2. **Set up Flutter version** (if using FVM)
```bash
fvm use
fvm flutter --version
```

3. **Navigate to the package you want to work on**
```bash
cd packages/instabug_flutter # or any other package
```

4. **Install dependencies**
```bash
fvm flutter pub get # or just 'flutter pub get' if not using FVM
```

5. **Generate required code** (important!)
```bash
# Generate Pigeon API bindings (in instabug_flutter package)
./scripts/pigeon.sh

# Generate mock files for testing (in any package with tests)
fvm dart run build_runner build
```

### Why the Code Generation Step?

This project uses [Pigeon](https://pub.dev/packages/pigeon) to generate type-safe platform channel code and [build_runner](https://pub.dev/packages/build_runner) with [Mockito](https://pub.dev/packages/mockito) for test mocks. If you see import errors in your IDE after cloning, running the generation commands above will resolve them.

**Note**: Generated files are git-ignored (as they should be), so you'll need to run these commands whenever you:
- Clone the repo fresh
- Switch branches that modify Pigeon definitions
- Add new test files that need mocks

## Repository Structure

```
packages/
├── instabug_flutter/ # Main SDK package
│ ├── lib/ # Dart source code
│ ├── android/ # Android platform code
│ ├── ios/ # iOS platform code
│ ├── pigeons/ # Pigeon API definitions
│ ├── scripts/ # Development scripts
│ └── test/ # Unit tests
├── instabug_dio_interceptor/ # Dio HTTP integration
├── instabug_http_client/ # Standard HTTP integration
└── instabug_flutter_modular/ # Flutter Modular integration
```

Each package is independently published to pub.dev but they're developed together in this monorepo for easier maintenance and testing.

## Working with Individual Packages

### Running Tests
```bash
cd packages/[package-name]
fvm flutter test
```

### Running Example Apps
Most packages include example apps to test functionality:
```bash
cd packages/[package-name]/example
fvm flutter run
```

## Additional information
### Adding Dependencies
Each package manages its own `pubspec.yaml`. Make sure to:
1. Add dependencies to the correct package
2. Run `flutter pub get` in that package directory
3. Update version constraints appropriately

## Common Issues & Solutions

### "Target of URI doesn't exist" Errors
**Problem**: IDE shows import errors for generated files
**Solution**: Run the code generation steps above

### Permission Denied on Shell Scripts
**Problem**: `./scripts/pigeon.sh: Permission denied`
**Solution**: Make the script executable: `chmod +x scripts/pigeon.sh`

### Missing Flutter SDK Path
**Problem**: IDE can't find Flutter SDK when using FVM
**Solution**: Point your IDE to the FVM Flutter path (usually `~/.fvm/versions/[version]`)

### Build Failures After Switching Branches
**Problem**: Cached build artifacts cause issues
**Solution**: Clean and regenerate:
```bash
fvm flutter clean
fvm flutter pub get
./scripts/pigeon.sh # if in instabug_flutter package
fvm dart run build_runner build
```

## Contributing

We welcome contributions! Here's how to get started:

1. **Fork the repository** and create a feature branch
2. **Set up your development environment** (follow steps above)
3. **Make your changes** with appropriate tests
4. **Run the test suite** to ensure nothing breaks
5. **Submit a pull request** with a clear description

### Before Submitting PRs
- Run `flutter analyze` to catch static analysis issues
- Run `flutter test` to ensure all tests pass
- Update documentation if you're changing public APIs
- Follow the existing code style and conventions

## Getting Help

TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.
- ** Documentation**: Check individual package READMEs for usage examples
- ** Bug Reports**: [Create an issue](https://github.com/Instabug/Instabug-Flutter/issues) with reproduction steps
- ** Questions**: Use [GitHub Discussions](https://github.com/Instabug/Instabug-Flutter/discussions) for general questions
71 changes: 36 additions & 35 deletions packages/instabug_dio_interceptor/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ packages:
dependency: transitive
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.4.0"
clock:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.1.2"
collection:
dependency: transitive
description:
name: collection
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev"
source: hosted
version: "1.19.0"
version: "1.19.1"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -69,10 +69,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.1"
version: "1.3.3"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -105,38 +105,39 @@ packages:
path: ".."
relative: true
source: path
version: "2.6.0"
version: "2.6.1"
instabug_flutter:
dependency: "direct overridden"
dependency: transitive
description:
path: "../../instabug_flutter"
relative: true
source: path
version: "16.0.0"
name: instabug_flutter
sha256: ef2ae97c44e3fa7ecfe93f0d12786c23452df888ee0c5dc50ca0d448f19e6a86
url: "https://pub.dev"
source: hosted
version: "16.0.3"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.dev"
source: hosted
version: "10.0.7"
version: "11.0.2"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
version: "3.0.8"
version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
lints:
dependency: transitive
description:
Expand All @@ -149,10 +150,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
url: "https://pub.dev"
source: hosted
version: "0.12.16+1"
version: "0.12.17"
material_color_utilities:
dependency: transitive
description:
Expand All @@ -165,10 +166,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.15.0"
version: "1.16.0"
mime:
dependency: transitive
description:
Expand All @@ -181,10 +182,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev"
source: hosted
version: "1.9.0"
version: "1.9.1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -202,18 +203,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.12.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.4"
string_scanner:
dependency: transitive
description:
Expand All @@ -234,10 +235,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.3"
version: "0.7.6"
typed_data:
dependency: transitive
description:
Expand All @@ -250,10 +251,10 @@ packages:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.2.0"
vm_service:
dependency: transitive
description:
Expand All @@ -271,5 +272,5 @@ packages:
source: hosted
version: "1.1.1"
sdks:
dart: ">=3.5.0 <4.0.0"
dart: ">=3.8.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
Loading