-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.md
179 lines (133 loc) · 4.11 KB
/
README.md
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# text_3d: 3D Text Effects for Flutter
Easily incorporate visually captivating 3D text effects into your Flutter applications.
The `text_3d` library offers a range of predefined styles, and the flexibility to customize, letting
your creativity roam free.
![Flutter](https://img.shields.io/badge/Flutter%20-%2302569B.svg?style=flat&logo=flutter&logoColor=FFFFFF)
![Dart](https://img.shields.io/badge/dart-%230175C2.svg?style=flat&logo=dart&logoColor=FFFFFF)
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Available Styles](#available-styles)
- [Example](#example)
- [Custom Styles](#custom-styles)
- [Contributing](#contributing)
- [License](#license)
## Installation
Add the following line to your `pubspec.yaml` under `dependencies`:
```
text_3d: latest_version
```
Then run:
```
flutter pub get
```
## Usage
To use the `ThreeDText` widget:
```dart
import 'package:text_3d/text_3d.dart';
```
## Available Styles
- `standard`: A basic 3D effect.
- `raised`: Text appears raised from the background.
- `inset`: Text appears pressed into the background.
- `perspectiveRaised`: Text has a raised perspective look.
- `perspectiveInset`: Text has a pressed perspective look.
- `perspectiveLeft`: Text slants to the left in perspective.
- `perspectiveRight`: Text slants to the right in perspective.
## Example
Here's a quick example of how to use the `ThreeDText` widget:
![Example Image](https://github.com/setayeshce/text3d/blob/main/assets/images/perspectiveRaised.png?raw=true)
```dart
ThreeDText(
text: 'perspectiveRaised',
textStyle: TextStyle(fontSize: 40, color: Colors.green),
depth: 10,
style: ThreeDStyle.perspectiveRaised,
angle: pi / 6,
perspectiveDepth: 30,
),
```
![Example Image](https://github.com/setayeshce/text3d/blob/main/assets/images/perspectiveInset.png?raw=true)
```dart
ThreeDText(
text: 'perspectiveInset',
textStyle: TextStyle(fontSize: 40, color: Colors.purpleAccent),
depth: 40,
style: ThreeDStyle.perspectiveInset,
angle: pi / 6,
perspectiveDepth: 20,
),
```
![Example Image](https://github.com/setayeshce/text3d/blob/main/assets/images/perspectiveRight.png?raw=true)
```dart
ThreeDText(
text: 'perspectiveRight',
textStyle: TextStyle(fontSize: 25, color: Colors.yellow),
style: ThreeDStyle.perspectiveLeft,
perspectiveDepth: 45.0,
),
```
![Example Image](https://github.com/setayeshce/text3d/blob/main/assets/images/perspectiveLeft.png?raw=true)
```dart
ThreeDText(
text: 'perspectiveLeft',
textStyle: const TextStyle(
fontSize: 25,
color: Colors.pink ,
fontWeight: FontWeight.bold),
depth: 6,
style: ThreeDStyle.perspectiveLeft,
perspectiveDepth: -45.0
),
```
![Example Image](https://github.com/setayeshce/text3d/blob/main/assets/images/inset.png?raw=true)
```dart
ThreeDText(
text: "inset",
textStyle: TextStyle(
fontSize: 64,
color: Colors.pinkAccent,
),
style: ThreeDStyle.inset,
),
```
![Example Image](https://github.com/setayeshce/text3d/blob/main/assets/images/raised.png?raw=true)
```dart
ThreeDText(
text: 'raised',
textStyle: TextStyle(fontSize: 64, color: Colors.blue),
depth: 10,
style: ThreeDStyle.raised,
),
```
![Example Image](https://github.com/setayeshce/text3d/blob/main/assets/images/standard.png?raw=true)
```dart
ThreeDText(
text: 'standard',
textStyle: TextStyle(fontSize: 40, color: Colors.blue),
depth: 5,
style: ThreeDStyle.standard,
),
```
![Example Image](https://github.com/setayeshce/text3d/blob/main/assets/images/insetAngle.png?raw=true)
```dart
ThreeDText(
text: 'inset with angle',
textStyle: TextStyle(fontSize: 40, color: Colors.deepOrange),
depth: 5,
style: ThreeDStyle.inset,
angle: 70,
),
```
## Custom Styles
While the library comes packed with a range of predefined styles, it's designed with flexibility in
mind. You can adjust properties like `angle`, `depth`, and `perspectiveDepth` to create unique 3D
effects tailored to your design vision.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would
like to change.
## License
[MIT](https://choosealicense.com/licenses/mit/)
---
Copy the above text into your README.md file, and it should be well-documented and formatted for
users and developers alike!