Skip to content

Commit e5bd696

Browse files
committed
feat: add ProductGrid component and update dependencies
1 parent 01a8fa8 commit e5bd696

File tree

5 files changed

+58
-3
lines changed

5 files changed

+58
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Or manually add it to your `pubspec.yaml`:
2121

2222
```yaml
2323
dependencies:
24-
fluttersdk_wind: ^0.0.2
24+
fluttersdk_wind: ^0.0.3
2525
```
2626
2727
Then, fetch dependencies:

example/lib/demo.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import 'pages/widgets/wflex.dart';
4141
import 'pages/widgets/wflexcontainer.dart';
4242
import 'pages/widgets/wflexible.dart';
4343
import 'pages/widgets/wtext.dart';
44+
import 'pages/example/product_grid.dart';
4445

4546
class MyApp extends StatelessWidget {
4647
final Widget Function(BuildContext) appCallback;
@@ -190,6 +191,8 @@ void main() {
190191
AppLayoutWidget(WContainerWidget()),
191192
'/layouts/display': (context) =>
192193
AppLayoutWidget(DisplayLayout()),
194+
'/example/product_grid': (context) =>
195+
AppLayoutWidget(ProductGrid()),
193196
},
194197
);
195198
},
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:fluttersdk_wind/fluttersdk_wind.dart';
3+
4+
class ProductGrid extends StatelessWidget {
5+
const ProductGrid({super.key});
6+
7+
@override
8+
Widget build(BuildContext context) {
9+
return Scaffold(
10+
backgroundColor: wColor('gray', shade: 200),
11+
body: WFlexContainer(
12+
className:
13+
'flex-col md:flex-row gap-4 p-4',
14+
children: [
15+
collectionCard(
16+
imageUrl: 'https://picsum.photos/400/300',
17+
title: 'Desk and Office',
18+
description: 'Work from home accessories'),
19+
collectionCard(
20+
imageUrl: 'https://picsum.photos/400/300',
21+
title: 'Self-Improvement',
22+
description: 'Journals and note-taking'),
23+
collectionCard(
24+
imageUrl: 'https://picsum.photos/400/300',
25+
title: 'Travel',
26+
description: 'Daily commute essentials')
27+
],
28+
),
29+
);
30+
}
31+
32+
Widget collectionCard({
33+
required String imageUrl,
34+
required String title,
35+
required String description,
36+
}) {
37+
return WFlexContainer(
38+
className: 'flex-1 flex-col gap-2',
39+
children: [
40+
WContainer(
41+
className: 'rounded-lg bg-white',
42+
child: Image.network(
43+
'https://picsum.photos/400/300',
44+
fit: BoxFit.cover,
45+
),
46+
),
47+
WText(title, className: 'text-base font-bold text-gray-900'),
48+
WText(description, className: 'text-sm text-gray-500'),
49+
],
50+
);
51+
}
52+
}

lib/src/parsers/background_color_parser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:flutter/material.dart';
2-
import 'package:fluttersdk_wind/fluttersdk_wind.dart';
32

3+
import '../helpers.dart';
44
import '../theme/wind_theme.dart';
55
import 'screens_parser.dart';
66

lib/src/parsers/text_color_parser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:flutter/material.dart';
2-
import 'package:fluttersdk_wind/fluttersdk_wind.dart';
32

3+
import '../helpers.dart';
44
import '../theme/wind_theme.dart';
55
import 'screens_parser.dart';
66

0 commit comments

Comments
 (0)