Skip to content

Commit

Permalink
Doc height and width adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Daviiddoo committed Jun 25, 2024
1 parent b36f1f8 commit 2627577
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 159 deletions.
2 changes: 1 addition & 1 deletion docs/.env.development
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NEXT_PUBLIC_DEMO_URL=https://demo.forui.dev
NEXT_PUBLIC_DEMO_URL=http://localhost:59874
2 changes: 1 addition & 1 deletion docs/pages/docs/dialog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A modal dialog interrupts the user with important content and expects a response

<Tabs items={['Preview', 'Code']}>
<Tabs.Tab>
<Widget name='dialog' query={{vertical: "false"}}/>
<Widget name='dialog' query={{vertical: "false"}} height={400}/>
</Tabs.Tab>
<Tabs.Tab>
```dart
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/scaffold.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Creates a visual scaffold for Forui widgets.

<Tabs items={['Preview', 'Code']}>
<Tabs.Tab>
<Widget name='scaffold' query={{}}/>
<Widget name='scaffold' query={{}} height={600}/>
</Tabs.Tab>
<Tabs.Tab>
```dart
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/separator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Visually or semantically separates content.

<Tabs items={['Preview', 'Code']}>
<Tabs.Tab>
<Widget name='separator' query={{}}/>
<Widget name='separator' query={{}} height={300}/>
</Tabs.Tab>
<Tabs.Tab>
```dart
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/tabs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A set of layered sections of content—known as tab entries—that are displayed

<Tabs items={['Preview', 'Code']}>
<Tabs.Tab>
<Widget name='tabs' query={{}}/>
<Widget name='tabs' query={{}} height={500}/>
</Tabs.Tab>
<Tabs.Tab>
```dart
Expand Down
2 changes: 1 addition & 1 deletion forui/lib/src/widgets/header/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ final class FHeaderStyle with Diagnosticable {
height: 1,
),
action = FHeaderActionStyle.inherit(colorScheme: colorScheme),
padding = style.pagePadding.copyWith(bottom: 10);
padding = style.pagePadding.copyWith(bottom: 15);

/// Returns a copy of this [FHeaderStyle] with the given properties replaced.
///
Expand Down
20 changes: 11 additions & 9 deletions samples/lib/sample_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ abstract class SampleScaffold extends StatelessWidget {
SampleScaffold({
String theme = 'zinc-light',
super.key,
}):
theme = themes[theme]!;
}) : theme = themes[theme]!;

@override
Widget build(BuildContext context) => FTheme(
data: theme,
child: FScaffold(
content: Center(
child: child(context),
),
),
);
data: theme,
child: FScaffold(
content: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 600),
child: child(context),
),
),
),
);

Widget child(BuildContext context);
}
86 changes: 48 additions & 38 deletions samples/lib/widgets/scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,56 @@ class ScaffoldPage extends SampleScaffold {
});

