Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 82 additions & 57 deletions lib/components/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class _MButtonGroupState extends State<MButtonGroup> {
selected = widget.selected;
return Row(
children: [
for (var i = 0; i < widget.titles.length; i++)
for (final (i, title) in widget.titles.indexed)
RawMaterialButton(
onPressed: () {
setState(() {
Expand Down Expand Up @@ -131,7 +131,7 @@ class _MButtonGroupState extends State<MButtonGroup> {
),
),
child: Text(
widget.titles[i],
title,
style: TextStyle(
color: selected == i ? MColors.white : MColors.grey.shade700,
fontSize: 14,
Expand Down Expand Up @@ -246,7 +246,7 @@ class _MLongDropdownButtonState extends State<MLongDropdownButton> {
final String? selectedValue = widget.value;
return DropdownButtonHideUnderline(
child: DropdownButton2(
searchInnerWidgetHeight: 20,

isExpanded: true,
customButton: RawMaterialButton(
onPressed: null,
Expand Down Expand Up @@ -316,32 +316,45 @@ class _MLongDropdownButtonState extends State<MLongDropdownButton> {
value: selectedValue,
onChanged: (value) {
setState(() {
widget.onChanged(context, value);
widget.onChanged(context, value as String?);
});
},
buttonHeight: 40,
dropdownElevation: 0,
itemHeight: 40,
dropdownMaxHeight: 360,
dropdownDecoration: BoxDecoration(
color: MColors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: MColors.grey.shade200),
boxShadow: const [
BoxShadow(
color: Color(0x19101828),
offset: Offset(0, 4),
blurRadius: 8,
spreadRadius: -2,
),
BoxShadow(
color: Color(0x10101828),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: -2,
),
],
buttonStyleData: const ButtonStyleData(height: 40),
onMenuStateChange: (isOpen) {
if (!isOpen) {
textEditingController.clear();
}
},
dropdownStyleData: DropdownStyleData(
elevation: 0,
maxHeight: 360,
padding: const EdgeInsets.only(bottom: 6),

decoration: BoxDecoration(
color: MColors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: MColors.grey.shade200),
boxShadow: const [
BoxShadow(
color: Color(0x19101828),
offset: Offset(0, 4),
blurRadius: 8,
spreadRadius: -2,
),
BoxShadow(
color: Color(0x10101828),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: -2,
),
],
),
),
menuItemStyleData: const MenuItemStyleData(height: 40),


dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 20,
searchController: textEditingController,
searchInnerWidget: Padding(
padding: const EdgeInsets.only(
Expand Down Expand Up @@ -374,12 +387,8 @@ class _MLongDropdownButtonState extends State<MLongDropdownButton> {
.toLowerCase()
.contains(searchValue.toLowerCase());
},
dropdownPadding: const EdgeInsets.only(bottom: 6),
onMenuStateChange: (isOpen) {
if (!isOpen) {
textEditingController.clear();
}
},

)
),
);
}
Expand Down Expand Up @@ -425,7 +434,9 @@ class _MLongComboDropdownButtonState extends State<MLongComboDropdownButton> {
return DropdownButtonHideUnderline(
child: DropdownButton2(
isExpanded: true,
scrollbarAlwaysShow: true,
// FIXME: Fix this:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was also something I wasn't sure about

// scrollbarAlwaysShow: true,

customButton: RawMaterialButton(
onPressed: null,
constraints: const BoxConstraints(),
Expand Down Expand Up @@ -519,33 +530,47 @@ class _MLongComboDropdownButtonState extends State<MLongComboDropdownButton> {
)
.toList(),
value: selectedValue.isEmpty ? null : selectedValue.last,
selectedItemHighlightColor: MColors.transparent,
// FIXME: Fix this
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@micfong-z Can you review this, I'm not sure what it did

// selectedItemHighlightColor: MColors.transparent,
onChanged: (value) {},
buttonHeight: 40,
dropdownElevation: 0,
itemHeight: 40,
dropdownMaxHeight: 360,
dropdownDecoration: BoxDecoration(
color: MColors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: MColors.grey.shade200),
boxShadow: const [
BoxShadow(
color: Color(0x19101828),
offset: Offset(0, 4),
blurRadius: 8,
spreadRadius: -2,
),
BoxShadow(
color: Color(0x10101828),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: -2,
),
buttonStyleData: const ButtonStyleData(
height: 40,
),
dropdownStyleData: DropdownStyleData(
scrollbarTheme: ScrollbarThemeData(
// I think this does the right thing...
thumbVisibility: WidgetStateProperty.all(true)
),
elevation: 0,
padding: const EdgeInsets.only(bottom: 6),
maxHeight: 360,
decoration: BoxDecoration(
color: MColors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: MColors.grey.shade200),
boxShadow: const [
BoxShadow(
color: Color(0x19101828),
offset: Offset(0, 4),
blurRadius: 8,
spreadRadius: -2,
),
BoxShadow(
color: Color(0x10101828),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: -2,
),
],
),
itemPadding: EdgeInsets.zero,
dropdownPadding: const EdgeInsets.only(bottom: 6),
),
menuItemStyleData: const MenuItemStyleData(
height: 40,
padding: EdgeInsets.zero
),



onMenuStateChange: (isOpen) {},
),
);
Expand Down
24 changes: 12 additions & 12 deletions lib/pages/checkout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ class CheckoutPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
var checkoutItems = context.watch<CheckoutCN>().items;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
context.watch<CheckoutCN>().items.isEmpty
checkoutItems.isEmpty
? 'Checkout'
: "Checkout - ${context.watch<CheckoutCN>().items.length} item${context.read<CheckoutCN>().items.length == 1 ? '' : 's'}",
: "Checkout - ${checkoutItems.length} item${context.read<CheckoutCN>().items.length == 1 ? '' : 's'}",
style: MTextStyles.dsmMdGrey900,
),
const SizedBox(height: 24),
Expand All @@ -38,7 +39,7 @@ class CheckoutPage extends StatelessWidget {
}
},
title: (context.watch<CheckoutCN>().selected.length ==
context.watch<CheckoutCN>().items.length)
checkoutItems.length)
? "Select None"
: "Select All",
),
Expand All @@ -52,7 +53,7 @@ class CheckoutPage extends StatelessWidget {
const Spacer(),
MButton(
onPressed: () {
if (context.read<DownloadCN>().downloadPath == '') {
if (context.read<DownloadCN>().downloadPath.isEmpty) {
// show alertdialog
showDialog(
context: context,
Expand Down Expand Up @@ -92,21 +93,20 @@ class CheckoutPage extends StatelessWidget {
child: Column(
children: [
const CheckoutTableHeader(),
if (context.watch<CheckoutCN>().items.isEmpty)
if (checkoutItems.isEmpty)
const NoCheckoutPlaceholder(),
for (var i = 0, l = context.watch<CheckoutCN>().items;
i < l.length;
i++) ...[
for (final (i, item) in checkoutItems.indexed)...[
CheckoutEntryRow(
item: l.elementAt(i),
item: item,
documentType: "Document",
isSelected: context
.watch<CheckoutCN>()
.selected
.contains(l.elementAt(i)),
isLast: i == l.length - 1,
.contains(item),
isLast: i == checkoutItems.length - 1,
),
],
]
,
],
),
),
Expand Down
4 changes: 4 additions & 0 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@

#include "generated_plugin_registrant.h"

#include <rive_common/rive_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) rive_common_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "RivePlugin");
rive_plugin_register_with_registrar(rive_common_registrar);
g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);
Expand Down
1 change: 1 addition & 0 deletions linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
rive_common
screen_retriever
url_launcher_linux
window_manager
Expand Down
Loading