Skip to content

Commit

Permalink
chore(layout): minor ui adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Kounex committed Nov 27, 2023
1 parent af4103a commit 882a788
Show file tree
Hide file tree
Showing 20 changed files with 263 additions and 279 deletions.
6 changes: 3 additions & 3 deletions lib/shared/general/custom_sliver_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class CustomSliverList extends StatelessWidget {
return SliverPadding(
padding: EdgeInsets.only(
top: this.customTopPadding ?? 0.0,
right: MediaQuery.viewPaddingOf(context).right,
right: MediaQuery.paddingOf(context).right,
bottom: this.customBottomPadding ??
(2 * kBottomNavigationBarHeight +
MediaQuery.viewPaddingOf(context).bottom),
left: MediaQuery.viewPaddingOf(context).left,
MediaQuery.paddingOf(context).bottom / 2),
left: MediaQuery.paddingOf(context).left,
),
sliver: SliverList(
delegate: SliverChildListDelegate(this.children),
Expand Down
7 changes: 4 additions & 3 deletions lib/shared/general/formatted_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ class FormattedText extends StatelessWidget {
text:
(this.text ?? '-') + (this.text != null ? (this.unit ?? '') : ''),
),
style: const TextStyle(
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontFeatures: [
FontFeature.tabularFigures(),
const FontFeature.tabularFigures(),
],
),
decoration: InputDecoration(
isDense: true,
enabled: false,
labelText: this.label,
labelStyle: const TextStyle(height: 0.75),
labelStyle:
Theme.of(context).textTheme.bodyMedium!.copyWith(height: 0.75),
),
),
);
Expand Down
8 changes: 5 additions & 3 deletions lib/shared/general/social_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class SocialBlock extends StatelessWidget {
social.linkText ?? social.link,
softWrap: true,
style: (social.textStyle ??
Theme.of(context).textTheme.bodyLarge!)
Theme.of(context).textTheme.bodyMedium!)
.copyWith(
color: Theme.of(context).colorScheme.secondary,
// decoration: TextDecoration.underline,
Expand All @@ -139,8 +139,10 @@ class SocialBlock extends StatelessWidget {
}

return Padding(
padding:
EdgeInsets.only(top: this.topPadding, bottom: this.bottomPadding),
padding: EdgeInsets.only(
top: this.topPadding,
bottom: this.bottomPadding,
),
child: Wrap(
spacing: 12.0,
runSpacing: 12.0,
Expand Down
5 changes: 2 additions & 3 deletions lib/shared/general/transculent_cupertino_navbar_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class TransculentCupertinoNavBarWrapper extends StatelessWidget {
physics: StylingHelper.platformAwareScrollPhysics,
slivers: [
CustomSliverList(
customTopPadding:
MediaQuery.viewPaddingOf(context).top + kToolbarHeight,
customTopPadding: MediaQuery.paddingOf(context).top + kToolbarHeight,
children: this.listViewChildren,
),
],
Expand All @@ -65,7 +64,7 @@ class TransculentCupertinoNavBarWrapper extends StatelessWidget {
if (this.customBody != null)
Padding(
padding: EdgeInsets.only(
top: MediaQuery.viewPaddingOf(context).top +
top: MediaQuery.paddingOf(context).top +
kMinInteractiveDimensionCupertino,
),
child: this.customBody,
Expand Down
16 changes: 7 additions & 9 deletions lib/utils/modal_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class ModalHandler {
children: [
content,
Positioned(
top: 12.0 + MediaQuery.viewPaddingOf(context).top,
right: 12.0 + MediaQuery.viewPaddingOf(context).right,
top: 12.0 + MediaQuery.paddingOf(context).top,
right: 12.0 + MediaQuery.paddingOf(context).right,
child: IconButton(
onPressed: () {
onClose?.call();
Expand Down Expand Up @@ -87,7 +87,7 @@ class ModalHandler {
mainAxisSize: MainAxisSize.min,
children: [
builder(context),
SizedBox(height: MediaQuery.viewPaddingOf(context).bottom),
SizedBox(height: MediaQuery.paddingOf(context).bottom),
],
),
maxHeight: MediaQuery.sizeOf(context).height / 1.5,
Expand Down Expand Up @@ -120,7 +120,7 @@ class ModalHandler {
context: context,
additionalBottomViewInsets: additionalBottomViewInsets,
blurryBackground: blurryBackground ?? StylingHelper.isApple(context),
includeCloseButton: true,
includeCloseButton: includeCloseButton,
modalWidget: modalWidgetBuilder(
context,
ModalScrollController.of(context)!,
Expand Down Expand Up @@ -162,11 +162,9 @@ class ModalHandler {
),
),
),
Expanded(
child: Padding(
padding: EdgeInsets.only(top: includeCloseButton ? 24.0 : 0),
child: modalWidget,
),
Padding(
padding: EdgeInsets.only(top: includeCloseButton ? 24.0 : 0),
child: modalWidget,
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion lib/views/dashboard/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class _DashboardViewState extends State<DashboardView> {
],
),
Positioned(
top: kToolbarHeight + MediaQuery.viewPaddingOf(context).top,
top: kToolbarHeight + MediaQuery.paddingOf(context).top,
child: const Align(
alignment: Alignment.center,
child: FittedBox(
Expand Down
4 changes: 2 additions & 2 deletions lib/views/dashboard/screenshot_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class _ScreenshotPreviewState extends State<ScreenshotPreview> {
fit: StackFit.expand,
children: [
Positioned(
top: MediaQuery.viewPaddingOf(context).top + 24,
top: MediaQuery.paddingOf(context).top + 24,
left: 0,
right: 0,
child: Text(
Expand All @@ -49,7 +49,7 @@ class _ScreenshotPreviewState extends State<ScreenshotPreview> {
),
),
Positioned(
bottom: MediaQuery.viewPaddingOf(context).bottom + 24,
bottom: MediaQuery.paddingOf(context).bottom + 24,
left: 24.0,
right: 24.0,
child: Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ class _HotkeyListState extends State<HotkeyList> {
controller: this.widget.controller,
padding: const EdgeInsets.symmetric(horizontal: 24.0) +
EdgeInsets.only(
bottom:
MediaQuery.viewPaddingOf(context).bottom +
12.0),
bottom: MediaQuery.paddingOf(context).bottom +
12.0),
children: [
if (hotkeyBox.values.isNotEmpty) ...[
const SectionHeader(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class QuickConnect extends StatelessWidget {
onPressed: () =>
ModalHandler.showBaseCupertinoBottomSheet<Connection?>(
context: context,
includeCloseButton: false,
modalWidgetBuilder: (context, controller) => const QRScan(),
).then(
(connection) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RefresherAppBar extends StatelessWidget {
title: LayoutBuilder(
builder: (context, constraints) {
if ((constraints.maxHeight -
(MediaQuery.viewPaddingOf(context).top - 16))
(MediaQuery.paddingOf(context).top - 16))
.toInt() <=
kRefresherAppBarHeight.toInt()) {
return Fader(
Expand Down
1 change: 0 additions & 1 deletion lib/views/home/widgets/saved_connections/edit_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ class _EditConnectionDialogState extends State<EditConnectionDialog> {
placeholder: 'Password',
autocorrect: false,
obscureText: _obscurePW,
errorPaddingAlways: true,
suffixIcon: StylingHelper.isApple(context)
? Container(
decoration: BoxDecoration(
Expand Down
2 changes: 1 addition & 1 deletion lib/views/intro/widgets/back_so_selection_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class BackToSelectionWrapper extends StatelessWidget {
Widget build(BuildContext context) {
return Column(
children: [
SizedBox(height: MediaQuery.viewPaddingOf(context).top),
SizedBox(height: MediaQuery.paddingOf(context).top),
ThemedCupertinoButton(
child: Row(
children: [
Expand Down
8 changes: 4 additions & 4 deletions lib/views/intro/widgets/getting_started.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class GettingStarted extends StatelessWidget {
delay: const Duration(milliseconds: 500),
curve: Curves.easeIn,
child: ThemedRichText(
textAlign: TextAlign.center,
textStyle: Theme.of(context).textTheme.labelSmall!.copyWith(
fontSize: 18,
),
textSpans: [
const TextSpan(
text: 'An unofficial, ',
Expand Down Expand Up @@ -90,10 +94,6 @@ class GettingStarted extends StatelessWidget {
text: ' plugin!',
),
],
textAlign: TextAlign.center,
textStyle: Theme.of(context).textTheme.labelSmall!.copyWith(
fontSize: 18,
),
),
),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/views/intro/widgets/intro_slides/intro_slide.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class IntroSlide extends StatelessWidget {
// duration: const Duration(milliseconds: 750),
// child: Padding(
// padding: EdgeInsets.only(
// top: MediaQuery.viewPaddingOf(context).top + 32.0,
// top: MediaQuery.paddingOf(context).top + 32.0,
// left: 24.0,
// right: 24.0,
// bottom: MediaQuery.viewPaddingOf(context).bottom +
// bottom: MediaQuery.paddingOf(context).bottom +
// kIntroControlsBottomPadding,
// ),
// child: Column(
Expand Down
2 changes: 1 addition & 1 deletion lib/views/intro/widgets/intro_slides/intro_slides.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class _IntroSlidesState extends State<IntroSlides> {
const SizedBox(height: 12.0),
Padding(
padding: EdgeInsets.only(
bottom: MediaQuery.viewPaddingOf(context).bottom +
bottom: MediaQuery.paddingOf(context).bottom +
kIntroControlsBottomPadding,
),
child: ConstrainedBox(
Expand Down
1 change: 1 addition & 0 deletions lib/views/settings/about/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class AboutView extends StatelessWidget {
// showAboutDialog(context: context),
ModalHandler.showBaseCupertinoBottomSheet(
context: context,
includeCloseButton: false,
modalWidgetBuilder: (context, scrollController) =>
LicenseModal(
scrollController: scrollController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ class _LicenseEntriesState extends State<LicenseEntries> {
child: ListView.builder(
shrinkWrap: true,
controller: this.widget.scrollController,
padding: EdgeInsets.only(
bottom: MediaQuery.viewPaddingOf(context).bottom),
padding:
EdgeInsets.only(bottom: MediaQuery.paddingOf(context).bottom),
itemCount: snapshot.data!.packages.length,
itemBuilder: (context, index) => ListTile(
dense: true,
Expand Down
Loading

0 comments on commit 882a788

Please sign in to comment.