Skip to content

Commit daae1ac

Browse files
Merge pull request #522 from Instabug/refactor/monorepo-modular-package
Refactor: merge modular package into mono-repo
2 parents 64f42aa + 3201240 commit daae1ac

File tree

90 files changed

+3785
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+3785
-0
lines changed

.circleci/config.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,14 @@ jobs:
326326
- run: chmod +x packages/Instabug-Dart-http-Adapter/release.sh
327327
- run: ./packages/Instabug-Dart-http-Adapter/release.sh
328328

329+
release_modular_plugin:
330+
executor: flutter-executor
331+
steps:
332+
- advanced-checkout/shallow-checkout
333+
- setup_flutter
334+
- run: chmod +x packages/instabug_flutter_modular/release.sh
335+
- run: ./packages/instabug_flutter_modular/release.sh
336+
329337
release_instabug_flutter:
330338
macos:
331339
xcode: 15.2.0
@@ -432,6 +440,20 @@ workflows:
432440
filters:
433441
branches:
434442
only: master
443+
- hold_release_modular_plugin:
444+
type: approval
445+
requires:
446+
- test_flutter-stable
447+
filters:
448+
branches:
449+
only: master
450+
- release_modular_plugin:
451+
requires:
452+
- hold_release_modular_plugin
453+
- verify_pub
454+
filters:
455+
branches:
456+
only: master
435457
- release_instabug_flutter:
436458
requires:
437459
- hold_release_instabug_flutter
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "367f9ea16bfae1ca451b9cc27c1366870b187ae2"
8+
channel: "stable"
9+
10+
project_type: package
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
## [v1.0.0](https://github.com/Instabug/instabug_flutter_modular/commits/v1.0.0/) (July 7, 2024)
4+
5+
### Added
6+
7+
- Add support for capturing screen loading time in Flutter Modular v5 ([#477](https://github.com/Instabug/Instabug-Flutter/pull/477)).
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Instabug
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Instabug Flutter Modular
2+
3+
[![Pub](https://img.shields.io/pub/v/instabug_flutter_modular.svg)](https://pub.dev/packages/instabug_flutter_modular)
4+
[![Twitter](https://img.shields.io/badge/twitter-@Instabug-blue.svg)](https://twitter.com/Instabug)
5+
6+
An add-on for the [Instabug Flutter SDK](https://github.com/Instabug/Instabug-Flutter) that provides screen loading support for [Flutter Modular](https://pub.dev/packages/flutter_modular) v5.
7+
8+
## Installation
9+
10+
1. Add `instabug_flutter_modular` to your `pubspec.yaml` file.
11+
12+
```yaml
13+
dependencies:
14+
instabug_flutter_modular:
15+
```
16+
17+
2. Install the package by running the following command.
18+
19+
```sh
20+
flutter pub get
21+
```
22+
23+
## Usage
24+
25+
1. Wrap your `AppParentModule` inside `InstabugModule`:
26+
27+
28+
```dart
29+
30+
void main() {
31+
//...
32+
33+
runApp(
34+
ModularApp(
35+
module: InstabugModule(AppModule()),
36+
child: const MyApp(),
37+
),
38+
);
39+
}
40+
```
41+
42+
2. Add `InstabugNavigatorObserver` to your navigation observers list:
43+
44+
```dart
45+
@override
46+
Widget build(BuildContext context) {
47+
return MaterialApp.router(
48+
routeInformationParser: Modular.routeInformationParser,
49+
routerDelegate: Modular.routerDelegate
50+
..setObservers([InstabugNavigatorObserver()]),
51+
52+
// ...
53+
);
54+
}
55+
```
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
27+
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
30+
.metadata
31+
.pub-cache/
32+
.pub/
33+
/build/
34+
35+
# Symbolication related
36+
app.*.symbols
37+
38+
# Obfuscation related
39+
app.*.map.json
40+
41+
# Android Studio will place build artifacts here
42+
/android/app/debug
43+
/android/app/profile
44+
/android/app/release
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
7+
def localProperties = new Properties()
8+
def localPropertiesFile = rootProject.file('local.properties')
9+
if (localPropertiesFile.exists()) {
10+
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localProperties.load(reader)
12+
}
13+
}
14+
15+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16+
if (flutterVersionCode == null) {
17+
flutterVersionCode = '1'
18+
}
19+
20+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
if (flutterVersionName == null) {
22+
flutterVersionName = '1.0'
23+
}
24+
25+
android {
26+
namespace "com.example.flutter_modular_demo_app"
27+
compileSdk flutter.compileSdkVersion
28+
ndkVersion flutter.ndkVersion
29+
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_1_8
32+
targetCompatibility JavaVersion.VERSION_1_8
33+
}
34+
35+
kotlinOptions {
36+
jvmTarget = '1.8'
37+
}
38+
39+
sourceSets {
40+
main.java.srcDirs += 'src/main/kotlin'
41+
}
42+
43+
defaultConfig {
44+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
45+
applicationId "com.example.flutter_modular_demo_app"
46+
// You can update the following values to match your application needs.
47+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48+
minSdkVersion flutter.minSdkVersion
49+
targetSdkVersion flutter.targetSdkVersion
50+
versionCode flutterVersionCode.toInteger()
51+
versionName flutterVersionName
52+
}
53+
54+
buildTypes {
55+
release {
56+
// TODO: Add your own signing config for the release build.
57+
// Signing with the debug keys for now, so `flutter run --release` works.
58+
signingConfig signingConfigs.debug
59+
}
60+
}
61+
}
62+
63+
flutter {
64+
source '../..'
65+
}
66+
67+
dependencies {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<application
3+
android:label="flutter_modular_demo_app"
4+
android:name="${applicationName}"
5+
android:networkSecurityConfig="@xml/network_security_config"
6+
android:usesCleartextTraffic="true"
7+
android:icon="@mipmap/ic_launcher">
8+
<activity
9+
android:name=".MainActivity"
10+
android:exported="true"
11+
android:launchMode="singleTop"
12+
android:theme="@style/LaunchTheme"
13+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
14+
android:hardwareAccelerated="true"
15+
android:windowSoftInputMode="adjustResize">
16+
<!-- Specifies an Android theme to apply to this Activity as soon as
17+
the Android process has started. This theme is visible to the user
18+
while the Flutter UI initializes. After that, this theme continues
19+
to determine the Window background behind the Flutter UI. -->
20+
<meta-data
21+
android:name="io.flutter.embedding.android.NormalTheme"
22+
android:resource="@style/NormalTheme"
23+
/>
24+
<intent-filter>
25+
<action android:name="android.intent.action.MAIN"/>
26+
<category android:name="android.intent.category.LAUNCHER"/>
27+
</intent-filter>
28+
</activity>
29+
<!-- Don't delete the meta-data below.
30+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
31+
<meta-data
32+
android:name="flutterEmbedding"
33+
android:value="2" />
34+
</application>
35+
<!-- Required to query activities that can process text, see:
36+
https://developer.android.com/training/package-visibility?hl=en and
37+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
38+
39+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
40+
<queries>
41+
<intent>
42+
<action android:name="android.intent.action.PROCESS_TEXT"/>
43+
<data android:mimeType="text/plain"/>
44+
</intent>
45+
</queries>
46+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Generated file.
2+
//
3+
// If you wish to remove Flutter's multidex support, delete this entire file.
4+
//
5+
// Modifications to this file should be done in a copy under a different name
6+
// as this file may be regenerated.
7+
8+
package io.flutter.app;
9+
10+
import android.app.Application;
11+
import android.content.Context;
12+
import androidx.annotation.CallSuper;
13+
import androidx.multidex.MultiDex;
14+
15+
/**
16+
* Extension of {@link android.app.Application}, adding multidex support.
17+
*/
18+
public class FlutterMultiDexApplication extends Application {
19+
@Override
20+
@CallSuper
21+
protected void attachBaseContext(Context base) {
22+
super.attachBaseContext(base);
23+
MultiDex.install(this);
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.example.flutter_modular_demo_app
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="?android:colorBackground" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="@android:color/white" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Loading
Loading
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5+
<!-- Show a splash screen on the activity. Automatically removed when
6+
the Flutter engine draws its first frame -->
7+
<item name="android:windowBackground">@drawable/launch_background</item>
8+
</style>
9+
<!-- Theme applied to the Android Window as soon as the process has started.
10+
This theme determines the color of the Android Window while your
11+
Flutter UI initializes, as well as behind your Flutter UI while its
12+
running.
13+
14+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
17+
</style>
18+
</resources>

0 commit comments

Comments
 (0)