mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 19:47:47 +08:00
feat: small screen
This commit is contained in:
@@ -27,8 +27,8 @@ class WelcomePage extends ConsumerWidget {
|
|||||||
return switch (data) {
|
return switch (data) {
|
||||||
AsyncData(:final value) => SingleChildScrollView(
|
AsyncData(:final value) => SingleChildScrollView(
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: 10,
|
spacing: isSmallScreen(context) ? 5 : 10,
|
||||||
runSpacing: 20,
|
runSpacing: isSmallScreen(context) ? 10 : 20,
|
||||||
children: value.isEmpty
|
children: value.isEmpty
|
||||||
? [
|
? [
|
||||||
Container(
|
Container(
|
||||||
@@ -48,6 +48,11 @@ class WelcomePage extends ConsumerWidget {
|
|||||||
_ => const MyProgressIndicator(),
|
_ => const MyProgressIndicator(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isSmallScreen(BuildContext context) {
|
||||||
|
final screenWidth = MediaQuery.of(context).size.width;
|
||||||
|
return screenWidth < 600;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MediaCard extends StatelessWidget {
|
class MediaCard extends StatelessWidget {
|
||||||
@@ -58,7 +63,6 @@ class MediaCard extends StatelessWidget {
|
|||||||
const MediaCard({super.key, required this.item});
|
const MediaCard({super.key, required this.item});
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
shape: ContinuousRectangleBorder(
|
shape: ContinuousRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
|||||||
Reference in New Issue
Block a user