From ec156c11ff50b9794c0a4690ebbdffbe33b47c2b Mon Sep 17 00:00:00 2001 From: Hemanth Raj Date: Thu, 25 Apr 2019 11:34:56 +0530 Subject: [PATCH] example fixed --- CHANGELOG.md | 17 ++++++++----- example/ios/Runner.xcodeproj/project.pbxproj | 4 ---- .../xcshareddata/WorkspaceSettings.xcsettings | 8 +++++++ example/lib/main.dart | 12 ++++++---- example/test/widget_test.dart | 24 +------------------ lib/flutter_3d_obj.dart | 6 ++++- 6 files changed, 32 insertions(+), 39 deletions(-) create mode 100644 example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d4d7d..ea0dc63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,18 @@ -## [0.0.1] - TODO: Add release date. +## [0.0.6] - Fixed Example -* TODO: Describe initial release. +## [0.0.5] - Breaking Change -## [0.0.2] - Updated to provide zoom, angleX, angleY and angleZ args. +* changed the class name from `Object_3D` to `Object3D` + +## [0.0.4] - Dart 2 support ## [0.0.3] - Added Example -## [0.0.4] - Dart 2 support +## [0.0.2] - Updated to provide zoom, angleX, angleY and angleZ args. + +## [0.0.1] - TODO: Add release date. + +* Initial Relese + -## [0.0.5] - Breaking Change -* changed the class name from `Object_3D` to `Object3D` diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 4d608cd..0386930 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -15,7 +15,6 @@ 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; - 9740EEBB1CF902C7004384FC /* app.flx in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB71CF902C7004384FC /* app.flx */; }; 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; @@ -48,7 +47,6 @@ 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEB71CF902C7004384FC /* app.flx */ = {isa = PBXFileReference; lastKnownFileType = file; name = app.flx; path = Flutter/app.flx; sourceTree = ""; }; 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; @@ -74,7 +72,6 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( - 9740EEB71CF902C7004384FC /* app.flx */, 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEBA1CF902C7004384FC /* Flutter.framework */, @@ -187,7 +184,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9740EEBB1CF902C7004384FC /* app.flx in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, diff --git a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..949b678 --- /dev/null +++ b/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Original + + diff --git a/example/lib/main.dart b/example/lib/main.dart index 5aba4d5..06887c8 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -6,7 +6,6 @@ void main() { } class MyApp extends StatelessWidget { - @override Widget build(BuildContext context) { return new MaterialApp( @@ -15,11 +14,14 @@ class MyApp extends StatelessWidget { appBar: new AppBar( title: const Text("Flutter 3D"), ), - body:new Center( - child: new Object3D(size: const Size(400.0, 400.0),path: "assets/file.obj",asset:true), - ), + body: new Center( + child: new Object3D( + size: const Size(400.0, 400.0), + path: "assets/file.obj", + asset: true, + ), + ), ), ); } } - diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index 2c2b24a..0fe9fbd 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -4,26 +4,4 @@ // find child widgets in the widget tree, read text, and verify that the values of widget properties // are correct. -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import '../lib/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(new MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} +void main() {} diff --git a/lib/flutter_3d_obj.dart b/lib/flutter_3d_obj.dart index de9a032..5178195 100644 --- a/lib/flutter_3d_obj.dart +++ b/lib/flutter_3d_obj.dart @@ -35,7 +35,9 @@ class Object3D extends StatefulWidget { } class _Object3DState extends State { - _Object3DState() { + _Object3DState(); + + void initState() { if (widget.asset == true) { rootBundle.loadString(widget.path).then((String value) { setState(() { @@ -52,8 +54,10 @@ class _Object3DState extends State { } useInternal = !(widget.angleX != null || widget.angleY != null || widget.angleZ != null); + super.initState(); } + bool useInternal; double angleX = 15.0;