From 3b676f22957900278660d2a1362b543d624b4f31 Mon Sep 17 00:00:00 2001 From: lewiseman Date: Mon, 7 Jun 2021 13:41:57 +0300 Subject: [PATCH] Some Changes --- data/authors.json | 1 + data/quotes.json | 8 ++++ example/lib/main.dart | 55 +++++++++++---------- example/pubspec.lock | 108 +++++++++++++----------------------------- pubspec.lock | 104 ++++++++++++---------------------------- 5 files changed, 100 insertions(+), 176 deletions(-) diff --git a/data/authors.json b/data/authors.json index 5036533..0c37c7f 100644 --- a/data/authors.json +++ b/data/authors.json @@ -1,4 +1,5 @@ [ + { "_id": "EeygtUGWEY$c2!w", "name": "Kenyan proverb", "quoteCount": 1 }, { "_id": "Bklxbckhy5EL", "name": "A. A. Milne", "quoteCount": 1 }, { "_id": "URC23TSCF9mS", "name": "A. Powell Davies", "quoteCount": 1 }, { "_id": "1jVq35e_unPn", "name": "Abraham Lincoln", "quoteCount": 6 }, diff --git a/data/quotes.json b/data/quotes.json index 691df7f..fe118bb 100644 --- a/data/quotes.json +++ b/data/quotes.json @@ -7,6 +7,14 @@ "tags": ["success"], "length": 96 }, + { + "_id": "ii-Efyeae649B", + "content": "All monkeys cannot hang on the same branch", + "author": "Kenyan proverb", + "authorId": "EeygtUGWEY", + "tags": ["love"], + "length": 41 + }, { "_id": "nFnx44IV4kb", "content": "Life is just a chance to grow a soul.", diff --git a/example/lib/main.dart b/example/lib/main.dart index 95ef680..98f9e34 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:quotes/quotes.dart'; // Importing the quotes library +import 'package:quotes/quotes.dart'; // Importing the quotes library void main() => runApp(MyApp()); @@ -9,36 +9,35 @@ class MyApp extends StatelessWidget { return MaterialApp( home: Scaffold( body: Center( - child: FlatButton(child: Text("CLICK"),onPressed: (){ - - + child: TextButton( + child: Text("CLICK"), + onPressed: () { //Using Quotes Object to get a quote //Getting the First quote that is same everytime - print(Quotes.getFirst().getId()); - print(Quotes.getFirst().getContent()); - print(Quotes.getFirst().getAuthor()); - print(Quotes.getFirst().getAuthorId()); - print(Quotes.getFirst().getTags()); - print(Quotes.getFirst().getLength()); - - //Getting the Last quote that is same everytime - print(Quotes.getLast().getId()); - print(Quotes.getLast().getContent()); - print(Quotes.getLast().getAuthor()); - print(Quotes.getLast().getAuthorId()); - print(Quotes.getLast().getTags()); - print(Quotes.getLast().getLength()); - + print(Quotes.getFirst().getId()); + print(Quotes.getFirst().getContent()); + print(Quotes.getFirst().getAuthor()); + print(Quotes.getFirst().getAuthorId()); + print(Quotes.getFirst().getTags()); + print(Quotes.getFirst().getLength()); + + //Getting the Last quote that is same everytime + print(Quotes.getLast().getId()); + print(Quotes.getLast().getContent()); + print(Quotes.getLast().getAuthor()); + print(Quotes.getLast().getAuthorId()); + print(Quotes.getLast().getTags()); + print(Quotes.getLast().getLength()); + //Getting the random quote - print(Quotes.getRandom().getId()); - print(Quotes.getRandom().getContent()); - print(Quotes.getRandom().getAuthor()); - print(Quotes.getRandom().getAuthorId()); - print(Quotes.getRandom().getTags()); - print(Quotes.getRandom().getLength()); - - - },), + print(Quotes.getRandom().getId()); + print(Quotes.getRandom().getContent()); + print(Quotes.getRandom().getAuthor()); + print(Quotes.getRandom().getAuthorId()); + print(Quotes.getRandom().getTags()); + print(Quotes.getRandom().getLength()); + }, + ), ), ), ); diff --git a/example/pubspec.lock b/example/pubspec.lock index 8c0fd3f..d897ebd 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -1,62 +1,48 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.2" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.5.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" - charcode: + version: "2.1.0" + characters: dependency: transitive description: - name: charcode + name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" - collection: + version: "1.1.0" + charcode: dependency: transitive description: - name: collection + name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" - convert: + version: "1.2.0" + clock: dependency: transitive description: - name: convert + name: clock url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" - crypto: + version: "1.1.0" + collection: dependency: transitive description: - name: crypto + name: collection url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "1.15.0" cupertino_icons: dependency: "direct main" description: @@ -64,6 +50,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" flutter: dependency: "direct main" description: flutter @@ -74,55 +67,27 @@ packages: description: flutter source: sdk version: "0.0.0" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "1.3.0" path: dependency: transitive description: name: path 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: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" + version: "1.8.0" quotes: dependency: "direct dev" description: @@ -141,62 +106,55 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.8.0" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" + version: "0.2.19" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "3.5.0" + version: "2.1.0" sdks: - dart: ">=2.4.0 <3.0.0" + dart: ">=2.12.0-0.0 <3.0.0" diff --git a/pubspec.lock b/pubspec.lock index 67a7df1..19b13d0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,62 +1,55 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.2" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.5.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" - collection: + version: "1.2.0" + clock: dependency: transitive description: - name: collection + name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" - convert: + version: "1.1.0" + collection: dependency: transitive description: - name: convert + name: collection url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" - crypto: + version: "1.15.0" + fake_async: dependency: transitive description: - name: crypto + name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "1.2.0" flutter: dependency: "direct main" description: flutter @@ -67,55 +60,27 @@ packages: description: flutter source: sdk version: "0.0.0" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "1.3.0" path: dependency: transitive description: name: path 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: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" + version: "1.8.0" sky_engine: dependency: transitive description: flutter @@ -127,62 +92,55 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.8.0" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" + version: "0.2.19" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "3.5.0" + version: "2.1.0" sdks: - dart: ">=2.4.0 <3.0.0" + dart: ">=2.12.0-0.0 <3.0.0"