-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support header on scaffold (#554)
- Loading branch information
1 parent
10083ca
commit 4ed6405
Showing
16 changed files
with
1,191 additions
and
399 deletions.
There are no files selected for viewing
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,68 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:mix/mix.dart'; | ||
import 'package:remix/remix.dart'; | ||
import 'package:remix/themes/fortaleza.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; | ||
|
||
@widgetbook.UseCase( | ||
name: 'Header Component', | ||
type: Header, | ||
) | ||
Widget buildCard(BuildContext context) { | ||
final leading = Box( | ||
style: Style( | ||
$box.chain | ||
..padding(10) | ||
..color.white10() | ||
..borderRadius(8) | ||
..wrap.padding.right(16), | ||
$on.light( | ||
$box.color.black12(), | ||
$icon.color.black(), | ||
), | ||
), | ||
child: const StyledIcon( | ||
CupertinoIcons.person, | ||
), | ||
); | ||
|
||
final actions = Row( | ||
children: [ | ||
IconButton( | ||
CupertinoIcons.trash, | ||
variants: const [FortalezaIconButtonStyle.ghost], | ||
onPressed: () {}, | ||
), | ||
const SizedBox( | ||
height: 16, | ||
), | ||
Button(label: 'Button', onPressed: () {}), | ||
], | ||
); | ||
|
||
return Scaffold( | ||
header: Header( | ||
title: context.knobs.string(label: 'Title', initialValue: 'Title'), | ||
subtitle: context.knobs.stringOrNull(label: 'description'), | ||
leading: context.knobs.boolean( | ||
label: 'leading Icons', | ||
initialValue: false, | ||
) | ||
? leading | ||
: null, | ||
trailing: context.knobs.boolean( | ||
label: 'Trailing Icons', | ||
initialValue: false, | ||
) | ||
? actions | ||
: null, | ||
), | ||
body: Box( | ||
style: Style( | ||
$box.color.white.withOpacity($on.dark.when(context) ? 0.03 : 1), | ||
// $box.color.$neutral(1), | ||
), | ||
), | ||
); | ||
} |
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
6 changes: 3 additions & 3 deletions
6
packages/remix/demo/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// This is a generated file; do not edit or check into version control. | ||
FLUTTER_ROOT=/Users/lucasoliveira/fvm/versions/stable | ||
FLUTTER_APPLICATION_PATH=/Users/lucasoliveira/Developer/Mix/PoCs/remix_toast/packages/mix/packages/remix/demo | ||
FLUTTER_APPLICATION_PATH=/Users/lucasoliveira/Developer/Mix/PoCs/remix_app_poc/packages/mix/packages/remix/demo | ||
COCOAPODS_PARALLEL_CODE_SIGN=true | ||
FLUTTER_TARGET=/Users/lucasoliveira/Developer/Mix/PoCs/remix_toast/packages/mix/packages/remix/demo/lib/main.dart | ||
FLUTTER_TARGET=/Users/lucasoliveira/Developer/Mix/PoCs/remix_app_poc/packages/mix/packages/remix/demo/lib/main.dart | ||
FLUTTER_BUILD_DIR=build | ||
FLUTTER_BUILD_NAME=1.0.0 | ||
FLUTTER_BUILD_NUMBER=1 | ||
DART_OBFUSCATION=false | ||
TRACK_WIDGET_CREATION=true | ||
TREE_SHAKE_ICONS=false | ||
PACKAGE_CONFIG=/Users/lucasoliveira/Developer/Mix/PoCs/remix_toast/packages/mix/packages/remix/demo/.dart_tool/package_config.json | ||
PACKAGE_CONFIG=/Users/lucasoliveira/Developer/Mix/PoCs/remix_app_poc/packages/mix/packages/remix/demo/.dart_tool/package_config.json |
Oops, something went wrong.