-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
55 lines (48 loc) · 2.11 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import 'package:extensionresoft/extensionresoft.dart';
import 'package:flutter/material.dart';
void main() {
// SpaceExtension Example
final spacerX = 16.spaceX(); // Creates a SizedBox with a width of 16.
final spacerY = 24.spaceY(); // Creates a SizedBox with a height of 24.
final spacerXY =
32.spaceXY(); // Creates a SizedBox with both width and height of 32.
final spacerXGetter =
20.spX; // Getter example: Creates a SizedBox with a width of 20.
final spacerYGetter =
30.spY; // Getter example: Creates a SizedBox with a height of 30.
final spacerXYGetter = 40
.spXY; // Getter example: Creates a SizedBox with both width and height of 40.
// CustomCardExtension Example
final roundedCard = 16.radius(
child: const Text('Hello World'),
elevation: 4,
color: Colors.blue,
strokeColor: Colors.black,
shadowColor: Colors.grey,
); // Creates a rounded card with specified properties.
// PathExtension Example
final result = 16.p((n) =>
n * 2); // Applies a function to the number 16 and returns the result.
// TextExtension Example
final textWidget = 'Hello'.edit(
textStyle: const TextStyle(fontSize: 20),
textAlign: TextAlign.center); // Creates a customized Text widget.
// CustomImageExtension Example
final imageWidget = 'assets/image.png'.img(
width: 100,
height: 100,
fit: BoxFit
.cover); // Creates an Image widget from an asset with specified properties.
final circleImageContainer = 'assets/avatar.png'.circleImage(
fit: BoxFit.cover,
opacity:
0.8); // Creates a circular image container with specified properties.
// Conditional Function Example
final conditionResult = condition(true, 'True Value',
'False Value'); // Returns 'True Value' based on the condition.
final conditionFunctionResult = conditionFunction(true, () => 'True Value',
() => 'False Value'); // Invokes a function based on the condition.
// Get Function Example
final value = get('Existing Value',
'Default Value'); // Returns 'Existing Value' if not null, otherwise returns 'Default Value'.
}