diff --git a/README.md b/README.md index 9064fb6..890d488 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# note_app +# flutter_note_app A new Flutter project. diff --git a/android/app/build.gradle b/android/app/build.gradle index 980b965..3dddc46 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -38,7 +38,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.note_app" + applicationId "com.example.flutter_note_app" minSdkVersion 16 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 64bd8e4..37c29cb 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.example.flutter_note_app"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 40ea457..38bab4e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.example.flutter_note_app"> + package="com.example.flutter_note_app"> diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f8c2ccf..19f1719 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,12 +8,16 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 34ECC3202ABAA40F293E3ACA /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E57D6A83C2865DB601D4341 /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; + 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; + 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - EA72E40BEFE3395D9224EED6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43CFE2BDBAB4DDCC1B396BDA /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -23,6 +27,8 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, + 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,21 +38,23 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 14F853DDF9C4DC2CA4FD1979 /* 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 = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 43CFE2BDBAB4DDCC1B396BDA /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 61DA4A4605B8B6A045AB72FF /* 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 = ""; }; + 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; + 5D5C06A7001A0D599C579CF8 /* 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 = ""; }; + 5E57D6A83C2865DB601D4341 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 8A355A03F36988590D4D8B15 /* 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 = ""; }; 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 = ""; }; + 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; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 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 = ""; }; - A64C5C43C14B6E7D56E035C0 /* 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 = ""; }; - B73786CF2FCDB1C56CF57518 /* 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,17 +62,30 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - EA72E40BEFE3395D9224EED6 /* Pods_Runner.framework in Frameworks */, + 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, + 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, + 34ECC3202ABAA40F293E3ACA /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 534768DA63D5E0F4486F5E00 /* Frameworks */ = { + 1815C46ABA2813D00842C5B4 /* Pods */ = { isa = PBXGroup; children = ( - 43CFE2BDBAB4DDCC1B396BDA /* Pods_Runner.framework */, + 8A355A03F36988590D4D8B15 /* Pods-Runner.debug.xcconfig */, + 14F853DDF9C4DC2CA4FD1979 /* Pods-Runner.release.xcconfig */, + 5D5C06A7001A0D599C579CF8 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 1EB29F2C46201DC44C8B52C7 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 5E57D6A83C2865DB601D4341 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -72,7 +93,9 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEBA1CF902C7004384FC /* Flutter.framework */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, @@ -80,25 +103,14 @@ name = Flutter; sourceTree = ""; }; - 979D2BBE887EED0CACCDE25B /* Pods */ = { - isa = PBXGroup; - children = ( - 61DA4A4605B8B6A045AB72FF /* Pods-Runner.debug.xcconfig */, - B73786CF2FCDB1C56CF57518 /* Pods-Runner.release.xcconfig */, - A64C5C43C14B6E7D56E035C0 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 979D2BBE887EED0CACCDE25B /* Pods */, - 534768DA63D5E0F4486F5E00 /* Frameworks */, + 1815C46ABA2813D00842C5B4 /* Pods */, + 1EB29F2C46201DC44C8B52C7 /* Frameworks */, ); sourceTree = ""; }; @@ -140,14 +152,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - E4839DFCFEC519C16C693E4E /* [CP] Check Pods Manifest.lock */, + E85A9CB9F69C8467C9B1B5D2 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 266F2202F10FD80E0E51F763 /* [CP] Embed Pods Frameworks */, + CDD3DCF1957E3C3D5B4D45C4 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -206,50 +218,50 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 266F2202F10FD80E0E51F763 /* [CP] Embed Pods Frameworks */ = { + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "[CP] Embed Pods Frameworks"; + name = "Thin Binary"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Thin Binary"; + name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + CDD3DCF1957E3C3D5B4D45C4 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Run Script"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; - E4839DFCFEC519C16C693E4E /* [CP] Check Pods Manifest.lock */ = { + E85A9CB9F69C8467C9B1B5D2 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -374,7 +386,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.noteApp; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterNoteApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -508,7 +520,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.noteApp; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterNoteApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -535,7 +547,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.noteApp; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterNoteApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index d1f2573..967dad3 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -11,7 +11,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - note_app + flutter_note_app CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/pages/home.dart b/lib/pages/home.dart index cd5b4e1..3044325 100644 --- a/lib/pages/home.dart +++ b/lib/pages/home.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:note_app/pages/note_record_page.dart'; -import 'package:note_app/widgets/note_preview.dart'; +import 'package:flutter_note_app/pages/note_record_page.dart'; +import 'package:flutter_note_app/services/storage.dart'; +import 'package:flutter_note_app/widgets/note_preview.dart'; class Home extends StatefulWidget { @override @@ -8,8 +9,19 @@ class Home extends StatefulWidget { } class _HomeState extends State { + Storage _storage = Storage(); List _notes = []; + @override + void initState() { + super.initState(); + _storage.getnotes().then((noteList) { + setState(() { + _notes.addAll(noteList); + }); + }); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -19,27 +31,25 @@ class _HomeState extends State { ); } - AppBar _buildAppBar() { - return AppBar( - title: Text('Minhas notas'), - centerTitle: true, - ); - } - FloatingActionButton _buildAddNoteButton(BuildContext context) { return FloatingActionButton( onPressed: () async { - String note = await Navigator.push( - context, - MaterialPageRoute(builder: (BuildContext context) => NoteRecordPage()) - ); + String note = await Navigator.push(context, MaterialPageRoute(builder: (context) => NoteRecordPage())); if(note != null) { setState(() { _notes.add(note); }); + _storage.saveNotes(notes: _notes); } }, - child: Icon(Icons.add) + child: Icon(Icons.add), + ); + } + + AppBar _buildAppBar() { + return AppBar( + title: Text('Minhas notas'), + centerTitle: true, ); } @@ -52,22 +62,19 @@ class _HomeState extends State { itemBuilder: (BuildContext context, int index) { return GestureDetector( onTap: () async { - String note = await Navigator.push( - context, - MaterialPageRoute(builder: (context) => NoteRecordPage(noteText: _notes[index])) - ); + String note = await Navigator.push(context, MaterialPageRoute(builder: (context) => NoteRecordPage(noteText: _notes[index]))); + if(note != null) { setState(() { _notes[index] = note; }); + _storage.saveNotes(notes: _notes); } }, - child: NotePreview(noteText: _notes[index]) + child: NotePreview(noteText: _notes[index]), ); } ) : - Center(child: Text('Não existem notas cadastradas ainda.')); - + Center(child: Text('Não existem notas cadastradas ainda')); } - } \ No newline at end of file diff --git a/lib/pages/note_record_page.dart b/lib/pages/note_record_page.dart index 735940f..a73e2a4 100644 --- a/lib/pages/note_record_page.dart +++ b/lib/pages/note_record_page.dart @@ -5,7 +5,7 @@ class NoteRecordPage extends StatefulWidget { const NoteRecordPage({ Key key, - this.noteText, + this.noteText }) : super(key: key); @override @@ -21,20 +21,21 @@ class _NoteRecordPageState extends State { void initState() { super.initState(); _note = widget.noteText; - _noteController = TextEditingController(text: _note); + _noteController = TextEditingController(text: _note); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( + title: Text('Nota'), centerTitle: true, - backgroundColor: Color(0xFFf9f9f9), + backgroundColor: const Color(0xFFf9f9f9), elevation: 0, leading: IconButton( icon: Icon( Icons.arrow_back_ios, - color: const Color(0xFF4C54B9) + color: const Color(0xFF4C54B9), ), onPressed: () => Navigator.pop(context) ), @@ -45,7 +46,7 @@ class _NoteRecordPageState extends State { ) ], ), - body: _buildNoteInput() + body: _buildNoteInput(), ); } @@ -53,7 +54,7 @@ class _NoteRecordPageState extends State { return Form( key: _noteFormKey, child: ListView( - children: [ + children: [ TextFormField( controller: _noteController, validator: (nota) => nota == '' ? 'Insira algum valor para ser anotado' : null, @@ -63,11 +64,11 @@ class _NoteRecordPageState extends State { border: InputBorder.none, hintText: 'Nota', isDense: true, - contentPadding: EdgeInsets.all(10), + contentPadding: EdgeInsets.all(10.0), alignLabelWithHint: true ), - ), - ] + ) + ], ) ); } diff --git a/lib/services/storage.dart b/lib/services/storage.dart new file mode 100644 index 0000000..d774987 --- /dev/null +++ b/lib/services/storage.dart @@ -0,0 +1,15 @@ +import 'package:shared_preferences/shared_preferences.dart'; + +class Storage { + Future _prefs = SharedPreferences.getInstance(); + + Future> getnotes() async { + SharedPreferences prefs = await _prefs; + return (prefs.getStringList('notes') ?? []); + } + + void saveNotes({List notes}) async { + SharedPreferences prefs = await _prefs; + prefs.setStringList('notes', notes); + } +} \ No newline at end of file diff --git a/lib/widgets/note_preview.dart b/lib/widgets/note_preview.dart index 6c8e085..bbe37f4 100644 --- a/lib/widgets/note_preview.dart +++ b/lib/widgets/note_preview.dart @@ -5,20 +5,20 @@ class NotePreview extends StatelessWidget { const NotePreview({ Key key, - @required this.noteText + this.noteText }) : super(key: key); @override Widget build(BuildContext context) { Size _size = MediaQuery.of(context).size; - double _boxDimensions = _size.height > _size.width ? _size.width / 4 : _size.height / 4; + double _boxDimenssions = _size.height > _size.width ? _size.width / 4 : _size.height / 4; return Padding( padding: const EdgeInsets.all(16.0), child: Container( padding: const EdgeInsets.all(16.0), - height: _boxDimensions, - width: _boxDimensions, + height: _boxDimenssions, + width: _boxDimenssions, child: Text(noteText), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10.0)), diff --git a/pubspec.lock b/pubspec.lock index 555bb69..b048af2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,42 +7,42 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" + version: "2.0.11" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.6.0" + version: "1.5.2" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.1" + version: "2.4.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.0.5" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "1.1.2" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.12" + version: "1.14.11" convert: dependency: transitive description: @@ -56,7 +56,7 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.3" cupertino_icons: dependency: "direct main" description: @@ -85,7 +85,7 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "2.1.12" + version: "2.1.4" matcher: dependency: transitive description: @@ -107,6 +107,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.6.4" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0+1" petitparser: dependency: transitive description: @@ -120,7 +127,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.0.5" shared_preferences: dependency: "direct main" description: @@ -160,7 +167,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.5.5" stack_trace: dependency: transitive description: @@ -195,7 +202,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.15" + version: "0.2.11" typed_data: dependency: transitive description: @@ -216,7 +223,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.6.1" + version: "3.5.0" sdks: - dart: ">=2.6.0 <3.0.0" + dart: ">=2.4.0 <3.0.0" flutter: ">=1.12.13+hotfix.4 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index f88f7b1..26ef4e2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: note_app +name: flutter_note_app description: A new Flutter project. # The following defines the version and build number for your application. @@ -19,11 +19,11 @@ environment: dependencies: flutter: sdk: flutter - shared_preferences: ^0.5.6+3 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 + shared_preferences: ^0.5.6+3 dev_dependencies: flutter_test: diff --git a/test/widget_test.dart b/test/widget_test.dart index 1996f6e..3fb1188 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:note_app/main.dart'; +import 'package:flutter_note_app/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async {