-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from humhub/f-helper-page-v2
Helper page v2
- Loading branch information
Showing
19 changed files
with
284 additions
and
165 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AnimatedPaddingComponent extends StatefulWidget { | ||
final EdgeInsetsGeometry padding; | ||
final Widget child; | ||
|
||
const AnimatedPaddingComponent({super.key, required this.padding, required this.child}); | ||
|
||
@override | ||
AnimatedPaddingComponentState createState() => AnimatedPaddingComponentState(); | ||
} | ||
|
||
class AnimatedPaddingComponentState extends State<AnimatedPaddingComponent> { | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return AnimatedPadding( | ||
duration: const Duration(milliseconds: 500), | ||
padding: widget.padding, | ||
child: widget.child | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
import 'dart:math' as math; | ||
|
||
class HelpSafeArea extends StatelessWidget { | ||
const HelpSafeArea({ | ||
super.key, | ||
this.left = true, | ||
this.top = true, | ||
this.right = true, | ||
this.minimum = EdgeInsets.zero, | ||
this.maintainBottomViewPadding = false, | ||
required this.child, | ||
}); | ||
|
||
final bool left; | ||
final bool top; | ||
final bool right; | ||
final EdgeInsets minimum; | ||
final bool maintainBottomViewPadding; | ||
final Widget child; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
assert(debugCheckHasMediaQuery(context)); | ||
final MediaQueryData data = MediaQuery.of(context); | ||
EdgeInsets padding = data.padding; | ||
// Bottom padding has been consumed - i.e. by the keyboard | ||
if (maintainBottomViewPadding) { | ||
padding = padding.copyWith(bottom: data.viewPadding.bottom); | ||
} | ||
|
||
return Container( | ||
padding: EdgeInsets.only( | ||
left: math.max(left ? padding.left : 0.0, minimum.left), | ||
top: math.max(top ? padding.top : 0.0, minimum.top), | ||
right: math.max(right ? padding.right : 0.0, minimum.right), | ||
), | ||
child: OverflowBox( | ||
maxHeight: MediaQuery.of(context).size.height, | ||
minHeight: MediaQuery.of(context).size.height, | ||
child: MediaQuery.removePadding( | ||
context: context, | ||
removeLeft: left, | ||
removeTop: top, | ||
removeRight: right, | ||
child: child, | ||
), | ||
), | ||
); | ||
} | ||
|
||
@override | ||
void debugFillProperties(DiagnosticPropertiesBuilder properties) { | ||
super.debugFillProperties(properties); | ||
properties.add(FlagProperty('left', value: left, ifTrue: 'avoid left padding')); | ||
properties.add(FlagProperty('top', value: top, ifTrue: 'avoid top padding')); | ||
properties.add(FlagProperty('right', value: right, ifTrue: 'avoid right padding')); | ||
} | ||
} |
Oops, something went wrong.