mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 05:32:26 +08:00
feat: large mobile device responsiveness
This commit is contained in:
@ -15,6 +15,8 @@ class DropdownButtonHttpMethod extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final surfaceColor = Theme.of(context).colorScheme.surface;
|
||||
final isMobile =
|
||||
kIsMobile && MediaQuery.of(context).size.width < kMinWindowSize.width;
|
||||
return DropdownButton<HTTPVerb>(
|
||||
focusColor: surfaceColor,
|
||||
value: method,
|
||||
@ -29,11 +31,11 @@ class DropdownButtonHttpMethod extends StatelessWidget {
|
||||
return DropdownMenuItem<HTTPVerb>(
|
||||
value: value,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: kIsMobile ? 8 : 16),
|
||||
padding: EdgeInsets.only(left: isMobile ? 8 : 16),
|
||||
child: Text(
|
||||
value.name.toUpperCase(),
|
||||
style: kCodeStyle.copyWith(
|
||||
fontSize: kIsMobile ? 13 : null,
|
||||
fontSize: isMobile ? 13 : null,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: getHTTPMethodColor(
|
||||
value,
|
||||
|
@ -23,6 +23,8 @@ class IntroMessage extends StatelessWidget {
|
||||
return FutureBuilder(
|
||||
future: introData(),
|
||||
builder: (BuildContext context, AsyncSnapshot<void> snapshot) {
|
||||
final isMobile = kIsMobile &&
|
||||
MediaQuery.of(context).size.width < kMinWindowSize.width;
|
||||
if (snapshot.hasError) {
|
||||
return const ErrorMessage(message: "An error occured");
|
||||
}
|
||||
@ -37,7 +39,7 @@ class IntroMessage extends StatelessWidget {
|
||||
|
||||
return CustomMarkdown(
|
||||
data: text,
|
||||
padding: !kIsMobile ? kPh60 : kPh20,
|
||||
padding: !isMobile ? kPh60 : kPh20,
|
||||
);
|
||||
}
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
|
@ -45,9 +45,11 @@ class _RequestPaneState extends State<RequestPane>
|
||||
if (widget.tabIndex != null) {
|
||||
_controller.index = widget.tabIndex!;
|
||||
}
|
||||
final isMobile =
|
||||
kIsMobile && MediaQuery.of(context).size.width < kMinWindowSize.width;
|
||||
return Column(
|
||||
children: [
|
||||
kIsMobile
|
||||
isMobile
|
||||
? const SizedBox.shrink()
|
||||
: Padding(
|
||||
padding: kP8,
|
||||
|
@ -12,8 +12,10 @@ class TabLabel extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isMobile =
|
||||
kIsMobile && MediaQuery.of(context).size.width < kMinWindowSize.width;
|
||||
return SizedBox(
|
||||
height: kTabHeight,
|
||||
height: isMobile ? kMobileTabHeight : kTabHeight,
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
|
Reference in New Issue
Block a user