Skip to content

Commit

Permalink
chore: capitalize method for String (#4734)
Browse files Browse the repository at this point in the history
* chore: capitalize method for String

New file:
* `string_extension.dart`: extension for `String`

Impacted file:
* `user_preferences_languages_list.dart`: now using the new `String` extension instead of deprecated library

* Minor code change after review
  • Loading branch information
monsieurtanuki committed Oct 28, 2023
1 parent efb0483 commit 37ef119
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/smooth_app/lib/helpers/string_extension.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extension StringExtension on String {
String capitalize() => isEmpty ? this : this[0].toUpperCase() + substring(1);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_native_splash/cli_commands.dart';
import 'package:openfoodfacts/openfoodfacts.dart';
import 'package:smooth_app/helpers/string_extension.dart';

class Languages {
const Languages();
Expand Down

0 comments on commit 37ef119

Please sign in to comment.