@override
Widget child(BuildContext context) => FScaffold(
header: FHeader(
title: 'Settings',
actions: [
FHeaderAction(
icon: FAssets.icons.ellipsis,
onPress: () {},
),
],
),
content: ListView(
children: [
FCard(
title: 'Account',
subtitle: 'Make changes to your account here. Click save when you are done.',
child: Padding(
padding: const EdgeInsets.only(top: 10),
child: Column(
children: [
const FTextField(
label: 'Name',
hint: 'John Renalo',
),
const SizedBox(height: 10),
const FTextField(
label: 'Email',
hint: '[email protected]',
),
Padding(
padding: const EdgeInsets.only(top: 24, bottom: 16),
child: FButton(
label: 'Save',
onPress: () {},
Widget child(BuildContext context) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 30),
SizedBox(
height: 420,
child: FScaffold(
header: FHeader(
title: 'Settings',
actions: [
FHeaderAction(
icon: FAssets.icons.ellipsis,
onPress: () {},
),
],
),
content: Column(
children: [
const SizedBox(height: 5),
FCard(
title: 'Account',
subtitle: 'Make changes to your account here. Click save when you are done.',
child: Padding(
padding: const EdgeInsets.only(top: 10),
child: Column(
children: [
const FTextField(
label: 'Name',
hint: 'John Renalo',
),
const SizedBox(height: 10),
const FTextField(
label: 'Email',
hint: '[email protected]',
),
Padding(
padding: const EdgeInsets.only(top: 24, bottom: 16),
child: FButton(
label: 'Save',
onPress: () {},
),
),
],
),
),
],
),
),
],
),
),
],
),
);
),
],
);
}
76 changes: 41 additions & 35 deletions samples/lib/widgets/separator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,49 @@ class SeparatorPage extends SampleScaffold {

return Padding(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Flutter Forui',
style: typography.xl2.copyWith(
color: colorScheme.foreground,
fontWeight: FontWeight.w600,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 300),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Flutter Forui',
style: typography.xl2.copyWith(
color: colorScheme.foreground,
fontWeight: FontWeight.w600,
),
),
),
Text(
'An open-source widget library.',
style: typography.sm.copyWith(color: colorScheme.mutedForeground),
),
const FSeparator(),
SizedBox(
height: 30,
child: Row(
children: [
Text(
'Blog',
style: typography.sm.copyWith(color: colorScheme.foreground),
),
const FSeparator(vertical: true),
Text(
'Docs',
style: typography.sm.copyWith(color: colorScheme.foreground),
),
const FSeparator(vertical: true),
Text(
'Source',
style: typography.sm.copyWith(color: colorScheme.foreground),
),
],
Text(
'An open-source widget library.',
style: typography.sm.copyWith(color: colorScheme.mutedForeground),
),
),
],
const FSeparator(),
SizedBox(
height: 30,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Blog',
style: typography.sm.copyWith(color: colorScheme.foreground),
),
const FSeparator(vertical: true),
Text(
'Docs',
style: typography.sm.copyWith(color: colorScheme.foreground),
),
const FSeparator(vertical: true),
Text(
'Source',
style: typography.sm.copyWith(color: colorScheme.foreground),
),
],
),
),
],
),
),
);
}
Expand Down
111 changes: 58 additions & 53 deletions samples/lib/widgets/tabs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,65 +12,70 @@ class TabsPage extends SampleScaffold {
});

@override
Widget child(BuildContext context) => Padding(
padding: const EdgeInsets.all(16),
child: FTabs(
tabs: [
FTabEntry(
label: 'Account',
content: FCard(
title: 'Account',
subtitle: 'Make changes to your account here. Click save when you are done.',
child: Padding(
padding: const EdgeInsets.only(top: 10),
child: Column(
children: [
const FTextField(
label: 'Name',
hint: 'John Renalo',
Widget child(BuildContext context) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(16),
child: FTabs(
tabs: [
FTabEntry(
label: 'Account',
content: FCard(
title: 'Account',
subtitle: 'Make changes to your account here. Click save when you are done.',
child: Padding(
padding: const EdgeInsets.only(top: 10),
child: Column(
children: [
const FTextField(
label: 'Name',
hint: 'John Renalo',
),
const SizedBox(height: 10),
const FTextField(
label: 'Email',
hint: '[email protected]',
),
Padding(
padding: const EdgeInsets.only(top: 24, bottom: 16),
child: FButton(
label: 'Save',
onPress: () {},
),
),
],
),
const SizedBox(height: 10),
const FTextField(
label: 'Email',
hint: '[email protected]',
),
Padding(
padding: const EdgeInsets.only(top: 24, bottom: 16),
child: FButton(
label: 'Save',
onPress: () {},
),
),
],
),
),
),
),
),
FTabEntry(
label: 'Password',
content: FCard(
title: 'Password',
subtitle: 'Change your password here. After saving, you will be logged out.',
child: Padding(
padding: const EdgeInsets.only(top: 10),
child: Column(
children: [
const FTextField(label: 'Current password'),
const SizedBox(height: 10),
const FTextField(label: 'New password'),
Padding(
padding: const EdgeInsets.only(top: 24, bottom: 16),
child: FButton(
label: 'Save',
onPress: () {},
),
FTabEntry(
label: 'Password',
content: FCard(
title: 'Password',
subtitle: 'Change your password here. After saving, you will be logged out.',
child: Padding(
padding: const EdgeInsets.only(top: 10),
child: Column(
children: [
const FTextField(label: 'Current password'),
const SizedBox(height: 10),
const FTextField(label: 'New password'),
Padding(
padding: const EdgeInsets.only(top: 24, bottom: 16),
child: FButton(
label: 'Save',
onPress: () {},
),
),
],
),
],
),
),
),
),
],
),
],
),
),
],
);
}
Loading

0 comments on commit 2627577

Please sign in to comment.