Skip to content

Commit

Permalink
[이우섭] 0108 테스트코드 수정, dependencies 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeUSeob committed Jan 8, 2024
1 parent 7ffb78a commit c7eded9
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 47 deletions.
5 changes: 5 additions & 0 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rm -rf pubspec.lock ios/Podfile.lock
flutter clean
flutter pub get
cd ios
arch -x86_64 pod install
3 changes: 2 additions & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -222,6 +222,7 @@
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
73 changes: 29 additions & 44 deletions lib/test_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ class _TestWidgetState extends State<TestWidget> {
List<String> imageList = [];
String _currentText = "";

int _currentIndex = 0;
bool _isRunning = false;

bool _isInitialized = false;

final FFMpegManager _ffmpegManager = FFMpegManager();
Expand All @@ -50,53 +47,48 @@ class _TestWidgetState extends State<TestWidget> {
imageList = [];
});

final List<TextData> allTexts = ResourceManager.getInstance().getTextDataList(autoEditOnly: true, lineCount: 2);
final List<TextData> allTexts = ResourceManager.getInstance().getTextDataList(autoEditOnly: false, lineCount: 2);
allTexts.sort((a, b) {
final aValue = "${a.group}_${a.key}";
final bValue = "${b.group}_${b.key}";

return aValue.compareTo(bValue);
});

// final String currentText =
// allTexts[(_currentIndex) % allTexts.length];

// print('text is $currentText');
// print('_currentIndex is $_currentIndex');

// await _vmTextWidget.loadText(currentText);

// String? preview = _vmTextWidget.previewImagePath;
// setState(() {
// if (preview != null) imageList = [preview];
// });

// _currentIndex++;

List<Map> list = [];

Map excepts = {
Map filteredText = {
// "Title_ES005": true,
// "Title_ES006": true,
// "Title_ES007": true,
// "Title_JH014": true,
// "Title_JH015": true,
// "Title_JH016": true,
// "Title_SW042": true,
// "Title_SW043": true,
// "Title_SW044": true,
// "Title_SW045": true,
// "Title_YE001": true,
// "Title_YE002": true,
// "Title_YE003": true,
};

for (int i = 0; i < allTexts.length; i++) {
DateTime now = DateTime.now();

final TextData currentTextData = allTexts[i];
final String currentText = currentTextData.key;
if (excepts.containsKey(currentText)) continue;
// if (!filteredText.containsKey(currentText)) continue;

print('text is $currentText');
print('_currentIndex is $i / ${allTexts.length}');

// await _vmTextWidget.loadText(currentText, initTexts: ["첫번째줄 테스트", "두번째줄 테스트"]);
await _vmTextWidget.loadText(currentText, initTexts: ["THIS IS TITLE"], language: "en");
// await _vmTextWidget.loadText(currentText, initTexts: ["THIS IS TITLE"], language: "en");
// await _vmTextWidget.loadText(currentText, initTexts: ["パスワードを再確認してください。", "パスワードを再確認してください。"]);
// await _vmTextWidget.loadText(currentText, initTexts: ["Sẵn sàng tiệc chưa?", "Sẵn sàng tiệc chưa?"]);
// await _vmTextWidget.loadText(currentText, initTexts: ["วิดีโอที่คุณสร้างกำลังรอคุณอยู่", "วิดีโอที่คุณสร้างกำลังรอคุณอยู่"]);

// await _vmTextWidget.loadText(currentText, initTexts: ["THIS IS TITLE THIS IS TITLE THIS IS TITLE THIS IS TITLE", "THIS IS SUBTITLE THIS IS SUBTITLE THIS IS SUBTITLE THIS IS SUBTITLE"]);
// await _vmTextWidget.loadText(currentText, initTexts: ["THIS IS SUBTITLE THIS IS SUBTITLE THIS IS SUBTITLE THIS IS SUBTITLE"]);

await _vmTextWidget.loadText(currentText, initTexts: ["THIS IS TITLE", "THIS IS SUBTITLE"], language: "ko");
// await _vmTextWidget.loadText(currentText, initTexts: ["첫번째줄 테스트", "두번째줄 테스트"], language: "ko");
await _vmTextWidget.extractAllSequence((progress) => {});

final String appDirPath = await getAppDirectoryPath();
Expand All @@ -106,8 +98,8 @@ class _TestWidgetState extends State<TestWidget> {

String? preview = _vmTextWidget.previewImagePath;

int width = (_vmTextWidget.width).floor();
int height = (_vmTextWidget.height).floor();
int width = (_vmTextWidget.width / 2).floor();
int height = (_vmTextWidget.height / 2).floor();

width -= width % 2;
height -= height % 2;
Expand All @@ -119,18 +111,21 @@ class _TestWidgetState extends State<TestWidget> {
"${_vmTextWidget.allSequencesPath!}/%d.png",
"-vf",
"scale=$width:$height",

"-c:v",
"libvpx-vp9",
"-pix_fmt",
"yuva420p",
"$webmPath/${currentTextData.group}_$currentText.webm",

// "-c:v",
// "libx264",
// "-preset",
// "ultrafast",
// "-pix_fmt",
// "yuv420p",
// "$webmPath/${currentTextData.group}_$currentText.mp4",

"-y"
], (p0) => null);

Expand All @@ -140,11 +135,6 @@ class _TestWidgetState extends State<TestWidget> {
print(webmPath);
print(currentText);

// if (_vmTextWidget.elapsedTime >= 1000) {
// print("heavy!");
// print("");
// }

await Future.delayed(const Duration(milliseconds: 1000));

setState(() {
Expand All @@ -155,26 +145,21 @@ class _TestWidgetState extends State<TestWidget> {
print("");
}

print("");
print("done!");
} catch (e) {
print(e);
} finally {
// _isRunning = false;
}
}

List<Widget> RectangleBoxList(isPreview, index) {
VMTextWidget textWidget = _vmTextWidget;

List<Widget> rectangleBoxList(isPreview, index) {
List<Widget> list = [];

list.add(Container(
child: Image.file(
list.add(Image.file(
File(imageList[index]),
width: MediaQuery.of(this.context).size.width,
fit: BoxFit.fitWidth,
),
));
);

if (isPreview) {
final textList = _vmTextWidget.textDataMap.values.toList();
Expand Down Expand Up @@ -212,7 +197,7 @@ class _TestWidgetState extends State<TestWidget> {
itemBuilder: (BuildContext context, int index) {
bool isPreview = imageList.length == 1;
return Stack(
children: RectangleBoxList(isPreview, index),
children: rectangleBoxList(isPreview, index),
);
},
),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies:
google_mlkit_face_detection:
google_mlkit_image_labeling:
firebase_core:
flutter_inappwebview:
flutter_inappwebview: 5.8.0
uuid: ^3.0.6
http:
rxdart:
Expand Down

0 comments on commit c7eded9

Please sign in to comment.