mirror of
https://github.com/foss42/apidash.git
synced 2025-06-28 11:27:06 +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 =
|
final mobileScaffoldKeyNotifier =
|
||||||
ref.watch(mobileScaffoldKeyStateProvider.notifier);
|
ref.watch(mobileScaffoldKeyStateProvider.notifier);
|
||||||
final bool isSelected = railIdx == buttonIdx;
|
final bool isSelected = railIdx == buttonIdx;
|
||||||
final Size size = isCompact ? const Size(56, 32) : const Size(65, 32);
|
|
||||||
var onPress = isSelected
|
var onPress = isSelected
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
@ -49,15 +48,14 @@ class NavbarButton extends ConsumerWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
TextButton(
|
SizedBox(
|
||||||
style: isSelected
|
height: isCompact ? 36 : 36,
|
||||||
? TextButton.styleFrom(
|
child: TextButton(
|
||||||
fixedSize: size,
|
style: TextButton.styleFrom(
|
||||||
backgroundColor:
|
padding: EdgeInsets.zero,
|
||||||
Theme.of(context).colorScheme.secondaryContainer,
|
backgroundColor: isSelected
|
||||||
)
|
? Theme.of(context).colorScheme.secondaryContainer
|
||||||
: TextButton.styleFrom(
|
: null,
|
||||||
fixedSize: size,
|
|
||||||
),
|
),
|
||||||
onPressed: onPress,
|
onPressed: onPress,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
@ -65,6 +63,7 @@ class NavbarButton extends ConsumerWidget {
|
|||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
showLabel ? const SizedBox(height: 4) : const SizedBox.shrink(),
|
showLabel ? const SizedBox(height: 4) : const SizedBox.shrink(),
|
||||||
showLabel
|
showLabel
|
||||||
? Text(
|
? Text(
|
||||||
|
@ -106,6 +106,9 @@ class EnvironmentTriggerFieldState extends State<EnvironmentTriggerField> {
|
|||||||
onChanged: widget.onChanged,
|
onChanged: widget.onChanged,
|
||||||
onSubmitted: widget.onFieldSubmitted,
|
onSubmitted: widget.onFieldSubmitted,
|
||||||
specialTextSpanBuilder: EnvRegExpSpanBuilder(),
|
specialTextSpanBuilder: EnvRegExpSpanBuilder(),
|
||||||
|
onTapOutside: (event) {
|
||||||
|
focusNode.unfocus();
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -129,14 +129,9 @@ class Grabber extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (!isOnDesktopAndWeb) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
final ColorScheme colorScheme = Theme.of(context).colorScheme;
|
final ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||||
|
|
||||||
return GestureDetector(
|
final handle = Container(
|
||||||
onVerticalDragUpdate: onVerticalDragUpdate,
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: colorScheme.surfaceContainerLow,
|
color: colorScheme.surfaceContainerLow,
|
||||||
@ -155,7 +150,13 @@ class Grabber extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
|
if (!isOnDesktopAndWeb) {
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
return GestureDetector(
|
||||||
|
onVerticalDragUpdate: onVerticalDragUpdate,
|
||||||
|
child: handle,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class HistoryURLCard extends StatelessWidget {
|
|||||||
|
|
||||||
return LayoutBuilder(builder: (context, constraints) {
|
return LayoutBuilder(builder: (context, constraints) {
|
||||||
final isCompact = constraints.maxWidth <= kMinWindowSize.width;
|
final isCompact = constraints.maxWidth <= kMinWindowSize.width;
|
||||||
final isExpanded = constraints.maxWidth >= kMediumWindowWidth;
|
final isExpanded = constraints.maxWidth >= kMediumWindowWidth - 8;
|
||||||
return Card(
|
return Card(
|
||||||
color: kColorTransparent,
|
color: kColorTransparent,
|
||||||
surfaceTintColor: kColorTransparent,
|
surfaceTintColor: kColorTransparent,
|
||||||
|
@ -37,7 +37,7 @@ class FilledButtonGroup extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ClipRRect(
|
return ClipRRect(
|
||||||
borderRadius: kBorderRadius20,
|
borderRadius: BorderRadius.circular(88),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: buttonsWithSpacers,
|
children: buttonsWithSpacers,
|
||||||
|
Reference in New Issue
Block a user