Skip to content

Commit 88edcdd

Browse files
chore: update logo (#16)
Co-authored-by: Manuel Plavsic <55398763+manuel-plavsic@users.noreply.github.com>
1 parent 545b40c commit 88edcdd

File tree

9 files changed

+54
-69
lines changed

9 files changed

+54
-69
lines changed

README.md

+16-21
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77

88
# Disco
99

10-
<img src="https://raw.githubusercontent.com/our-creativity/disco/main/assets/disco.jpeg" height="400">
11-
12-
---
13-
1410
A modern, convenient, simple and safe way to do scoped dependency injection in Flutter.
1511

1612
For learning how to use [Disco](https://github.com/our-creativity/disco), see its documentation: >>> https://disco.mariuti.com <<<
@@ -25,29 +21,28 @@ For learning how to use [Disco](https://github.com/our-creativity/disco), see it
2521

2622
## Usage
2723

28-
### Creating a provider
24+
1. Create a provider
2925

30-
```dart
31-
final modelProvider = Provider((context) => Model());
32-
```
26+
```dart
27+
final modelProvider = Provider((context) => Model());
28+
```
3329
34-
### Providing a provider
30+
2. Scope/provide the provider
3531
36-
```dart
37-
ProviderScope(
38-
providers: [modelProvider],
39-
child: MyWidget(),
40-
)
41-
```
32+
```dart
33+
ProviderScope(
34+
providers: [modelProvider],
35+
child: MyWidget(),
36+
)
37+
```
4238
43-
### Retrieving a provider
44-
```dart
45-
final model = modelProvider.of(context);
46-
```
39+
3. Inject the provider (within the above `ProviderScope`'s subtree)
4740
48-
You can retrieve a provider from any widget in the subtree of the `ProviderScope` where the provider has been provided.
41+
```dart
42+
final model = modelProvider.of(context);
43+
```
4944
50-
### Examples
45+
## Examples
5146
5247
There are multiple examples on the repository:
5348

docs/astro.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default defineConfig({
1818
tag: 'meta',
1919
attrs: {
2020
property: 'og:image',
21-
content: 'https://disco.mariuti.com/disco.jpeg',
21+
content: 'https://disco.mariuti.com/disco.png',
2222
}
2323
}],
2424
sidebar: [

docs/public/disco.jpeg

-192 KB
Binary file not shown.

docs/public/disco.png

136 KB
Loading

docs/src/content/docs/index.mdx

+17-20
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,32 @@ title: Disco
33
description: Official documentation for Disco, a modern and simple library for scoped dependency injection in Flutter.
44
---
55

6-
<img src="disco.jpeg" alt="disco image" width="500" style="border: 1px solid grey;"/>
7-
86
Disco is a library introducing a new concept of providers that operate differently from those already present in the Flutter ecosystem. It was developed to overcome the challenges and limitations in the context of dependency injection.
97

108
## Usage
119

12-
### Creating a provider
10+
1. Create a provider
1311

14-
```dart
15-
final modelProvider = Provider((context) => Model());
16-
```
12+
```dart
13+
final modelProvider = Provider((context) => Model());
14+
```
1715

18-
### Providing a provider
16+
2. Scope/provide the provider
1917

20-
```dart
21-
ProviderScope(
22-
providers: [modelProvider],
23-
child: MyWidget(),
24-
)
25-
```
18+
```dart
19+
ProviderScope(
20+
providers: [modelProvider],
21+
child: MyWidget(),
22+
)
23+
```
2624

27-
### Retrieving a provider
28-
```dart
29-
final model = modelProvider.of(context);
30-
```
25+
3. Inject the provider (within the above `ProviderScope`'s subtree)
3126

32-
You can retrieve a provider from any widget in the subtree of the `ProviderScope` where the provider has been provided.
27+
```dart
28+
final model = modelProvider.of(context);
29+
```
3330

34-
To get straight to the point, pros and cons are summarized below.
31+
## Trade-offs
3532

3633
### Pros
3734

@@ -72,6 +69,6 @@ In Disco's defense regarding the last point:
7269
- Disco providers also have a `maybeOf(context)` method, which can help if the presence of a provider cannot be guaranteed.
7370
- The throwable includes precise information in its stack trace to deduce the missing provider: filepath, line and column.
7471

75-
## Keep in mind: trade-offs
72+
### Keep in mind
7673

7774
As the <a href="/authors">authors of Disco</a>, we believe this to be the most effective strategy for DI in Flutter. However, every solution has trade-offs. You can limit the impact of these trade-offs by running tests, doing code reviews, and following other crucial practices.

packages/disco/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.0+1
2+
3+
- **CHORE**: Update README.md
4+
15
## 1.0.0
26

37
- Added comprehensive documentation (see [Disco homepage](https://disco.mariuti.com)) with numerous examples.

packages/disco/README.md

+15-20
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77

88
# Disco
99

10-
<img src="https://raw.githubusercontent.com/our-creativity/disco/main/assets/disco.jpeg" height="400">
11-
12-
---
13-
1410
A modern, convenient, simple and safe way to do scoped dependency injection in Flutter.
1511

1612
For learning how to use [Disco](https://github.com/our-creativity/disco), see its documentation: >>> https://disco.mariuti.com <<<
@@ -25,27 +21,26 @@ For learning how to use [Disco](https://github.com/our-creativity/disco), see it
2521

2622
## Usage
2723

28-
### Creating a provider
24+
1. Create a provider
2925

30-
```dart
31-
final modelProvider = Provider((context) => Model());
32-
```
26+
```dart
27+
final modelProvider = Provider((context) => Model());
28+
```
3329
34-
### Providing a provider
30+
2. Scope/provide the provider
3531
36-
```dart
37-
ProviderScope(
38-
providers: [modelProvider],
39-
child: MyWidget(),
40-
)
41-
```
32+
```dart
33+
ProviderScope(
34+
providers: [modelProvider],
35+
child: MyWidget(),
36+
)
37+
```
4238
43-
### Retrieving a provider
44-
```dart
45-
final model = modelProvider.of(context);
46-
```
39+
3. Inject the provider (within the above `ProviderScope`'s subtree)
4740
48-
You can retrieve a provider from any widget in the subtree of the `ProviderScope` where the provider has been provided.
41+
```dart
42+
final model = modelProvider.of(context);
43+
```
4944
5045
### Examples
5146

packages/disco/example/lib/main.dart

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import 'package:disco/disco.dart';
22
import 'package:flutter/material.dart';
33

4-
/// ---
5-
/// Model
6-
/// ---
74
abstract class Model extends ChangeNotifier {
85
void incrementCounter();
96

@@ -23,9 +20,6 @@ class ModelImplementation extends Model {
2320
}
2421
}
2522

26-
/// ---
27-
/// Provider
28-
/// ---
2923
final modelProvider = Provider<Model>((context) => ModelImplementation());
3024

3125
void main() {

packages/disco/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: disco
22
description: A Flutter library bringing a new concept of scoped providers for dependency injection, which are independent of any specific state management solution.
3-
version: 1.0.0
3+
version: 1.0.0+1
44
repository: https://github.com/our-creativity/disco
55
homepage: https://disco.mariuti.com
66
documentation: https://disco.mariuti.com

0 commit comments

Comments
 (0)