Skip to content

Commit

Permalink
Merge pull request #36 from rohanjsh/feat/breaking-2.0
Browse files Browse the repository at this point in the history
feat: v2.0 with upgraded core logic and features
  • Loading branch information
rohanjsh authored Dec 24, 2023
2 parents 70f16a0 + 93357e8 commit 3d723b5
Show file tree
Hide file tree
Showing 16 changed files with 1,225 additions and 285 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
flutter_channel: 'stable'
flutter_version: '3.13.2'
flutter_version: '3.16.4'
min_coverage: 80
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@

# Changelog

# 2.0.0
### New Features
- **Dynamic Font Sizing:** Font size can now be applied dynamically, enhancing visual hierarchy and readability.
- **Literal Character Rendering:** Introducing the literal symbol `¦` to unambiguously represent reserved characters in text formatting, ensuring clarity in rendered output.

### Bug Fixes
- **Spacing in Strings:** Corrected an issue where strings containing spaces were not formatted correctly, improving the robustness and reliability of the text display.

### Breaking Changes
- **Underline Style Update:** The syntax for underlining text has changed. The previous `//` markers are now replaced with `#`. This shift streamlines the styling process and aligns with common markdown practices.
- **Link Style Update:** The syntax for link text has changed. The previous `[]` markers are now replaced with `§`. A link text would look like this `§rohanjsh|https://rohanjsh.dev§`
- **Reserved Character Escaping:** Incorporating the new literal `¦` necessitates the explicit marking of reserved characters to be treated as literals. This modifies how users will work with text that includes characters previously used for formatting.

# 1.0.3
- chore: update dependencies

Expand Down Expand Up @@ -47,3 +60,7 @@ Thanks for choosing our text formatting widget for all your formatting needs. We
# 0.1.0+18

- feat: WhatsApp like formatting for you all!🎉


Thank you for being part of our journey. Your feedback is the beacon that guides our innovation.
*Please note that all changes included in beta releases are for testing purposes and may change before the final release.*
91 changes: 50 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,90 @@
# TypeSet
---

# TypeSet: Elegant Text Styling for Flutter
[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link]
[![pub package][pub_badge]][pub_link]
![pub points][pub_points_badge]

- Make text formatting backend driven (if needed) with one widget!!
- Whatsapp like formatting with some addons!!
(input looks something like this)
Enhance your Flutter app's text presentation with TypeSet, the all-in-one solution for text styling and formatting that's as dynamic as your app needs to be. Inspired by familiar markdown formatting, TypeSet allows you to seamlessly integrate rich text features, including variable font sizes and web links, without disrupting the underlying logic of your code. With backend-driven formatting capability, WhatsApp-like ease, and additional formatting options, TypeSet offers the fluidity to make any text come alive!

