Skip to content

Commit

Permalink
fix/playground spaces and select offset
Browse files Browse the repository at this point in the history
  • Loading branch information
nank1ro committed May 19, 2024
1 parent e4094fd commit 94df8b9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
4 changes: 3 additions & 1 deletion lib/src/components/select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class ShadSelectState<T> extends State<ShadSelect<T>> {
const ShadAnchor(
childAlignment: Alignment.bottomLeft,
overlayAlignment: Alignment.topLeft,
offset: Offset(4, 0),
offset: Offset.zero,
);

final Widget effectiveText;
Expand Down Expand Up @@ -561,6 +561,8 @@ class _ShadOptionState<T> extends State<ShadOption<T>> {
child: Focus(
focusNode: focusNode,
child: ShadGestureDetector(
behavior: HitTestBehavior.opaque,
cursor: SystemMouseCursors.click,
onHoverChange: (value) {
hovered.value = value;
if (value) focusNode.requestFocus();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/theme/themes/component_defaults.dart
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ abstract class ShadDefaultComponentThemes {
anchor: const ShadAnchor(
childAlignment: Alignment.bottomLeft,
overlayAlignment: Alignment.topLeft,
offset: Offset(4, 0),
offset: Offset.zero,
),
);
}
Expand Down
15 changes: 6 additions & 9 deletions playground/lib/pages/form.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// ignore_for_file: avoid_print

import 'package:awesome_flutter_extensions/awesome_flutter_extensions.dart';
import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';

Expand Down Expand Up @@ -129,14 +128,12 @@ class _FormPageState extends State<FormPage> {
FormStyle.radioField =>
ShadRadioGroupFormField<NotifyAbout>(
label: const Text('Notify me about'),
items: NotifyAbout.values
.map(
(e) => ShadRadio(
value: e,
label: Text(e.message),
),
)
.separatedBy(const SizedBox(height: 4)),
items: NotifyAbout.values.map(
(e) => ShadRadio(
value: e,
label: Text(e.message),
),
),
validator: (v) {
if (v == null) {
return 'You need to select a notification type.';
Expand Down
7 changes: 3 additions & 4 deletions playground/lib/pages/radio_group.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:awesome_flutter_extensions/awesome_flutter_extensions.dart';
import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';

Expand All @@ -9,10 +8,10 @@ class RadioGroupPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Scaffold(
return const Scaffold(
body: Center(
child: ShadRadioGroup<String>(
items: const [
items: [
ShadRadio(
label: Text('Default'),
value: 'default',
Expand All @@ -25,7 +24,7 @@ class RadioGroupPage extends StatelessWidget {
label: Text('Nothing'),
value: 'nothing',
),
].separatedBy(const SizedBox(height: 4)),
],
),
),
);
Expand Down
3 changes: 1 addition & 2 deletions playground/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,13 @@
<script>
window.addEventListener('load', function () {
const loader = document.querySelector('.loader');
_flutter.loader.load({
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
}
}).then(function (engineInitializer) {
return engineInitializer.initializeEngine();
}).then(function (appRunner) {
console.log('appRunner', appRunner);
loader.remove();
return appRunner.runApp();
}).then(function (app) {
Expand Down

0 comments on commit 94df8b9

Please sign in to comment.