-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into yeonjin_fix/#146
- Loading branch information
Showing
8 changed files
with
725 additions
and
20 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
lib/learn/custom_learn/create_sentence/presentation/widgets/check_badword.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/services.dart' show rootBundle; | ||
|
||
Future<String> getData() async { | ||
try { | ||
return await rootBundle.loadString('assets/fword_list.txt'); | ||
} catch (e) { | ||
throw (e.toString()); | ||
} | ||
} | ||
|
||
Future<bool> isBadWord(String str) async { | ||
var contents = ""; | ||
var badwords = List.empty(growable : true); | ||
|
||
contents = await getData(); | ||
|
||
final rows = await contents.split('\n'); | ||
|
||
for(var row in rows){ | ||
badwords.add(row); | ||
} | ||
|
||
for(int i = 0; i < badwords.length; i++){ | ||
if(str.contains(badwords[i])){ | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters