diff --git a/lib/main.dart b/lib/main.dart index b9d58b2..1f48ea8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -54,7 +54,7 @@ class _AppwriteStarterKit extends State { children: [ SingleChildScrollView( child: Column( - spacing: 16, + spacing: context.isLargeScreen ? 64 : 32, children: [ TopPlatformView(status: _status), ConnectionStatusView( diff --git a/lib/ui/components/collapsible_bottomsheet.dart b/lib/ui/components/collapsible_bottomsheet.dart index b1695ea..396b790 100644 --- a/lib/ui/components/collapsible_bottomsheet.dart +++ b/lib/ui/components/collapsible_bottomsheet.dart @@ -500,7 +500,7 @@ class LogsTableRow extends StatelessWidget { child: MouseRegion( cursor: SystemMouseCursors.click, child: Text( - response.substring(0, 50), + response.length > 50 ? response.substring(0, 50) : response, maxLines: 1, overflow: TextOverflow.ellipsis, style: const TextStyle( diff --git a/lib/ui/components/connection_line.dart b/lib/ui/components/connection_line.dart index d66e67b..b0003b9 100644 --- a/lib/ui/components/connection_line.dart +++ b/lib/ui/components/connection_line.dart @@ -15,7 +15,7 @@ class ConnectionLine extends StatelessWidget { return SizedBox( width: context.widthFactor( mobileFactor: 0.25, - largeScreenFactor: 0.15, + largeScreenFactor: 0.25, ), child: Flex( direction: Axis.horizontal, diff --git a/lib/ui/components/getting_started_cards.dart b/lib/ui/components/getting_started_cards.dart index ede9089..08a6b34 100644 --- a/lib/ui/components/getting_started_cards.dart +++ b/lib/ui/components/getting_started_cards.dart @@ -2,6 +2,30 @@ import 'package:appwrite_flutter_starter_kit/utils/extensions/build_context.dart import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; +const cardWidgets = [ + GeneralInfoCard( + title: "Edit your app", + link: null, + subtitle: HighlightedText(), + ), + GeneralInfoCard( + title: "Head to Appwrite Cloud", + link: "https://cloud.appwrite.io", + subtitle: Text( + "Start managing your project from the Appwrite console", + style: TextStyle(fontSize: 14, color: Color(0xFF56565C)), + ), + ), + GeneralInfoCard( + title: "Explore docs", + link: "https://appwrite.io/docs", + subtitle: Text( + "Discover the full power of Appwrite by diving into our documentation", + style: TextStyle(fontSize: 14, color: Color(0xFF56565C)), + ), + ), +]; + /// A widget that contains a list of informational cards displayed vertically. class GettingStartedCards extends StatelessWidget { const GettingStartedCards({super.key}); @@ -9,39 +33,28 @@ class GettingStartedCards extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - GeneralInfoCard( - title: "Edit your app", - link: null, - subtitle: const HighlightedText(), - ), - GeneralInfoCard( - title: "Head to Appwrite Cloud", - link: "https://cloud.appwrite.io", - subtitle: const Text( - "Start managing your project from the Appwrite console", - style: TextStyle( - fontSize: 14, - color: Color(0xFF56565C), - ), + padding: const EdgeInsets.all(16.0), + child: context.isLargeScreen + ? Wrap( + spacing: 16, + runSpacing: 16, + alignment: WrapAlignment.center, + children: cardWidgets + .map((card) => SizedBox( + width: 350, + child: card, + )) + .toList(), + ) + : Column( + mainAxisSize: MainAxisSize.min, + children: cardWidgets + .map((card) => Padding( + padding: const EdgeInsets.only(bottom: 16), + child: card, + )) + .toList(), ), - ), - GeneralInfoCard( - title: "Explore docs", - link: "https://appwrite.io/docs", - subtitle: const Text( - "Discover the full power of Appwrite by diving into our documentation", - style: TextStyle( - fontSize: 14, - color: Color(0xFF56565C), - ), - ), - ), - ], - ), ); } } diff --git a/lib/ui/components/top_platform_view.dart b/lib/ui/components/top_platform_view.dart index e457b06..2ad6e41 100644 --- a/lib/ui/components/top_platform_view.dart +++ b/lib/ui/components/top_platform_view.dart @@ -1,5 +1,6 @@ import 'package:appwrite_flutter_starter_kit/data/models/status.dart'; import 'package:appwrite_flutter_starter_kit/ui/icons/appwrite.dart'; +import 'package:appwrite_flutter_starter_kit/utils/extensions/build_context.dart'; import 'package:flutter/material.dart'; import 'connection_line.dart'; @@ -18,13 +19,24 @@ class TopPlatformView extends StatelessWidget { @override Widget build(BuildContext context) { - return Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - PlatformIcon(child: FlutterLogo(size: 40)), - ConnectionLine(show: status == Status.success), - PlatformIcon(child: AppwriteIcon(size: 40)), - ], + return Padding( + // web has extra padding on top. + padding: + context.isLargeScreen ? EdgeInsets.only(top: 85) : EdgeInsets.zero, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + PlatformIcon( + size: context.isLargeScreen ? 185 : 100, + child: FlutterLogo(size: context.isLargeScreen ? 100 : 40), + ), + ConnectionLine(show: status == Status.success), + PlatformIcon( + size: context.isLargeScreen ? 185 : 100, + child: AppwriteIcon(size: context.isLargeScreen ? 100 : 40), + ), + ], + ), ); } } @@ -51,7 +63,7 @@ class PlatformIcon extends StatelessWidget { height: size, decoration: BoxDecoration( color: const Color(0xFFFAFAFD), - borderRadius: BorderRadius.circular(24), + borderRadius: BorderRadius.circular(context.isLargeScreen ? 44 : 24), border: Border.all(color: const Color(0x0A19191C), width: 1), boxShadow: [ BoxShadow( @@ -67,7 +79,7 @@ class PlatformIcon extends StatelessWidget { height: size * 0.86, decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(16), + borderRadius: BorderRadius.circular(context.isLargeScreen ? 32 : 16), border: Border.all(color: const Color(0xFFFAFAFB), width: 1), boxShadow: [ BoxShadow( diff --git a/lib/ui/icons/appwrite.dart b/lib/ui/icons/appwrite.dart index d3ee58e..ac39148 100644 --- a/lib/ui/icons/appwrite.dart +++ b/lib/ui/icons/appwrite.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; class AppwriteIcon extends StatelessWidget { - final double size; // Desired width, height scales accordingly + final double size; final Color color; const AppwriteIcon({