Skip to content

Commit

Permalink
WideLayout: add yaru transition (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier committed Sep 20, 2022
1 parent 5825bba commit 7d663a1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion lib/src/pages/layouts/yaru_wide_layout.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

/// Creates a [NavigationRail] wrapped inside [Row]
Expand Down Expand Up @@ -125,7 +126,23 @@ class _YaruWideLayoutState extends State<YaruWideLayout> {
),
const VerticalDivider(thickness: 1, width: 1),
Expanded(
child: widget.pageItems[_selectedIndex].builder(context),
child: Theme(
data: Theme.of(context).copyWith(
pageTransitionsTheme: YaruPageTransitionsTheme.vertical,
),
child: Navigator(
pages: [
MaterialPage(
key: ValueKey(_selectedIndex),
child: widget.pageItems.length > _selectedIndex
? widget.pageItems[_selectedIndex]
.builder(context)
: widget.pageItems[0].builder(context),
),
],
onPopPage: (route, result) => route.didPop(result),
),
),
)
],
),
Expand Down

0 comments on commit 7d663a1

Please sign in to comment.