Skip to content

Commit

Permalink
fix: emojis now work!
Browse files Browse the repository at this point in the history
  • Loading branch information
IamMuuo committed Oct 19, 2024
1 parent f7e6d58 commit ba32d91
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
10 changes: 5 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ android {
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.dita.academia"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = flutter.minSdkVersion
minSdk = 34
targetSdk = 34
versionCode = 7
versionName = "Prisca"
versionCode = 9
versionName = "Jessica"
}
//
signingConfigs {
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
5 changes: 5 additions & 0 deletions lib/constants/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ extension StringExtension on String {
}
}

String utf8convert(String text) {
List<int> bytes = text.toString().codeUnits;
return utf8.decode(bytes);
}

String trimTo99Characters(String text) {
if (text.length <= 99) {
return text;
Expand Down
4 changes: 3 additions & 1 deletion lib/tools/chirp/widgets/comment_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ class _CommentWidgetState extends State<CommentWidget> {
),
const SizedBox(height: 4),
Text(
widget.comment.content,
utf8convert(
widget.comment.content,
),
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(height: 4),
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/chirp/widgets/post_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class _PostCardState extends State<PostCard> {
),
const SizedBox(height: 4),
Text(
trimTo99Characters(widget.post.content),
utf8convert(trimTo99Characters(widget.post.content)),
style: Theme.of(context).textTheme.bodyMedium,
),
],
Expand Down

0 comments on commit ba32d91

Please sign in to comment.