Skip to content

Commit c23ce74

Browse files
committed
fix: layout issues and add a nice spinner.
1 parent 3ab962f commit c23ce74

File tree

9 files changed

+203
-155
lines changed

9 files changed

+203
-155
lines changed

lib/home.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ class _AppwriteStarterKit extends State<AppwriteStarterKit> {
2626
return Scaffold(
2727
body: CheckeredBackground(
2828
child: SafeArea(
29-
minimum: EdgeInsets.only(top: context.isLargeScreen ? 24 : 16),
29+
minimum: EdgeInsets.only(
30+
top: context.isExtraWideScreen
31+
? 156
32+
: context.isLargeScreen
33+
? 24
34+
: 32),
3035
child: Stack(
3136
children: [
3237
SingleChildScrollView(

lib/ui/components/collapsible_bottomsheet.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ class LogsTableRow extends StatelessWidget {
491491
child: MouseRegion(
492492
cursor: SystemMouseCursors.click,
493493
child: Text(
494-
response.substring(0, 50),
494+
response.length >= 50 ? response.substring(0, 50) : response,
495495
maxLines: 1,
496496
overflow: TextOverflow.ellipsis,
497497
style: const TextStyle(

lib/ui/components/connection_line.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ConnectionLine extends StatelessWidget {
1515
return SizedBox(
1616
width: context.widthFactor(
1717
mobileFactor: 0.25,
18-
largeScreenFactor: 0.15,
18+
largeScreenFactor: 0.1,
1919
),
2020
child: Flex(
2121
direction: Axis.horizontal,

lib/ui/components/getting_started_cards.dart

Lines changed: 81 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:appwrite_flutter_starter_kit/ui/components/responsive_layout.dart';
12
import 'package:appwrite_flutter_starter_kit/utils/extensions/build_context.dart';
23
import 'package:flutter/material.dart';
34
import 'package:url_launcher/url_launcher.dart';
@@ -8,39 +9,85 @@ class GettingStartedCards extends StatelessWidget {
89

910
@override
1011
Widget build(BuildContext context) {
11-
return Padding(
12-
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
13-
child: Column(
14-
mainAxisSize: MainAxisSize.min,
15-
children: [
16-
GeneralInfoCard(
17-
title: "Edit your app",
18-
link: null,
19-
subtitle: const HighlightedText(),
20-
),
21-
GeneralInfoCard(
22-
title: "Head to Appwrite Cloud",
23-
link: "https://cloud.appwrite.io",
24-
subtitle: const Text(
25-
"Start managing your project from the Appwrite console",
26-
style: TextStyle(
27-
fontSize: 14,
28-
color: Color(0xFF56565C),
12+
return ResponsiveLayout(
13+
smallDeviceLayout: Padding(
14+
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
15+
child: Column(
16+
mainAxisSize: MainAxisSize.min,
17+
children: [
18+
GeneralInfoCard(
19+
title: "Edit your app",
20+
link: null,
21+
subtitle: const HighlightedText(),
22+
),
23+
GeneralInfoCard(
24+
title: "Head to Appwrite Cloud",
25+
link: "https://cloud.appwrite.io",
26+
subtitle: const Text(
27+
"Start managing your project from the Appwrite console",
28+
style: TextStyle(
29+
fontSize: 14,
30+
color: Color(0xFF56565C),
31+
),
2932
),
3033
),
31-
),
32-
GeneralInfoCard(
33-
title: "Explore docs",
34-
link: "https://appwrite.io/docs",
35-
subtitle: const Text(
36-
"Discover the full power of Appwrite by diving into our documentation",
37-
style: TextStyle(
38-
fontSize: 14,
39-
color: Color(0xFF56565C),
34+
GeneralInfoCard(
35+
title: "Explore docs",
36+
link: "https://appwrite.io/docs",
37+
subtitle: const Text(
38+
"Discover the full power of Appwrite by diving into our documentation",
39+
style: TextStyle(
40+
fontSize: 14,
41+
color: Color(0xFF56565C),
42+
),
4043
),
4144
),
42-
),
43-
],
45+
],
46+
),
47+
),
48+
largeDeviceLayout: Padding(
49+
padding: EdgeInsets.symmetric(
50+
horizontal: context.isExtraWideScreen ? 64 : 16.0, vertical: 16.0),
51+
child: Row(
52+
mainAxisSize: MainAxisSize.min,
53+
mainAxisAlignment: MainAxisAlignment.center,
54+
spacing: 16,
55+
children: [
56+
Flexible(
57+
child: GeneralInfoCard(
58+
title: "Edit your app",
59+
link: null,
60+
subtitle: const HighlightedText(),
61+
),
62+
),
63+
Flexible(
64+
child: GeneralInfoCard(
65+
title: "Head to Appwrite Cloud",
66+
link: "https://cloud.appwrite.io",
67+
subtitle: const Text(
68+
"Start managing your project from the Appwrite console",
69+
style: TextStyle(
70+
fontSize: 14,
71+
color: Color(0xFF56565C),
72+
),
73+
),
74+
),
75+
),
76+
Flexible(
77+
child: GeneralInfoCard(
78+
title: "Explore docs",
79+
link: "https://appwrite.io/docs",
80+
subtitle: const Text(
81+
"Discover the full power of Appwrite by diving into our documentation",
82+
style: TextStyle(
83+
fontSize: 14,
84+
color: Color(0xFF56565C),
85+
),
86+
),
87+
),
88+
),
89+
],
90+
),
4491
),
4592
);
4693
}
@@ -68,9 +115,12 @@ class GeneralInfoCard extends StatelessWidget {
68115
@override
69116
Widget build(BuildContext context) {
70117
return LayoutBuilder(builder: (context, constraints) {
118+
final double cardWidth = context.isExtraWideScreen
119+
? constraints.maxWidth.clamp(0, 350)
120+
: constraints.maxWidth;
121+
71122
return SizedBox(
72-
// `1` because we already have padding on sides.
73-
width: constraints.maxWidth * (context.isExtraWideScreen ? 0.55 : 1),
123+
width: cardWidth,
74124
child: Card(
75125
elevation: 0,
76126
shape: RoundedRectangleBorder(

lib/ui/components/top_platform_view.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:appwrite_flutter_starter_kit/data/models/status.dart';
22
import 'package:appwrite_flutter_starter_kit/ui/icons/appwrite.dart';
3+
import 'package:appwrite_flutter_starter_kit/utils/extensions/build_context.dart';
34
import 'package:flutter/material.dart';
45

56
import 'connection_line.dart';
@@ -21,9 +22,15 @@ class TopPlatformView extends StatelessWidget {
2122
return Row(
2223
mainAxisAlignment: MainAxisAlignment.center,
2324
children: <Widget>[
24-
PlatformIcon(child: FlutterLogo(size: 40)),
25+
PlatformIcon(
26+
size: context.isExtraWideScreen ? 142 : 100,
27+
child: FlutterLogo(size: context.isExtraWideScreen ? 56 : 40),
28+
),
2529
ConnectionLine(show: status == Status.success),
26-
PlatformIcon(child: AppwriteIcon(size: 40)),
30+
PlatformIcon(
31+
size: context.isExtraWideScreen ? 142 : 100,
32+
child: AppwriteIcon(size: context.isExtraWideScreen ? 56 : 40),
33+
),
2734
],
2835
);
2936
}
@@ -51,7 +58,7 @@ class PlatformIcon extends StatelessWidget {
5158
height: size,
5259
decoration: BoxDecoration(
5360
color: const Color(0xFFFAFAFD),
54-
borderRadius: BorderRadius.circular(24),
61+
borderRadius: BorderRadius.circular(context.isExtraWideScreen ? size * 0.2 : 24),
5562
border: Border.all(color: const Color(0x0A19191C), width: 1),
5663
boxShadow: [
5764
BoxShadow(
@@ -65,9 +72,10 @@ class PlatformIcon extends StatelessWidget {
6572
child: Container(
6673
width: size * 0.86,
6774
height: size * 0.86,
75+
margin: context.isExtraWideScreen ? EdgeInsets.all(8) : null,
6876
decoration: BoxDecoration(
6977
color: Colors.white,
70-
borderRadius: BorderRadius.circular(16),
78+
borderRadius: BorderRadius.circular(context.isExtraWideScreen ? size * 0.2: 16),
7179
border: Border.all(color: const Color(0xFFFAFAFB), width: 1),
7280
boxShadow: [
7381
BoxShadow(

pubspec.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ packages:
4545
dependency: transitive
4646
description:
4747
name: characters
48-
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
48+
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
4949
url: "https://pub.dev"
5050
source: hosted
51-
version: "1.4.0"
51+
version: "1.3.0"
5252
checked_yaml:
5353
dependency: transitive
5454
description:
@@ -77,10 +77,10 @@ packages:
7777
dependency: transitive
7878
description:
7979
name: collection
80-
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
80+
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
8181
url: "https://pub.dev"
8282
source: hosted
83-
version: "1.19.1"
83+
version: "1.19.0"
8484
cookie_jar:
8585
dependency: transitive
8686
description:
@@ -271,10 +271,10 @@ packages:
271271
dependency: transitive
272272
description:
273273
name: meta
274-
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
274+
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
275275
url: "https://pub.dev"
276276
source: hosted
277-
version: "1.16.0"
277+
version: "1.15.0"
278278
package_info_plus:
279279
dependency: transitive
280280
description:
@@ -625,5 +625,5 @@ packages:
625625
source: hosted
626626
version: "3.1.3"
627627
sdks:
628-
dart: ">=3.7.0-0 <4.0.0"
628+
dart: ">=3.6.0 <4.0.0"
629629
flutter: ">=3.27.0"

web/favicon.png

-399 Bytes
Binary file not shown.

web/favicon.svg

Lines changed: 8 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)