-
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: Accordion interaction based on open variable (#546)
- Loading branch information
1 parent
8cc7d4a
commit 6fdd211
Showing
41 changed files
with
2,383 additions
and
1,043 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
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
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,95 @@ | ||
import 'package:flutter/material.dart' as m; | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:remix/remix.dart'; | ||
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; | ||
|
||
@widgetbook.UseCase( | ||
name: 'DropdownMenu Component', | ||
type: DropdownMenu, | ||
) | ||
Widget buildDropdownMenu(BuildContext context) { | ||
return const Scaffold( | ||
body: Center( | ||
child: DropdownMenuDemo(), | ||
), | ||
); | ||
} | ||
|
||
class DropdownMenuDemo extends StatefulWidget { | ||
const DropdownMenuDemo({ | ||
super.key, | ||
}); | ||
|
||
@override | ||
State<DropdownMenuDemo> createState() => _DropdownMenuDemoState(); | ||
} | ||
|
||
enum MenuItem { | ||
home, | ||
profile, | ||
} | ||
|
||
class _DropdownMenuDemoState extends State<DropdownMenuDemo> { | ||
bool open = false; | ||
@override | ||
Widget build(BuildContext context) { | ||
return Center( | ||
child: DropdownMenu( | ||
trigger: IconButton( | ||
m.Icons.menu, | ||
onPressed: () { | ||
setState(() { | ||
open = !open; | ||
}); | ||
}, | ||
), | ||
onPressOutside: () { | ||
setState(() { | ||
open = false; | ||
}); | ||
}, | ||
open: open, | ||
items: [ | ||
const DropdownMenuItem( | ||
text: 'Features', | ||
variants: [ | ||
DropdownMenuStyle.itemLabel, | ||
], | ||
), | ||
DropdownMenuItem( | ||
text: 'home', | ||
onPress: () { | ||
setState(() { | ||
open = false; | ||
}); | ||
showToast( | ||
context: context, | ||
entry: ToastEntry( | ||
builder: (context, actions) => const Toast( | ||
title: 'home was selected', | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
DropdownMenuItem( | ||
text: 'profile', | ||
onPress: () { | ||
setState(() { | ||
open = false; | ||
}); | ||
showToast( | ||
context: context, | ||
entry: ToastEntry( | ||
builder: (context, actions) => const Toast( | ||
title: 'profile was selected', | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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
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/Projects/hairday/packages/mix/packages/remix/demo | ||
FLUTTER_APPLICATION_PATH=/Users/lucasoliveira/Developer/Mix/PoCs/remix_toast/packages/mix/packages/remix/demo | ||
COCOAPODS_PARALLEL_CODE_SIGN=true | ||
FLUTTER_TARGET=/Users/lucasoliveira/Developer/Projects/hairday/packages/mix/packages/remix/demo/lib/main.dart | ||
FLUTTER_TARGET=/Users/lucasoliveira/Developer/Mix/PoCs/remix_toast/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/Projects/hairday/packages/mix/packages/remix/demo/.dart_tool/package_config.json | ||
PACKAGE_CONFIG=/Users/lucasoliveira/Developer/Mix/PoCs/remix_toast/packages/mix/packages/remix/demo/.dart_tool/package_config.json |
Oops, something went wrong.