Skip to content

Commit 34a6a25

Browse files
authored
feat: Teaching tip (#570)
2 parents cba8ba3 + 5dc95b0 commit 34a6a25

15 files changed

Lines changed: 1453 additions & 162 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
- feat: Handle `TextBox` context menu controls on mobile platforms ([#1022](https://github.com/bdlukaa/fluent_ui/issues/1022))
4141
- fix: Default `TextBox` border
4242
- feat: Added Nepali localization support ([#1177](https://github.com/bdlukaa/fluent_ui/pull/1177))
43+
- feat: Teaching Tips ([#412](https://github.com/bdlukaa/fluent_ui/issues/412))
44+
- feat: Added more flyout placement modes: `leftTop`, `leftCenter`, `leftBottom`, `rightTop`, `rightCenter` and `rightBottom`. `left` and `right` are now deprecated and default to `leftCenter` and `rightCenter`, respectively. Additionally, added the `full` placement mode, which allows the flyout to position itself within the screen. ([#570](https://github.com/bdlukaa/fluent_ui/pull/570))
4345

4446
## 4.10.0
4547

example/lib/main.dart

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,22 +301,28 @@ class _MyHomePageState extends State<MyHomePage> with WindowListener {
301301
title: const Text('ContentDialog'),
302302
body: const SizedBox.shrink(),
303303
),
304+
PaneItem(
305+
key: const ValueKey('/popups/flyout'),
306+
icon: const Icon(FluentIcons.pop_expand),
307+
title: const Text('Flyout'),
308+
body: const SizedBox.shrink(),
309+
),
304310
PaneItem(
305311
key: const ValueKey('/popups/menu_bar'),
306312
icon: const Icon(FluentIcons.expand_menu),
307313
title: const Text('MenuBar'),
308314
body: const SizedBox.shrink(),
309315
),
310316
PaneItem(
311-
key: const ValueKey('/popups/tooltip'),
312-
icon: const Icon(FluentIcons.hint_text),
313-
title: const Text('Tooltip'),
317+
key: const ValueKey('/popups/teaching_tip'),
318+
icon: const Icon(FluentIcons.field_filled),
319+
title: const Text('Teaching Tip'),
314320
body: const SizedBox.shrink(),
315321
),
316322
PaneItem(
317-
key: const ValueKey('/popups/flyout'),
318-
icon: const Icon(FluentIcons.pop_expand),
319-
title: const Text('Flyout'),
323+
key: const ValueKey('/popups/tooltip'),
324+
icon: const Icon(FluentIcons.hint_text),
325+
title: const Text('Tooltip'),
320326
body: const SizedBox.shrink(),
321327
),
322328
PaneItemHeader(header: const Text('Theming')),
@@ -974,6 +980,15 @@ final router = GoRouter(navigatorKey: rootNavigatorKey, routes: [
974980
),
975981
),
976982

983+
/// Teaching Tip
984+
GoRoute(
985+
path: '/popups/teaching_tip',
986+
builder: (context, state) => DeferredWidget(
987+
surfaces.loadLibrary,
988+
() => popups.TeachingTipPage(),
989+
),
990+
),
991+
977992
/// /// Theming
978993
/// Colors
979994
GoRoute(

example/lib/routes/popups.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export '../screens/popups/content_dialog.dart';
22
export '../screens/popups/menu_bar.dart';
33
export '../screens/popups/flyout.dart';
4+
export '../screens/popups/teaching_tip.dart';
45
export '../screens/popups/tooltip.dart';

example/lib/routes/surfaces.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ export '../screens/surface/commandbars.dart';
33
export '../screens/surface/expander.dart';
44
export '../screens/surface/info_bars.dart';
55
export '../screens/surface/progress_indicators.dart';
6+
export '../screens/popups/teaching_tip.dart';
67
export '../screens/surface/tiles.dart';

example/lib/screens/navigation/navigation_view.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class NavigationViewPage extends StatefulWidget {
1515

1616
class _NavigationViewPageState extends State<NavigationViewPage>
1717
with PageMixin {
18-
static const double itemHeight = 300.0;
18+
static const double itemHeight = 500.0;
1919

2020
int topIndex = 0;
2121

@@ -66,6 +66,7 @@ class _NavigationViewPageState extends State<NavigationViewPage>
6666
enabled: false,
6767
onTap: () => debugPrint('Tapped disabled'),
6868
),
69+
PaneItemHeader(header: const Text('Apps')),
6970
PaneItemExpander(
7071
icon: const Icon(FluentIcons.account_management),
7172
title: const Text('Account'),
@@ -84,7 +85,6 @@ class _NavigationViewPageState extends State<NavigationViewPage>
8485
),
8586
onTap: () => debugPrint('Tapped account'),
8687
items: [
87-
PaneItemHeader(header: const Text('Apps')),
8888
PaneItem(
8989
icon: const Icon(FluentIcons.mail),
9090
title: const Text('Mail'),
@@ -376,13 +376,13 @@ NavigationView(
376376
selected: topIndex,
377377
onItemPressed: (index) {
378378
// Do anything you want to do, such as:
379-
if (index == topIndex) {
380-
if (displayMode == PaneDisplayMode.open) {
381-
setState(() => this.displayMode = PaneDisplayMode.compact);
382-
} else if (displayMode == PaneDisplayMode.compact) {
383-
setState(() => this.displayMode = PaneDisplayMode.open);
384-
}
385-
}
379+
// if (index == topIndex) {
380+
// if (displayMode == PaneDisplayMode.open) {
381+
// setState(() => this.displayMode = PaneDisplayMode.compact);
382+
// } else if (displayMode == PaneDisplayMode.compact) {
383+
// setState(() => this.displayMode = PaneDisplayMode.open);
384+
// }
385+
// }
386386
},
387387
onChanged: (index) => setState(() => topIndex = index),
388388
displayMode: displayMode,

0 commit comments

Comments
 (0)