mirror of
https://github.com/foss42/apidash.git
synced 2025-06-27 19:07:40 +08:00
Merge pull request #454 from DenserMeerkat/resolve-issue-mobile
Fix UI inconsistencies in mobile
This commit is contained in:
@ -29,7 +29,6 @@ class NavbarButton extends ConsumerWidget {
|
||||
final mobileScaffoldKeyNotifier =
|
||||
ref.watch(mobileScaffoldKeyStateProvider.notifier);
|
||||
final bool isSelected = railIdx == buttonIdx;
|
||||
final Size size = isCompact ? const Size(56, 32) : const Size(65, 32);
|
||||
var onPress = isSelected
|
||||
? null
|
||||
: () {
|
||||
@ -49,20 +48,20 @@ class NavbarButton extends ConsumerWidget {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
TextButton(
|
||||
style: isSelected
|
||||
? TextButton.styleFrom(
|
||||
fixedSize: size,
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.secondaryContainer,
|
||||
)
|
||||
: TextButton.styleFrom(
|
||||
fixedSize: size,
|
||||
),
|
||||
onPressed: onPress,
|
||||
child: Icon(
|
||||
isSelected ? selectedIcon : icon,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
SizedBox(
|
||||
height: isCompact ? 36 : 36,
|
||||
child: TextButton(
|
||||
style: TextButton.styleFrom(
|
||||
padding: EdgeInsets.zero,
|
||||
backgroundColor: isSelected
|
||||
? Theme.of(context).colorScheme.secondaryContainer
|
||||
: null,
|
||||
),
|
||||
onPressed: onPress,
|
||||
child: Icon(
|
||||
isSelected ? selectedIcon : icon,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
showLabel ? const SizedBox(height: 4) : const SizedBox.shrink(),
|
||||
|
@ -106,6 +106,9 @@ class EnvironmentTriggerFieldState extends State<EnvironmentTriggerField> {
|
||||
onChanged: widget.onChanged,
|
||||
onSubmitted: widget.onFieldSubmitted,
|
||||
specialTextSpanBuilder: EnvRegExpSpanBuilder(),
|
||||
onTapOutside: (event) {
|
||||
focusNode.unfocus();
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -129,33 +129,34 @@ class Grabber extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!isOnDesktopAndWeb) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
final ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||
|
||||
return GestureDetector(
|
||||
onVerticalDragUpdate: onVerticalDragUpdate,
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: colorScheme.surfaceContainerLow,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(16), topRight: Radius.circular(16)),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: Container(
|
||||
margin: kPv10,
|
||||
width: 80.0,
|
||||
height: 6.0,
|
||||
decoration: BoxDecoration(
|
||||
color: colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
final handle = Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: colorScheme.surfaceContainerLow,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(16), topRight: Radius.circular(16)),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: Container(
|
||||
margin: kPv10,
|
||||
width: 80.0,
|
||||
height: 6.0,
|
||||
decoration: BoxDecoration(
|
||||
color: colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
if (!isOnDesktopAndWeb) {
|
||||
return handle;
|
||||
}
|
||||
return GestureDetector(
|
||||
onVerticalDragUpdate: onVerticalDragUpdate,
|
||||
child: handle,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class HistoryURLCard extends StatelessWidget {
|
||||
|
||||
return LayoutBuilder(builder: (context, constraints) {
|
||||
final isCompact = constraints.maxWidth <= kMinWindowSize.width;
|
||||
final isExpanded = constraints.maxWidth >= kMediumWindowWidth;
|
||||
final isExpanded = constraints.maxWidth >= kMediumWindowWidth - 8;
|
||||
return Card(
|
||||
color: kColorTransparent,
|
||||
surfaceTintColor: kColorTransparent,
|
||||
|
@ -37,7 +37,7 @@ class FilledButtonGroup extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
return ClipRRect(
|
||||
borderRadius: kBorderRadius20,
|
||||
borderRadius: BorderRadius.circular(88),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: buttonsWithSpacers,
|
||||
|
Reference in New Issue
Block a user