-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Codebase refactor part 2 & bug fixes (#221)
* feat: introduced AliceConfiguration * feat: introduced AliceConfiguration * fix: fixed invalid count of http calls in notification * feat: set configuration optional * feat: added payload to notification * fix: format * fix: fixed tests * fix: dart format * feat: updated docs * feat: updated metadata * feat: updated tests * refactor: refactored logger * refactor: refactored codebase * refactor: refactored codebase * refactor: refactored codebase * refactor: refactored codebase * fix: fixed PR comments * fix: fixed PR comments, updated metadata * feat: updated metadata * feat: dart fix
- Loading branch information
Showing
56 changed files
with
649 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,75 @@ | ||
## Configuration | ||
|
||
1. Create Alice instance: | ||
|
||
```dart | ||
Alice alice = Alice(); | ||
``` | ||
|
||
2. Add navigator key to your application: | ||
|
||
```dart | ||
MaterialApp( navigatorKey: alice.getNavigatorKey(), home: ...) | ||
MaterialApp(navigatorKey: alice.getNavigatorKey(), home: ...); | ||
``` | ||
|
||
You need to add this navigator key in order to show inspector UI. | ||
You can use also your navigator key in Alice: | ||
|
||
```dart | ||
Alice alice = Alice(showNotification: true, navigatorKey: yourNavigatorKeyHere); | ||
Alice alice = Alice(configuration: AliceConfiguration(navigatorKey: yourNavigatorKeyHere)); | ||
``` | ||
|
||
If you need to pass navigatorKey lazily, you can use: | ||
|
||
```dart | ||
alice.setNavigatorKey(yourNavigatorKeyHere); | ||
``` | ||
This is minimal configuration required to run Alice. Can set optional settings in Alice constructor, which are presented below. If you don't want to change anything, you can move to Http clients configuration. | ||
|
||
### Additional settings | ||
This is minimal configuration required to run Alice. Can set optional settings in Alice constructor, | ||
which are presented below. If you don't want to change anything, you can move to Http clients | ||
configuration. | ||
|
||
You can set `showNotification` in Alice constructor to show notification. Clicking on this notification will open inspector. | ||
```dart | ||
Alice alice = Alice(..., showNotification: true); | ||
``` | ||
### Alice configuration | ||
|
||
You can set `showInspectorOnShake` in Alice constructor to open inspector by shaking your device (default disabled): | ||
You can pass optional `AliceConfiguration` parameter to `Alice` instance. | ||
|
||
You can set `showNotification` in Alice constructor to show notification. Clicking on this | ||
notification will open inspector. | ||
|
||
```dart | ||
Alice alice = Alice(..., showInspectorOnShake: true); | ||
Alice alice = Alice(configuration: AliceConfiguration(showNotification: true)); | ||
``` | ||
|
||
If you want to pass another notification icon, you can use `notificationIcon` parameter. Default value is @mipmap/ic_launcher. | ||
You can set `showInspectorOnShake` in Alice constructor to open inspector by shaking your device ( | ||
default disabled): | ||
|
||
```dart | ||
Alice alice = Alice(..., notificationIcon: "myNotificationIconResourceName"); | ||
Alice alice = Alice(configuration: AliceConfiguation(showInspectorOnShake: true)); | ||
``` | ||
|
||
If you want to limit max numbers of HTTP calls saved in memory, you may use `maxCallsCount` parameter. | ||
If you want to pass another notification icon, you can use `notificationIcon` parameter. Default | ||
value is @mipmap/ic_launcher. | ||
|
||
```dart | ||
Alice alice = Alice(..., maxCallsCount: 1000)); | ||
Alice alice = Alice(configuration: AliceConfiguration(notificationIcon: "myNotificationIconResourceName")); | ||
``` | ||
|
||
If you want to change the Directionality of Alice, you can use the `directionality` parameter. If the parameter is set to null, the Directionality of the app will be used. | ||
If you want to change the Directionality of Alice, you can use the `directionality` parameter. If | ||
the parameter is set to null, the Directionality of the app will be used. | ||
|
||
```dart | ||
Alice alice = Alice(..., directionality: TextDirection.ltr); | ||
Alice alice = Alice(configuration: AliceConfiguration(directionality: TextDirection.ltr)); | ||
``` | ||
|
||
If you want to hide share button, you can use `showShareButton` parameter. | ||
|
||
```dart | ||
Alice alice = Alice(..., showShareButton: false); | ||
Alice alice = Alice(configuration: AliceConfiguration(showShareButton: false)); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.