Skip to content

Commit

Permalink
Merge pull request #579 from MrGumpIT/develop
Browse files Browse the repository at this point in the history
 Use Notch Area while in Full screen mode
  • Loading branch information
CodeDoctorDE authored Feb 1, 2024
2 parents 4716732 + b47e76a commit 4167485
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 47 deletions.
48 changes: 23 additions & 25 deletions app/lib/views/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -427,31 +427,29 @@ class _ProjectPageState extends State<ProjectPage> {
ChangeToolIntent(context, k))),
},
},
child: SafeArea(
child: ClipRect(
child: Focus(
autofocus: true,
skipTraversal: true,
onFocusChange: (_) => false,
child: Scaffold(
appBar:
state is DocumentPresentationState ||
settings.fullScreen ||
currentIndex.hideUi !=
HideState.visible
? null
: PadAppBar(
viewportKey: _viewportKey,
),
drawer: state is DocumentLoadSuccess
? const DocumentNavigator(
asDrawer: true)
: null,
body: Actions(
actions: _actions,
child: const _MainBody(),
)),
),
child: ClipRect(
child: Focus(
autofocus: true,
skipTraversal: true,
onFocusChange: (_) => false,
child: Scaffold(
appBar:
state is DocumentPresentationState ||
settings.fullScreen ||
currentIndex.hideUi !=
HideState.visible
? null
: PadAppBar(
viewportKey: _viewportKey,
),
drawer: state is DocumentLoadSuccess
? const DocumentNavigator(
asDrawer: true)
: null,
body: Actions(
actions: _actions,
child: const _MainBody(),
)),
),
),
),
Expand Down
46 changes: 24 additions & 22 deletions app/lib/views/toolbar/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,30 @@ class _ToolbarViewState extends State<ToolbarView> {
};
return Align(
alignment: alignment,
child: Card(
child: BlocBuilder<CurrentIndexCubit, CurrentIndex>(
buildWhen: (previous, current) =>
previous.temporaryToolbar != current.temporaryToolbar ||
previous.toolbar != current.toolbar,
builder: (context, currentIndex) {
Widget? child;
var height = 0.0;
final toolbar =
currentIndex.temporaryToolbar ?? currentIndex.toolbar;
if (toolbar != null) {
height = toolbar.preferredSize.height;
child = toolbar;
}
return AnimatedContainer(
height: height,
key: _animatedKey,
curve: Curves.fastOutSlowIn,
duration: const Duration(milliseconds: 200),
child: child,
);
}),
child: SafeArea(
child: Card(
child: BlocBuilder<CurrentIndexCubit, CurrentIndex>(
buildWhen: (previous, current) =>
previous.temporaryToolbar != current.temporaryToolbar ||
previous.toolbar != current.toolbar,
builder: (context, currentIndex) {
Widget? child;
var height = 0.0;
final toolbar =
currentIndex.temporaryToolbar ?? currentIndex.toolbar;
if (toolbar != null) {
height = toolbar.preferredSize.height;
child = toolbar;
}
return AnimatedContainer(
height: height,
key: _animatedKey,
curve: Curves.fastOutSlowIn,
duration: const Duration(milliseconds: 200),
child: child,
);
}),
),
),
);
},
Expand Down

0 comments on commit 4167485

Please sign in to comment.