mirror of
https://github.com/foss42/apidash.git
synced 2025-08-26 06:11:06 +08:00
fix: review changes
This commit is contained in:
75
lib/screens/common_widgets/envvar_popover.dart
Normal file
75
lib/screens/common_widgets/envvar_popover.dart
Normal file
@ -0,0 +1,75 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:apidash/consts.dart';
|
||||
import 'package:apidash/models/models.dart';
|
||||
import 'common_widgets.dart';
|
||||
|
||||
class EnvVarPopover extends StatelessWidget {
|
||||
const EnvVarPopover({
|
||||
super.key,
|
||||
required this.suggestion,
|
||||
required this.scope,
|
||||
});
|
||||
|
||||
final EnvironmentVariableSuggestion suggestion;
|
||||
final String scope;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
type: MaterialType.card,
|
||||
borderRadius: kBorderRadius8,
|
||||
elevation: 8,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(minWidth: 200),
|
||||
child: Ink(
|
||||
padding: kP8,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
borderRadius: kBorderRadius8,
|
||||
border: Border.all(
|
||||
color: Theme.of(context).colorScheme.outlineVariant,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
EnvVarIndicator(suggestion: suggestion),
|
||||
kHSpacer10,
|
||||
Text(suggestion.variable.key),
|
||||
],
|
||||
),
|
||||
kVSpacer5,
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'VALUE',
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
),
|
||||
kHSpacer10,
|
||||
Text(suggestion.variable.value),
|
||||
],
|
||||
),
|
||||
kVSpacer5,
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'SCOPE',
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
),
|
||||
kHSpacer10,
|
||||
Text(scope),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user