Skip to content

Commit b89fd21

Browse files
committed
update app-icons and router docs
1 parent 5137756 commit b89fd21

File tree

2 files changed

+72
-9
lines changed

2 files changed

+72
-9
lines changed

resources/docs/6.x/app-icons.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [App icon filename](#app-icon-filenames "App icon filenames")
1010
- [App icon filetype](#app-icon-filetype "App icon filetype")
1111
- [Configuration](#configuration "Configuration for app icons")
12+
- [Badge Count](#badge-count "Badge Count")
1213

1314
<a name="introduction"></a>
1415
<br>
@@ -90,3 +91,24 @@ You can also modify the settings when generating your app icons.
9091
Inside the `pubspec.yaml` file, look for the `flutter_icons` section, and here you can make changes to the configuration.
9192

9293
Check out the official <a href="https://pub.dev/packages/flutter_launcher_icons" target="_BLANK">flutter_launcher_icons</a> library to see what's possible.
94+
95+
<a name="badge-count"></a>
96+
<br>
97+
98+
## Badge Count
99+
100+
You can also add a badge count to your app icon. This is the little red circle with a number in it that appears on the app icon.
101+
102+
To set the badge count, use the below code snippet.
103+
104+
``` dart
105+
setBadgeNumber(5);
106+
```
107+
108+
This will set the badge count to 5.
109+
110+
To remove the badge count, use the below code snippet.
111+
112+
``` dart
113+
clearBadgeNumber();
114+
```

resources/docs/6.x/router.md

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,25 +437,66 @@ appRouter() => nyRoutes((router) {
437437
438438
// bottomToTop
439439
router.add(SettingsPage.path,
440-
transition: PageTransitionType.bottomToTop
440+
transitionType: TransitionType.bottomToTop()
441441
);
442442
443443
// fade
444444
router.add(HomePage.path,
445-
transition: PageTransitionType.fade
445+
transitionType: TransitionType.fade()
446446
);
447447
448448
});
449449
```
450450

451-
Available transitions:
452-
- PageTransitionType.fade
453-
- PageTransitionType.rightToLeft
454-
- PageTransitionType.leftToRight
455-
- PageTransitionType.topToBottom
456-
- PageTransitionType.bottomToTop
451+
### Available Page Transitions
452+
453+
#### Basic Transitions
454+
- **`TransitionType.fade()`** - Fades the new page in while fading the old page out
455+
- **`TransitionType.theme()`** - Uses the app theme's page transitions theme
456+
457+
#### Directional Slide Transitions
458+
- **`TransitionType.rightToLeft()`** - Slides from right edge of screen
459+
- **`TransitionType.leftToRight()`** - Slides from left edge of screen
460+
- **`TransitionType.topToBottom()`** - Slides from top edge of screen
461+
- **`TransitionType.bottomToTop()`** - Slides from bottom edge of screen
462+
463+
#### Slide with Fade Transitions
464+
- **`TransitionType.rightToLeftWithFade()`** - Slides and fades from right edge
465+
- **`TransitionType.leftToRightWithFade()`** - Slides and fades from left edge
466+
467+
#### Transform Transitions
468+
- **`TransitionType.scale(alignment: ...)`** - Scales from specified alignment point
469+
- **`TransitionType.rotate(alignment: ...)`** - Rotates around specified alignment point
470+
- **`TransitionType.size(alignment: ...)`** - Grows from specified alignment point
471+
472+
#### Joined Transitions (Requires current widget)
473+
- **`TransitionType.leftToRightJoined(childCurrent: ...)`** - Current page exits right while new page enters from left
474+
- **`TransitionType.rightToLeftJoined(childCurrent: ...)`** - Current page exits left while new page enters from right
475+
- **`TransitionType.topToBottomJoined(childCurrent: ...)`** - Current page exits down while new page enters from top
476+
- **`TransitionType.bottomToTopJoined(childCurrent: ...)`** - Current page exits up while new page enters from bottom
477+
478+
#### Pop Transitions (Requires current widget)
479+
- **`TransitionType.leftToRightPop(childCurrent: ...)`** - Current page exits to right, new page stays in place
480+
- **`TransitionType.rightToLeftPop(childCurrent: ...)`** - Current page exits to left, new page stays in place
481+
- **`TransitionType.topToBottomPop(childCurrent: ...)`** - Current page exits down, new page stays in place
482+
- **`TransitionType.bottomToTopPop(childCurrent: ...)`** - Current page exits up, new page stays in place
483+
484+
#### Material Design Shared Axis Transitions
485+
- **`TransitionType.sharedAxisHorizontal()`** - Horizontal slide and fade transition
486+
- **`TransitionType.sharedAxisVertical()`** - Vertical slide and fade transition
487+
- **`TransitionType.sharedAxisScale()`** - Scale and fade transition
488+
489+
#### Customization Parameters
490+
Each transition accepts the following optional parameters:
491+
492+
| Parameter | Description | Default |
493+
|-----------|-------------|---------|
494+
| `curve` | Animation curve | Platform-specific curves |
495+
| `duration` | Animation duration | Platform-specific durations |
496+
| `reverseDuration` | Reverse animation duration | Same as duration |
497+
| `fullscreenDialog` | Whether the route is a fullscreen dialog | `false` |
498+
| `opaque` | Whether the route is opaque | `false` |
457499

458-
You can also apply a transition when navigating to a new page in your project.
459500

460501
``` dart
461502
// Home page widget

0 commit comments

Comments
 (0)