Skip to content

Commit

Permalink
Merge pull request #4 from owenbean400/update-after-screenshots
Browse files Browse the repository at this point in the history
Update padding to use padding top of Flutter
  • Loading branch information
sheaDurgin authored Dec 5, 2023
2 parents 2b950a0 + df249dd commit d08b573
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 34 deletions.
7 changes: 2 additions & 5 deletions lib/view/widget/header_add.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:io';

import 'package:flutter/material.dart';

class HeaderAdd extends StatelessWidget {
Expand All @@ -13,9 +11,8 @@ class HeaderAdd extends StatelessWidget {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Container(
padding: (Platform.isIOS)
? const EdgeInsets.fromLTRB(16, 56, 0, 16)
: const EdgeInsets.fromLTRB(16, 32, 0, 16),
padding: EdgeInsets.fromLTRB(
16, MediaQuery.of(context).viewPadding.top + 16, 0, 16),
width: constraints.maxWidth,
color: Theme.of(context).primaryColor,
child: Row(
Expand Down
7 changes: 2 additions & 5 deletions lib/view/widget/header_backspace.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:io';

import 'package:flutter/material.dart';

class HeaderBackspace extends StatelessWidget {
Expand All @@ -14,9 +12,8 @@ class HeaderBackspace extends StatelessWidget {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Container(
padding: (Platform.isIOS)
? const EdgeInsets.fromLTRB(16, 56, 0, 16)
: const EdgeInsets.fromLTRB(16, 32, 0, 16),
padding: EdgeInsets.fromLTRB(
16, MediaQuery.of(context).viewPadding.top + 16, 0, 16),
width: constraints.maxWidth,
color: Theme.of(context).primaryColor,
child: Row(
Expand Down
7 changes: 2 additions & 5 deletions lib/view/widget/header_person_list.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:io';

import 'package:flutter/material.dart';

class HeaderAddWithSecondAction extends StatelessWidget {
Expand All @@ -20,9 +18,8 @@ class HeaderAddWithSecondAction extends StatelessWidget {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Container(
padding: (Platform.isIOS)
? const EdgeInsets.fromLTRB(16, 56, 0, 16)
: const EdgeInsets.fromLTRB(16, 32, 0, 16),
padding: EdgeInsets.fromLTRB(
16, MediaQuery.of(context).viewPadding.top + 16, 0, 16),
width: constraints.maxWidth,
color: Theme.of(context).primaryColor,
child: Row(
Expand Down
7 changes: 2 additions & 5 deletions lib/view/widget/header_plain.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:io';

import 'package:flutter/material.dart';

class HeaderPlain extends StatelessWidget {
Expand All @@ -12,9 +10,8 @@ class HeaderPlain extends StatelessWidget {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Container(
padding: (Platform.isIOS)
? const EdgeInsets.fromLTRB(16, 56, 0, 16)
: const EdgeInsets.fromLTRB(16, 32, 0, 16),
padding: EdgeInsets.fromLTRB(
16, MediaQuery.of(context).viewPadding.top + 16, 0, 16),
width: constraints.maxWidth,
color: Theme.of(context).primaryColor,
child: Text(title, style: Theme.of(context).textTheme.bodyLarge),
Expand Down
2 changes: 1 addition & 1 deletion lib/view/window/recipe/recipe_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RecipeView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Padding(padding: EdgeInsets.fromLTRB(8, 112, 8, 0)),
Container(height: MediaQuery.of(context).viewPadding.top + 64),
(recipe.authors.isNotEmpty)
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
10 changes: 5 additions & 5 deletions lib/view/window/recipe/recipes_view.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:recipe_roots/domain/entire_recipe.dart';
Expand Down Expand Up @@ -97,9 +95,11 @@ class RecipeViewsState extends State<RecipeViews> {

return SingleChildScrollView(
child: Padding(
padding: (Platform.isIOS)
? const EdgeInsets.fromLTRB(0, 140, 0, 0)
: const EdgeInsets.fromLTRB(0, 100, 0, 0),
padding: EdgeInsets.fromLTRB(
0,
MediaQuery.of(context).viewPadding.top + 108,
0,
16),
child: Column(
children: recipeTitles,
)));
Expand Down
13 changes: 5 additions & 8 deletions lib/view/window/recipe/widgets/recipe_search_bar.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:recipe_roots/domain/selection_search_bar_form.dart';
Expand All @@ -24,14 +22,13 @@ class RecipeSearchBarState extends State<RecipeSearchBar> {
Widget build(BuildContext context) {
return (Container(
color: Theme.of(context).primaryColor,
height: (Platform.isIOS)
? ((showAdvanceMenu) ? 460 : 140)
: ((showAdvanceMenu) ? 440 : 108),
height: (showAdvanceMenu)
? MediaQuery.of(context).viewPadding.top + 430
: MediaQuery.of(context).viewPadding.top + 100,
child: Column(children: [
Padding(
padding: (Platform.isIOS)
? const EdgeInsets.fromLTRB(8, 58, 8, 8)
: const EdgeInsets.fromLTRB(8, 32, 8, 8),
padding: EdgeInsets.fromLTRB(
16, MediaQuery.of(context).viewPadding.top + 16, 0, 16),
child:
Row(crossAxisAlignment: CrossAxisAlignment.center, children: [
Consumer<SelectionSearchBarForm>(
Expand Down

0 comments on commit d08b573

Please sign in to comment.