**Usage**
- BOLD → Hello, \*World!*
- ITALIC → Hello, \_World!_
- STRIKETHROUGH → Hello, \~World!~
- UNDERLINE → Hello, //World!//
- MONOSPACE → Hello, \`World!`
- LINK → [google.com|https://google.com]
## Preview of Possibilities

## See it in action!!
**https://zapp.run/pub/typeset**
<img width="346" alt="Screenshot 2023-03-18 at 10 25 42" src="https://github.com/rohanjsh/typeset/assets/35066779/34c49da7-4a47-41a2-8af1-0f9d5a093689">

### Preview
<img width="346" alt="Screenshot 2023-03-18 at 10 25 42" src="https://user-images.githubusercontent.com/35066779/226097689-46c42693-3ee7-4ecc-9f4c-ee2d8763d5f6.png">
Craft the perfect user experience with customizable text that embraces bold, italic, strikethrough, underline, monospace, hyperlinks, and dynamic font sizes – all at your fingertips.

## Getting Started 🚀

## Installation 💻
To unleash the power of TypeSet in your Flutter application, ensure you have the Flutter SDK installed and up to date.

**❗ In order to start using typeset you must have the [Flutter SDK][flutter_install_link] installed on your machine.**
### Installation

Add `typeset` to your `pubspec.yaml`:
In your `pubspec.yaml`, under dependencies, add the following line:

```yaml
dependencies:
typeset: #latest
typeset: ^latest_version
```

Install it:
Run the following command to install the package:

```sh
```shell
flutter packages get
```

---

### Usage 🌟

🌟 Usage 🌟
Utilize the TypeSet widget as easily as you would use the native `Text.rich()` in Flutter:

```dart
import 'package:typeset/typeset.dart';
TypeSet(inputText: 'Hello, *World!*');
// returns 'World' with bold text
// Bold Text Example
TypeSet(inputText: 'Hello, *World!*'); // Renders 'World!' in bold
TypeSet(inputText: 'Hello, _World!_');
// returns 'World' with italic text
// Italic Text Example
TypeSet(inputText: 'Hello, _World!_'); // Renders 'World!' in italic
TypeSet(inputText: 'Hello, ~World!~');
// returns 'World' with strikethrough text
// Strikethrough Text Example
TypeSet(inputText: 'Hello, ~World!~'); // Renders 'World!' with a strikethrough
TypeSet(inputText: 'Hello //World!//');
// returns 'World' with underline text
// Underline Text Example
TypeSet(inputText: 'Hello #World!#'); // Renders 'World!' underlined
TypeSet(inputText: 'Hello, `World!`');
// returns 'World' with monospace text
// Monospace Text Example
TypeSet(inputText: 'Hello, `World!`'); // Renders 'World!' in monospace

TypeSet(inputText: '[google.com|https://google.com]');
// returns 'google.com' with link to google.com
// Hyperlink Text Example
TypeSet(inputText: '§google.com|https://google.com§'); // Renders 'google.com' as a clickable link

///TypeSet also has every property which the Text.rich() has, so you can configure accordingly
// Dynamic Font Size Example
TypeSet(inputText: 'Hey, *Hello world<30>*'); // Renders 'Hello world' with font size 30
```
TypeSet inherits all properties of the `Text.rich()` widget, allowing for a familiar and versatile configuration experience.

### Use **`¦` (broken bar)** and append with any reserved character to render them.
Example:
```dart
Typeset(inputText: '*Hello ¦* World*');
```
## Features 🎨

- **Backend-driven formatting**: Keep your text styling logic server-side for easy updates without the need to redeploy your app.
- **Rich markdown-like formatting**: Easily implement bold, italic, strikethrough, underline, monospace, and hyperlinked text.
- **Dynamic font resizing**: Adjust text sizes on the fly for emphasis or accessibility.
- **Extensible**: Designed with openness for adding more styling options in future updates.

## We Value Your Feedback 📬

## Features and bugs
Have ideas for more features? Found a bug? Feel free to [open an issue][tracker] on our issue tracker. Your contributions make TypeSet better for everyone.

## Keep Your App's Text Styling Dynamic and Engaging with TypeSet!

---

Remember to include accurate links where necessary, like a link to the image of the demo snapshot, and the issue tracker. Also, replace the placeholder `^latest_version` with the actual latest version number of your package.

Please file feature requests and bugs at the [issue tracker][tracker].

[flutter_install_link]: https://docs.flutter.dev/get-started/install
[github_actions_link]: https://docs.github.com/en/actions/learn-github-actions
Expand All @@ -94,5 +105,3 @@ Please file feature requests and bugs at the [issue tracker][tracker].
[coverage_badge]: /coverage_badge.svg
[build_badge]: https://img.shields.io/github/workflow/status/rohanjsh/typeset/ci.svg
[pub_points_badge]: https://img.shields.io/pub/points/typeset


4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
129 changes: 86 additions & 43 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:typeset/typeset.dart';

Expand Down Expand Up @@ -28,101 +27,145 @@ class TypeSetExample extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('TypeSet example'),
title: const Text('TypeSet Demo'),
),
body: Center(
child: ListView(
children: [
children: const [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 22.0,
vertical: 22,
padding: EdgeInsets.symmetric(
horizontal: 22,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
Divider(),
Text(
'Usage',
style: TextStyle(
fontSize: 20,
),
),
Divider(),
SizedBox(
height: 12,
),
Text(
'''
Make text formatting backend driven (if needed) with one widget!!
Bold
→ Hello, *World!*
Italic
→ Hello, _World!_
Whatsapp like formatting with some addons!!
(input looks like this)
Strikethrough
→ Hello, ~World!~
→ Hello, *World!* <Bold>
→ Hello, _World!_ <Italic>
→ Hello, ~World!~ <Strikethrough>
→ Hello, //World!// <Underline>
→ Hello, `World!` <Monospace>
→ [google.com|https://google.com] <Link>
Underline
→ Hello, #World!#
Monospace
→ Hello, `World!`
Link
→ §google.com|https://google.com§
''',
style: TextStyle(
fontSize: 18,
),
),
const SizedBox(
height: 20,

Divider(),
Text(
'Samples',
style: TextStyle(
fontSize: 20,
),
),
Divider(),

SizedBox(
height: 12,
),
const TypeSet(
inputText: 'bold:\n→ *Bold* *Text*',
TypeSet(
inputText:
'→ *TypeSet* _can_ #style# ~everything~ `you need` §with|https://rohanjsh.dev/§ _dynamic<18>_ _font<28>_ _size<25>_',
style: TextStyle(
fontSize: 18,
),
),
SizedBox(
height: 24,
),
Divider(),
Text(
'Supported Stylings',
style: TextStyle(
fontSize: 20,
),
),
Divider(),

SizedBox(
height: 12,
),
TypeSet(
inputText: 'Bold:\n→ *Bold Text*',
style: TextStyle(
fontSize: 24,
),
),
const SizedBox(
SizedBox(
height: 20,
),
const TypeSet(
inputText: 'italic:\n_Italic_ _Text_',
TypeSet(
inputText: 'Italic:\n_Italic Text_ ',
style: TextStyle(
fontSize: 24,
),
),
const SizedBox(
SizedBox(
height: 20,
),
const TypeSet(
inputText: 'underline:\n//Underline// //Text//',
TypeSet(
inputText: 'Underline:\n#Underline Text#',
style: TextStyle(
fontSize: 24,
),
),
const SizedBox(
SizedBox(
height: 20,
),
const TypeSet(
inputText: 'strikethrough:\n→ ~Strikethrough~ ~Text~',
TypeSet(
inputText: 'Strikethrough:\n→ ~Strikethrough Text~',
style: TextStyle(
fontSize: 24,
),
),
const SizedBox(
SizedBox(
height: 20,
),
const TypeSet(
inputText: 'monospace:\n→ `monospace` `text`',
TypeSet(
inputText: 'Monospace:\n→ `monospace text`',
style: TextStyle(
fontSize: 24,
),
),
const SizedBox(
SizedBox(
height: 20,
),

//customized link textstyle and recognizer (tap recognizer)
TypeSet(
inputText: 'link:\n[google.com|https://google.com]',
style: const TextStyle(
inputText: 'Link:\n§google.com|https://google.com§',
style: TextStyle(
fontSize: 24,
),
linkStyle: const TextStyle(
color: Colors.red,
decoration: TextDecoration.underline,
),
recognizer: TapGestureRecognizer()
..onTap = () => debugPrint(
'link tapped',
),
),
SizedBox(
height: 20,
),
Divider(),
],
),
)
Expand Down
Loading

0 comments on commit 3d723b5

Please sign in to comment.