Skip to content

Commit

Permalink
Merge pull request #21 from conceptadev/feat/update-remix
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias authored May 12, 2024
2 parents 0bd8ac7 + 258703a commit af2ae44
Show file tree
Hide file tree
Showing 30 changed files with 450 additions and 336 deletions.
2 changes: 1 addition & 1 deletion demo/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
331C8080294A63A400263BE5 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
1 change: 0 additions & 1 deletion demo/lib/components/alert.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:mix/mix.dart';
import 'package:remix_ui/remix_ui.dart';
import 'package:widgetbook/widgetbook.dart';
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook;
Expand Down
20 changes: 10 additions & 10 deletions demo/lib/components/avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Widget buildCheckboxUseCase(BuildContext context) {
RemixAvatar(
style: RemixAvatarStyle(
container: Style(
box.height(60),
box.width(60),
box.borderRadius(20),
box.color(
$box.height(60),
$box.width(60),
$box.borderRadius(20),
$box.color(
Colors.cyanAccent.shade200.withAlpha(60),
),
icon.size(30),
icon.color(Colors.cyanAccent),
$icon.size(30),
$icon.color(Colors.cyanAccent),
),
),
imageBuilder: (style) => const StyledIcon(Icons.person),
Expand All @@ -33,8 +33,8 @@ Widget buildCheckboxUseCase(BuildContext context) {
RemixAvatar(
style: RemixAvatarStyle.base().copyWith(
container: Style(
box.height(50),
box.width(50),
$box.height(50),
$box.width(50),
),
),
imageBuilder: (style) =>
Expand All @@ -47,8 +47,8 @@ Widget buildCheckboxUseCase(BuildContext context) {
),
style: RemixAvatarStyle.base().copyWith(
container: Style(
box.height(40),
box.width(40),
$box.height(40),
$box.width(40),
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion demo/lib/components/badge.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:mix/mix.dart';
import 'package:remix_ui/remix_ui.dart';
import 'package:widgetbook/widgetbook.dart';
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook;
Expand All @@ -13,6 +12,7 @@ Widget buildCheckboxUseCase(BuildContext context) {
child: RemixBadge(
label: context.knobs.string(
label: "Label",
description: 'The text displayed in the badge',
initialValue: "Label",
),
),
Expand Down
1 change: 0 additions & 1 deletion demo/lib/components/card.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:mix/mix.dart';
import 'package:remix_ui/remix_ui.dart';
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook;

Expand Down
41 changes: 27 additions & 14 deletions demo/lib/components/checkbox.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:mix/mix.dart';
import 'package:remix_ui/remix_ui.dart';
import 'package:widgetbook/widgetbook.dart';
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook;
Expand All @@ -9,20 +10,32 @@ import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook;
)
Widget buildCheckboxUseCase(BuildContext context) {
return Center(
child: RemixCheckbox(
label: context.knobs.stringOrNull(
label: 'Title',
initialValue: 'Title',
),
onChanged: (value) {},
checked: context.knobs.boolean(
label: 'Checked',
initialValue: false,
),
disabled: context.knobs.boolean(
label: 'Disabled',
initialValue: false,
),
child: Row(
children: [
Box(
style: Style(
$box.color.grey(),
$box.height(20),
$box.width(20),
$box.borderRadius(4),
),
),
RemixCheckbox(
label: context.knobs.stringOrNull(
label: 'Title',
initialValue: 'Title',
),
onChanged: (value) {},
value: context.knobs.boolean(
label: 'Checked',
initialValue: false,
),
disabled: context.knobs.boolean(
label: 'Disabled',
initialValue: false,
),
),
],
),
);
}
8 changes: 4 additions & 4 deletions demo/lib/components/list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Widget buildCheckboxUseCase(BuildContext context) {
leading: RemixAvatar(
style: RemixAvatarStyle.base().copyWith(
container: Style(
height(60),
width(60),
borderRadius(6),
box.color(
$box.height(60),
$box.width(60),
$box.borderRadius(6),
$box.color(
Colors.black26,
),
),
Expand Down
2 changes: 1 addition & 1 deletion demo/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
remix_ui:
path: ../

mix: 1.0.0-beta.8
mix: ^0.9.0

dev_dependencies:
flutter_test:
Expand Down
4 changes: 2 additions & 2 deletions ios/Flutter/Generated.xcconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/leofarias/flutter
FLUTTER_APPLICATION_PATH=/Users/leofarias/Concepta/remix_ui
FLUTTER_ROOT=/Users/lucasoliveira/fvm/versions/stable
FLUTTER_APPLICATION_PATH=/Users/lucasoliveira/Developer/Concepta/Concepta/remix_ui
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
Expand Down
4 changes: 2 additions & 2 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/leofarias/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/leofarias/Concepta/remix_ui"
export "FLUTTER_ROOT=/Users/lucasoliveira/fvm/versions/stable"
export "FLUTTER_APPLICATION_PATH=/Users/lucasoliveira/Developer/Concepta/Concepta/remix_ui"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
Expand Down
40 changes: 20 additions & 20 deletions lib/components/alert/alert.style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,37 +68,37 @@ class RemixAlertStyle extends StyleRecipe<RemixAlertStyle> {
}

Style _outerRowContainer() => Style(
flex.gap(8),
box.padding(16),
box.borderRadius(8),
box.border.width(1),
box.border.color.redAccent(),
flex.mainAxisSize.min(),
flex.mainAxisAlignment.start(),
flex.crossAxisAlignment.start(),
$flex.gap(8),
$box.padding(16),
$box.borderRadius(8),
$box.border.width(1),
$box.border.color.redAccent(),
$flex.mainAxisSize.min(),
$flex.mainAxisAlignment.start(),
$flex.crossAxisAlignment.start(),
);

Style _innerColumnContainer() => Style(
flex.gap(2),
flex.mainAxisSize.min(),
flex.mainAxisAlignment.start(),
flex.crossAxisAlignment.start(),
$flex.gap(2),
$flex.mainAxisSize.min(),
$flex.mainAxisAlignment.start(),
$flex.crossAxisAlignment.start(),
flexible.expanded(),
);

Style _title() => Style(
text.style.fontSize(14),
text.style.fontWeight.w600(),
text.style.color.redAccent(),
$text.style.fontSize(14),
$text.style.fontWeight.w600(),
$text.style.color.redAccent(),
);

Style _subtitle() => Style(
text.style.fontSize(14),
text.style.fontWeight.normal(),
text.style.color.redAccent(),
$text.style.fontSize(14),
$text.style.fontWeight.normal(),
$text.style.color.redAccent(),
);

Style _icon() => Style(
icon.size(20),
icon.color.redAccent(),
$icon.size(20),
$icon.color.redAccent(),
);
26 changes: 13 additions & 13 deletions lib/components/avatar/avatar.style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ class RemixAvatarStyle extends StyleRecipe<RemixAvatarStyle> {
}

Style _container() => Style(
box.color.grey.shade100(),
box.borderRadius(50),
box.alignment.center(),
box.width(40),
box.height(40),
box.clipBehavior.antiAlias(),
clip.oval(),
$box.color.grey.shade100(),
$box.borderRadius(50),
$box.alignment.center(),
$box.width(40),
$box.height(40),
$box.clipBehavior.antiAlias(),
$with.clipOval(),
);

Style _label() => Style.text(
text.style.fontSize(16),
text.style.color.black54(),
text.style.fontWeight.bold(),
Style _label() => Style(
$text.style.fontSize(16),
$text.style.color.black54(),
$text.style.fontWeight.bold(),
);

Style _image() => Style.image(
image.fit.cover(),
Style _image() => Style(
$image.fit.cover(),
);
27 changes: 12 additions & 15 deletions lib/components/badge/badge.style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,18 @@ class RemixBadgeStyle extends StyleRecipe<RemixBadgeStyle> {
}

Style _container() => Style(
flex.mainAxisAlignment.center(),
flex.mainAxisSize.min(),
flex.crossAxisAlignment.center(),
flex.gap(4),
box.padding.horizontal(10),
box.padding.vertical(2),
box.borderRadius(20),
box.color.black(),
onHover(
box.color(Colors.black.withOpacity(0.8)),
),
$flex.mainAxisAlignment.center(),
$flex.mainAxisSize.min(),
$flex.crossAxisAlignment.center(),
$flex.gap(4),
$box.padding.horizontal(10),
$box.padding.vertical(2),
$box.borderRadius(20),
$box.color.black(),
);

Style _label() => Style.text(
text.style.fontSize(12),
text.style.fontWeight.w600(),
text.style.color.white(),
Style _label() => Style(
$text.style.fontSize(12),
$text.style.fontWeight.w600(),
$text.style.color.white(),
);
8 changes: 4 additions & 4 deletions lib/components/button/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ class RemixButton extends StatelessWidget
RemixButtonStyle buttonStyle,
) =>
[
_buildLoadingIndicator(MixData.create(context, buttonStyle.icon)),
_buildLoadingIndicator(context),
if (loadingLabel != null)
StyledText(
loadingLabel!,
style: buttonStyle.label,
),
];

Widget _buildLoadingIndicator(MixData mix) {
final icon = IconSpec.of(mix);
Widget _buildLoadingIndicator(BuildContext context) {
final icon = IconSpec.of(context);
const indicatorWidth = 2.5;

return SizedBox(
Expand All @@ -87,7 +87,7 @@ class RemixButton extends StatelessWidget
final style = buildStyle([size, type, ...variants]);

return PressableBox(
onPressed: disabled || loading ? null : onPressed,
onPress: disabled || loading ? null : onPressed,
child: HBox(
style: style.container,
children: _buildChildren(context, style),
Expand Down
Loading

0 comments on commit af2ae44

Please sign in to comment.