Skip to content

Commit

Permalink
# 2.1.0
Browse files Browse the repository at this point in the history
- Add TypeWriterText.builder
  • Loading branch information
Nialixus committed Sep 17, 2023
1 parent 5068abe commit 2829e05
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 115 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@

# 2.1.0

- Add TypeWriter Builder
- Add TypeWriterText.builder
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,23 @@ And then put the widget like this.

```dart
const TypeWriterText(
text: Text('text'),
duration: Duration(milliseconds: 50),
text: Text('lorem ipsum dolor sit amet ...'),
duration: Duration(milliseconds: 50),
);
// or if you can use builder to integrate
// with other widget like auto size text like this
const TypeWriterText.builder(
'Lorem ipsum dolor sit amet ...',
duration: Duration(milliseconds: 50),
builder: (context, value) {
return AutoSizeText(
value,
maxLines: 2,
minFontSize: 2.0,
);
}
);
```

Expand Down
59 changes: 31 additions & 28 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:typewritertext/typewritertext.dart';

Expand All @@ -19,37 +20,39 @@ class MyApp extends StatelessWidget {
padding: const EdgeInsets.all(20.0),
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TypeWriterText(
repeat: false,
text: Text("Hello and Welcome.",
textAlign: TextAlign.left,
style: Theme.of(context).textTheme.titleMedium),
duration: const Duration(milliseconds: 50)),
TypeWriterText(
repeat: false,
text: Text("My name is Chris McBrien. ",
textAlign: TextAlign.left,
style: Theme.of(context).textTheme.headlineLarge),
duration: const Duration(milliseconds: 100)),
TypeWriterText(
repeat: false,
text: Text("Builder of things. ",
textAlign: TextAlign.left,
style: Theme.of(context).textTheme.headlineLarge),
duration: const Duration(milliseconds: 50)),
Container(
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
child: TypeWriterText(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TypeWriterText(
repeat: false,
text: Text(
"I'm a full-stack web and salesforce developer, schrum master, and solution architext.",
text: Text("Hello and Welcome.",
textAlign: TextAlign.left,
style: Theme.of(context).textTheme.titleMedium),
duration: const Duration(milliseconds: 50)),
),
],
))));
TypeWriterText(
repeat: false,
text: Text("My name is Chris McBrien. ",
textAlign: TextAlign.left,
style: Theme.of(context).textTheme.headlineLarge),
duration: const Duration(milliseconds: 100)),
TypeWriterText(
repeat: false,
text: Text("Builder of things. ",
textAlign: TextAlign.left,
style: Theme.of(context).textTheme.headlineLarge),
duration: const Duration(milliseconds: 50)),
Padding(
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
child: TypeWriterText.builder(
"I'm a full-stack web and salesforce developer, schrum master, and solution architext. I'm a full-stack web and salesforce developer, schrum master, and solution architext. I'm a full-stack web and salesforce developer, schrum master, and solution architext. I'm a full-stack web and salesforce developer, schrum master, and solution architext.",
repeat: false, builder: (context, value) {
return AutoSizeText(
value,
maxLines: 2,
minFontSize: 2.0,
textAlign: TextAlign.left,
style: const TextStyle(fontSize: 20.0),
);
}, duration: const Duration(milliseconds: 50)))
]))));
}
}
10 changes: 9 additions & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.11.0"
auto_size_text:
dependency: "direct main"
description:
name: auto_size_text
sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -174,7 +182,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.0.0"
version: "2.1.0"
vector_math:
dependency: transitive
description:
Expand Down
21 changes: 6 additions & 15 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
Expand All @@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=2.16.2 <4.0.0"
sdk: '>=2.16.2 <4.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand All @@ -27,48 +27,39 @@ environment:
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
auto_size_text: ^3.0.0
cupertino_icons: ^1.0.2
flutter:
sdk: flutter

typewritertext:
path: ../

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2

dev_dependencies:
flutter_test:
sdk: flutter

# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.0
flutter_test:
sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true

# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.

# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
Expand Down
Loading

0 comments on commit 2829e05

Please sign in to comment.