diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 87befec..9a2ab5a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,9 +6,13 @@ 2) Add app on-boarding 3) Improve UI 4) Add get-layout-code functionality ✔️ -5) Add Save code functionality +5) Add save code functionality 6) Add tests +## Longer term TODOs + +1) Optimise for Flutter Web + ### To add a new widget All widgets extend [ModelWidget](https://github.com/deven98/MetaFlutter/blob/master/lib/widget_builder_utilities/model_widget.dart). diff --git a/images/screenshot.png b/images/screenshot.png new file mode 100644 index 0000000..2bbe5f8 Binary files /dev/null and b/images/screenshot.png differ diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..e8efba1 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..399e934 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5ef11d2..6c9d2c9 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 11F77C15F2DCE9DBFED94600 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BFC5A2AECAA8F93DCD01B5D /* Pods_Runner.framework */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; @@ -40,8 +41,11 @@ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; + 3BFC5A2AECAA8F93DCD01B5D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 5198C52484DC836F6DF4CB49 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 74C0C7E8B8B53C0C40BAE53F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; 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 = ""; }; @@ -51,6 +55,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FC41D31C44106F13BC248581 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -60,12 +65,32 @@ files = ( 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, + 11F77C15F2DCE9DBFED94600 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 42D150899A6BF43AFA3AC8E2 /* Pods */ = { + isa = PBXGroup; + children = ( + FC41D31C44106F13BC248581 /* Pods-Runner.debug.xcconfig */, + 74C0C7E8B8B53C0C40BAE53F /* Pods-Runner.release.xcconfig */, + 5198C52484DC836F6DF4CB49 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 6FBDB4491766735D4942D335 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 3BFC5A2AECAA8F93DCD01B5D /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -85,6 +110,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 42D150899A6BF43AFA3AC8E2 /* Pods */, + 6FBDB4491766735D4942D335 /* Frameworks */, ); sourceTree = ""; }; @@ -126,12 +153,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 5426CF42CBDC5360612AC6A8 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 7CCD8F735B013D82452D2F23 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -205,6 +234,52 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; }; + 5426CF42CBDC5360612AC6A8 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 7CCD8F735B013D82452D2F23 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", + "${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + ); + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -508,7 +583,6 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ - }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/lib/pages/about_screen.dart b/lib/pages/about_screen.dart new file mode 100644 index 0000000..449c219 --- /dev/null +++ b/lib/pages/about_screen.dart @@ -0,0 +1,104 @@ +import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class AboutScreen extends StatefulWidget { + @override + _AboutScreenState createState() => _AboutScreenState(); +} + +class _AboutScreenState extends State { + List contributors = [ + "Deven Joshi (Creator and maintainer)", + "Tushar Parmar", + "sherlockbeard" + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text("About"), + ), + body: ListView( + children: [ + Image.asset('images/screenshot.png'), + Center( + child: Text( + "MetaFlutter", + style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w300), + ), + ), + SizedBox( + height: 8.0, + ), + Center( + child: Padding( + padding: const EdgeInsets.all(12.0), + child: FittedBox( + child: Text( + "Experiment with Flutter widgets on your phone!", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24.0), + ), + ), + ), + ), + Padding( + padding: const EdgeInsets.all(12.0), + child: Center( + child: Text( + '''MetaFlutter allows you to create Flutter layouts using a wide and constantly growing range of Flutter widgets. + \nBuild out an idea you had instantly, try out something you've never tried before or just use it as a tool for Flutter layout demonstrations. + \nNo login. Free to use. Open-source.'''), + ), + ), + Padding( + padding: const EdgeInsets.all(12.0), + child: Text( + "Authors", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0), + ), + ), + for (var contributor in contributors) + Padding( + padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0), + child: Text(contributor), + ), + Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Want to contribute?", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: InkWell( + child: Text( + "Click here", + style: TextStyle(color: Colors.blue), + ), + onTap: () { + _launchURL(); + }, + ), + ), + ], + ), + ), + ], + ), + ); + } + + _launchURL() async { + const url = 'https://github.com/deven98/MetaFlutter'; + if (await canLaunch(url)) { + await launch(url); + } else { + throw 'Could not launch $url'; + } + } + +} diff --git a/lib/pages/home_screen.dart b/lib/pages/home_screen.dart index aae2258..648d6e4 100644 --- a/lib/pages/home_screen.dart +++ b/lib/pages/home_screen.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_app_builder/pages/widget_structure_screen.dart'; +import 'about_screen.dart'; + /// First page to see after splash screen. /// Keep this page as entry for main program, saved templates, etc. class HomeScreen extends StatefulWidget { @@ -26,7 +28,7 @@ class _HomeScreenState extends State with TickerProviderStateMixin { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ _buildTitle(), - _buildButton(), + _buildButtons(), ], ), ), @@ -49,21 +51,52 @@ class _HomeScreenState extends State with TickerProviderStateMixin { ); } - Widget _buildButton() { - return FlatButton( - color: Colors.blue, - onPressed: () { - Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => WidgetStructureScreen())); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - "Start", - style: TextStyle( - color: Colors.white, - fontSize: 18.0 + Widget _buildButtons() { + return Container( + child: Column( + children: [ + SizedBox( + width: 120.0, + child: FlatButton( + color: Colors.blue, + onPressed: () { + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => WidgetStructureScreen())); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + "Start", + style: TextStyle(color: Colors.white, fontSize: 18.0), + ), + ), + ), ), - ), + SizedBox( + height: 8.0, + ), + SizedBox( + width: 120.0, + child: FlatButton( + color: Colors.blue, + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AboutScreen())); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + "About", + style: TextStyle(color: Colors.white, fontSize: 18.0), + ), + ), + ), + ), + ], ), ); } diff --git a/pubspec.lock b/pubspec.lock index 5f39cd2..b512c52 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -142,6 +142,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.5" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.2" vector_math: dependency: transitive description: @@ -151,4 +158,4 @@ packages: version: "2.0.8" sdks: dart: ">=2.2.2 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=0.5.6 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 5823634..95f89b8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,6 +18,7 @@ environment: dependencies: unicorndial: ^1.1.5 + url_launcher: ^5.0.2 flutter: sdk: flutter @@ -45,6 +46,7 @@ flutter: assets: - images/home_bg.png - images/app_logo.png + - images/screenshot.png # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware.