├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── web_hi_res_512.png │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launch_image.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launch_image.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launch_image.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launch_image.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launch_image.png │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── cognita │ │ │ │ │ └── MainActivity.java │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── build.gradle ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── AppDelegate.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── main.m │ ├── AppDelegate.m │ ├── Info.plist │ └── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ ├── xcshareddata │ └── xcschemes │ │ └── Runner.xcscheme │ └── project.pbxproj ├── cognita_icon.png ├── fonts ├── RobotoMono-Bold.ttf ├── RobotoMono-Light.ttf ├── RobotoMono-Thin.ttf ├── RobotoMono-Italic.ttf ├── RobotoMono-Medium.ttf ├── RobotoMono-Regular.ttf ├── RobotoMono-BoldItalic.ttf ├── RobotoMono-ThinItalic.ttf ├── RobotoMono-LightItalic.ttf ├── RobotoMono-MediumItalic.ttf └── LICENSE.txt ├── lib ├── repository │ ├── deck_repository.dart │ └── flashcard_repository.dart ├── i18n.dart ├── model │ ├── deck.dart │ └── flashcard.dart ├── sqlite_repository │ ├── deck_sqlite_repository.dart │ └── flashcard_sqlite_repository.dart ├── main.dart ├── bloc │ ├── edit_deck_bloc.dart │ ├── leitner_system_bloc.dart │ └── home_bloc.dart └── ui │ ├── edit_flashcard_page.dart │ ├── leitner_system_page.dart │ ├── create_deck_page.dart │ ├── home_page.dart │ └── edit_deck_page.dart ├── .metadata ├── README.md ├── test ├── widget_test.dart └── bloc │ └── leitner_system_bloc_test.dart ├── .gitignore ├── pubspec.yaml └── pubspec.lock /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /cognita_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/cognita_icon.png -------------------------------------------------------------------------------- /fonts/RobotoMono-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/fonts/RobotoMono-Bold.ttf -------------------------------------------------------------------------------- /fonts/RobotoMono-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/fonts/RobotoMono-Light.ttf -------------------------------------------------------------------------------- /fonts/RobotoMono-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/fonts/RobotoMono-Thin.ttf -------------------------------------------------------------------------------- /fonts/RobotoMono-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/fonts/RobotoMono-Italic.ttf -------------------------------------------------------------------------------- /fonts/RobotoMono-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/fonts/RobotoMono-Medium.ttf -------------------------------------------------------------------------------- /fonts/RobotoMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/fonts/RobotoMono-Regular.ttf -------------------------------------------------------------------------------- /fonts/RobotoMono-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/fonts/RobotoMono-BoldItalic.ttf -------------------------------------------------------------------------------- /fonts/RobotoMono-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/fonts/RobotoMono-ThinItalic.ttf -------------------------------------------------------------------------------- /fonts/RobotoMono-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/fonts/RobotoMono-LightItalic.ttf -------------------------------------------------------------------------------- /fonts/RobotoMono-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/fonts/RobotoMono-MediumItalic.ttf -------------------------------------------------------------------------------- /android/app/src/main/web_hi_res_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/web_hi_res_512.png -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/launch_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/res/mipmap-hdpi/launch_image.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/launch_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/res/mipmap-mdpi/launch_image.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launch_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/res/mipmap-xhdpi/launch_image.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/launch_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/res/mipmap-xxhdpi/launch_image.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/launch_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/android/app/src/main/res/mipmap-xxxhdpi/launch_image.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feroldi/cognita/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/repository/deck_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import '../model/deck.dart'; 4 | 5 | abstract class DeckRepository { 6 | Future load(int id); 7 | Future> loadAll(); 8 | Future store(Deck deck); 9 | Future remove(int id); 10 | } 11 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /lib/i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:intl/intl.dart'; 2 | 3 | String provideDeckTitleMessage() => Intl.message( 4 | "Escolha o título da coleção", 5 | name: "provideDeckTitleMessage", 6 | args: [], 7 | desc: "Asks the user to type a short message that will be used for a new deck's title."); 8 | 9 | 10 | -------------------------------------------------------------------------------- /lib/repository/flashcard_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import '../model/flashcard.dart'; 4 | 5 | abstract class FlashcardRepository { 6 | Future load(int id); 7 | Future> loadAllByDeckId(int deckId); 8 | Future store(Flashcard flashcard); 9 | Future remove(int id); 10 | } 11 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /android/app/src/main/java/com/example/cognita/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.cognita; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | #673AB7 9 | 10 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /lib/model/deck.dart: -------------------------------------------------------------------------------- 1 | class Deck { 2 | int id; 3 | String title; 4 | int maxGroup; 5 | 6 | Deck(this.id, this.title, this.maxGroup); 7 | 8 | Deck copyWith({int id, String title, int maxGroup}) => Deck( 9 | id ?? this.id, 10 | title ?? this.title, 11 | maxGroup ?? this.maxGroup, 12 | ); 13 | 14 | factory Deck.fromMap(Map map) => Deck( 15 | map['id'], 16 | map['title'], 17 | map['sessions'], 18 | ); 19 | 20 | Map toMap() { 21 | final map = { 22 | 'title': title, 23 | 'sessions': maxGroup, 24 | }; 25 | if (id != null) { 26 | map['id'] = id; 27 | } 28 | return map; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cognita 2 | 3 | Cognita is a flashcard system Flutter application. 4 | It implements the [Leitner system][1] for the training sessions, allowing the user to choose how many sessions a deck should go through. 5 | This is a university mobile development class' homework, so expect to see suboptimal code. 6 | 7 | The application data are persisted using an embedded SQLite database. 8 | 9 | ## Building 10 | 11 | Clone the repository and run it with Flutter: 12 | 13 | git clone https://github.com/feroldi/cognita.git 14 | cd cognita 15 | flutter run 16 | 17 | ## Testing 18 | 19 | Unfortunately, there aren't any tests written for Cognita. 20 | Feel free to submit a PR if you wish to contribute in any way. 21 | 22 | [1]: https://en.wikipedia.org/wiki/Leitner_system 23 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/model/flashcard.dart: -------------------------------------------------------------------------------- 1 | class Flashcard { 2 | int id; 3 | int deckId; 4 | int group; 5 | String question; 6 | String answer; 7 | 8 | Flashcard( 9 | this.id, 10 | this.deckId, 11 | this.group, 12 | this.question, 13 | this.answer, 14 | ); 15 | 16 | Flashcard copyWith({ 17 | int id, 18 | int deckId, 19 | int group, 20 | String question, 21 | String answer, 22 | }) => 23 | Flashcard( 24 | id ?? this.id, 25 | deckId ?? this.deckId, 26 | group ?? this.group, 27 | question ?? this.question, 28 | answer ?? this.answer, 29 | ); 30 | 31 | factory Flashcard.fromMap(Map map) => Flashcard( 32 | map['id'], 33 | map['deck_id'], 34 | map['box'], 35 | map['question'], 36 | map['answer'], 37 | ); 38 | 39 | Map toMap() { 40 | final map = { 41 | 'deck_id': deckId, 42 | 'box': group, 43 | 'question': question, 44 | 'answer': answer, 45 | }; 46 | if (id != null) { 47 | map['id'] = id; 48 | } 49 | return map; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:cognita2/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | cognita 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/sqlite_repository/deck_sqlite_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:sqflite/sqflite.dart'; 4 | 5 | import '../model/deck.dart'; 6 | import '../repository/deck_repository.dart'; 7 | 8 | class DeckSqliteRepository implements DeckRepository { 9 | final Database database; 10 | 11 | DeckSqliteRepository(this.database); 12 | 13 | Future load(int id) async { 14 | final result = await database.query( 15 | 'decks', 16 | where: 'id = ?', 17 | whereArgs: [id], 18 | ); 19 | if (result.isNotEmpty) { 20 | return Deck.fromMap(result.first); 21 | } 22 | return null; 23 | } 24 | 25 | Future> loadAll() async { 26 | final results = await database.query('decks'); 27 | return results.map((value) => Deck.fromMap(value)).toList(); 28 | } 29 | 30 | Future store(Deck deck) async { 31 | if (deck.id != null) { 32 | await database.transaction((tx) async { 33 | final result = await tx.query( 34 | 'decks', 35 | where: 'id = ?', 36 | whereArgs: [deck.id], 37 | ); 38 | if (result.isNotEmpty) { 39 | await tx.update( 40 | 'decks', 41 | deck.toMap(), 42 | where: 'id = ?', 43 | whereArgs: [deck.id], 44 | ); 45 | } else { 46 | await tx.insert('decks', deck.toMap()); 47 | } 48 | }); 49 | return deck.copyWith(); 50 | } else { 51 | final deckId = await database.insert('decks', deck.toMap()); 52 | return deck.copyWith(id: deckId); 53 | } 54 | } 55 | 56 | Future remove(int id) async { 57 | await database.delete( 58 | 'decks', 59 | where: 'id = ?', 60 | whereArgs: [id], 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 12 | 16 | 23 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /lib/sqlite_repository/flashcard_sqlite_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:sqflite/sqflite.dart'; 4 | 5 | import '../model/flashcard.dart'; 6 | import '../repository/flashcard_repository.dart'; 7 | 8 | class FlashcardSqliteRepository implements FlashcardRepository { 9 | final Database database; 10 | 11 | FlashcardSqliteRepository(this.database); 12 | 13 | Future load(int id) async { 14 | final result = await database.query( 15 | 'flashcards', 16 | where: 'id = ?', 17 | whereArgs: [id], 18 | ); 19 | if (result.isNotEmpty) { 20 | return Flashcard.fromMap(result.first); 21 | } 22 | return null; 23 | } 24 | 25 | Future> loadAllByDeckId(int deckId) async { 26 | final results = await database.query( 27 | 'flashcards', 28 | where: 'deck_id = ?', 29 | whereArgs: [deckId], 30 | ); 31 | return results.map((value) => Flashcard.fromMap(value)).toList(); 32 | } 33 | 34 | Future store(Flashcard flashcard) async { 35 | if (flashcard.id != null) { 36 | await database.transaction((tx) async { 37 | final result = await tx.query( 38 | 'flashcards', 39 | where: 'id = ?', 40 | whereArgs: [flashcard.id], 41 | ); 42 | if (result.isNotEmpty) { 43 | await tx.update( 44 | 'flashcards', 45 | flashcard.toMap(), 46 | where: 'id = ?', 47 | whereArgs: [flashcard.id], 48 | ); 49 | } else { 50 | await tx.insert('flashcards', flashcard.toMap()); 51 | } 52 | return flashcard.copyWith(); 53 | }); 54 | } else { 55 | final flashcardId = await database.insert('flashcards', flashcard.toMap()); 56 | return flashcard.copyWith(id: flashcardId); 57 | } 58 | } 59 | 60 | Future remove(int id) async { 61 | await database.delete( 62 | 'flashcards', 63 | where: 'id = ?', 64 | whereArgs: [id], 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /test/bloc/leitner_system_bloc_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:cognita2/bloc/leitner_system_bloc.dart'; 4 | import 'package:cognita2/model/deck.dart'; 5 | import 'package:cognita2/model/flashcard.dart'; 6 | import 'package:cognita2/repository/flashcard_repository.dart'; 7 | import 'package:test/test.dart'; 8 | 9 | void main() { 10 | test('A, B and C should go to the middle group', () { 11 | final flashcards = [ 12 | Flashcard(0, 0, 'A', '1'), 13 | Flashcard(1, 0, 'B', '2'), 14 | Flashcard(2, 0, 'C', '3'), 15 | Flashcard(3, 1, 'D', '4'), 16 | Flashcard(4, 1, 'E', '5'), 17 | Flashcard(5, 1, 'F', '6'), 18 | Flashcard(6, 2, 'G', '7'), 19 | Flashcard(7, 2, 'H', '8'), 20 | Flashcard(8, 2, 'I', '9'), 21 | ]; 22 | final flashcardRepository = MockFlashcardRepository(flashcards); 23 | final deck = Deck(0, 'Test', List.generate(9, (i) => i), 3); 24 | final bloc = LeitnerSystemBloc(deck, flashcardRepository); 25 | 26 | expect(bloc.currentState.currentFlashcard, null); 27 | 28 | bloc.dispatch(StartLearningLSEvent()); 29 | bloc.dispatch(ClassifyFlashcardLSEvent(Classification.easy)); 30 | bloc.dispatch(ClassifyFlashcardLSEvent(Classification.easy)); 31 | bloc.dispatch(ClassifyFlashcardLSEvent(Classification.easy)); 32 | 33 | expect(bloc.state, emitsInOrder([ 34 | LSState(null), 35 | LSState(flashcards[0]), 36 | LSState(flashcards[1]), 37 | LSState(flashcards[2]), 38 | ])); 39 | }); 40 | } 41 | 42 | class MockFlashcardRepository implements FlashcardRepository { 43 | List _data; 44 | 45 | MockFlashcardRepository(this._data); 46 | 47 | Future load(int id) { 48 | return Future.value(_data.firstWhere((f) => f.id == id)); 49 | } 50 | 51 | Future store(Flashcard flashcard) { 52 | final idx = _data.indexWhere((f) => f.id == flashcard.id); 53 | if (idx != -1) { 54 | _data[idx] = flashcard; 55 | } else { 56 | _data.add(flashcard); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.cognita" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc/bloc.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:sqflite/sqflite.dart'; 4 | 5 | import 'model/deck.dart'; 6 | import 'model/flashcard.dart'; 7 | import 'repository/deck_repository.dart'; 8 | import 'repository/flashcard_repository.dart'; 9 | import 'sqlite_repository/deck_sqlite_repository.dart'; 10 | import 'sqlite_repository/flashcard_sqlite_repository.dart'; 11 | import 'ui/home_page.dart'; 12 | 13 | class PrinterBlocDelegate extends BlocDelegate { 14 | @override 15 | void onError(Bloc bloc, Object error, StackTrace st) { 16 | super.onError(bloc, error, st); 17 | print('$error, $st'); 18 | } 19 | } 20 | 21 | void main() async { 22 | BlocSupervisor().delegate = PrinterBlocDelegate(); 23 | 24 | final databasesPath = await getDatabasesPath(); 25 | String path = '${databasesPath}_cognita.db'; 26 | 27 | final database = await openDatabase(path, version: 3, 28 | onCreate: (Database db, int version) async { 29 | await db.execute('CREATE TABLE IF NOT EXISTS decks (' 30 | 'id INTEGER PRIMARY KEY,' 31 | 'title TEXT,' 32 | 'sessions INTEGER' 33 | ')'); 34 | await db.execute('CREATE TABLE IF NOT EXISTS flashcards (' 35 | 'id INTEGER PRIMARY KEY,' 36 | 'box INTEGER,' 37 | 'question TEXT,' 38 | 'answer TEXT,' 39 | 'deck_id INTEGER,' 40 | 'FOREIGN KEY(deck_id) REFERENCES decks(id)' 41 | ')'); 42 | }); 43 | 44 | final deckRepository = DeckSqliteRepository(database); 45 | final flashcardRepository = FlashcardSqliteRepository(database); 46 | 47 | runApp(CognitaApp( 48 | deckRepository, 49 | flashcardRepository, 50 | )); 51 | } 52 | 53 | class CognitaApp extends StatelessWidget { 54 | final DeckRepository deckRepository; 55 | final FlashcardRepository flashcardRepository; 56 | 57 | CognitaApp(this.deckRepository, this.flashcardRepository); 58 | 59 | @override 60 | Widget build(BuildContext context) { 61 | final app = MaterialApp( 62 | title: 'Cognita', 63 | theme: ThemeData( 64 | primarySwatch: Colors.deepPurple, 65 | ), 66 | home: HomePage(deckRepository, flashcardRepository), 67 | ); 68 | 69 | return app; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/bloc/edit_deck_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc/bloc.dart'; 2 | 3 | import '../model/deck.dart'; 4 | import '../model/flashcard.dart'; 5 | import '../repository/flashcard_repository.dart'; 6 | 7 | class EditDeckBloc extends Bloc { 8 | final Deck deck; 9 | final FlashcardRepository flashcardRepository; 10 | 11 | EditDeckBloc(this.deck, this.flashcardRepository); 12 | 13 | @override 14 | EDState get initialState => EDStateLoading(); 15 | 16 | @override 17 | Stream mapEventToState(EDEvent event) async* { 18 | if (event is EDEventLoadFlashcards) { 19 | final flashcards = await flashcardRepository.loadAllByDeckId(deck.id); 20 | yield EDStateFlashcards(flashcards); 21 | } 22 | 23 | if (event is EDEventCreateFlashcard) { 24 | await flashcardRepository.store(Flashcard( 25 | null, 26 | deck.id, 27 | 0, 28 | event.question, 29 | event.answer, 30 | )); 31 | dispatch(EDEventLoadFlashcards()); 32 | } 33 | 34 | if (event is EDEventEditFlashcard) { 35 | assert(event.flashcard.deckId == deck.id); 36 | await flashcardRepository.store(event.flashcard); 37 | dispatch(EDEventLoadFlashcards()); 38 | } 39 | 40 | if (event is EDEventResetFlashcardsGroup && 41 | currentState is EDStateFlashcards) { 42 | final flashcards = 43 | List.from((currentState as EDStateFlashcards).flashcards); 44 | for (final flashcard in flashcards) { 45 | flashcard.group = 0; 46 | await flashcardRepository.store(flashcard); 47 | } 48 | yield EDStateFlashcards(flashcards); 49 | } 50 | } 51 | } 52 | 53 | abstract class EDEvent {} 54 | 55 | class EDEventLoadFlashcards implements EDEvent {} 56 | 57 | class EDEventCreateFlashcard implements EDEvent { 58 | String question; 59 | String answer; 60 | EDEventCreateFlashcard(this.question, this.answer); 61 | } 62 | 63 | class EDEventEditFlashcard implements EDEvent { 64 | final Flashcard flashcard; 65 | EDEventEditFlashcard(this.flashcard); 66 | } 67 | 68 | class EDEventResetFlashcardsGroup implements EDEvent {} 69 | 70 | abstract class EDState {} 71 | 72 | class EDStateLoading implements EDState {} 73 | 74 | class EDStateFlashcards implements EDState { 75 | final List flashcards; 76 | EDStateFlashcards(this.flashcards); 77 | } 78 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cognita 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | cupertino_icons: ^0.1.2 23 | bloc: ^0.13.0 24 | flutter_bloc: ^0.13.0 25 | sqflite: ^1.1.5 26 | path_provider: ^1.1.0 27 | intl: ^0.15.8 28 | flutter_markdown: ^0.2.0 29 | simple_permissions: ^0.1.9 30 | #file_picker: ^1.3.4+1 31 | 32 | 33 | dev_dependencies: 34 | intl_translation: ^0.17.4 35 | test: ^1.6.1 36 | flutter_test: 37 | sdk: flutter 38 | 39 | 40 | # For information on the generic Dart part of this file, see the 41 | # following page: https://www.dartlang.org/tools/pub/pubspec 42 | 43 | # The following section is specific to Flutter. 44 | flutter: 45 | 46 | # The following line ensures that the Material Icons font is 47 | # included with your application, so that you can use the icons in 48 | # the material Icons class. 49 | uses-material-design: true 50 | 51 | # To add assets to your application, add an assets section, like this: 52 | # assets: 53 | # - images/a_dot_burr.jpeg 54 | # - images/a_dot_ham.jpeg 55 | 56 | # An image asset can refer to one or more resolution-specific "variants", see 57 | # https://flutter.dev/assets-and-images/#resolution-aware. 58 | 59 | # For details regarding adding assets from package dependencies, see 60 | # https://flutter.dev/assets-and-images/#from-packages 61 | 62 | # To add custom fonts to your application, add a fonts section here, 63 | # in this "flutter" section. Each entry in this list should have a 64 | # "family" key with the font family name, and a "fonts" key with a 65 | # list giving the asset and other descriptors for the font. For 66 | # example: 67 | fonts: 68 | - family: RobotoMono 69 | fonts: 70 | - asset: fonts/RobotoMono-Regular.ttf 71 | # For details regarding fonts from package dependencies, 72 | # see https://flutter.dev/custom-fonts/#from-packages 73 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/ui/edit_flashcard_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | typedef FlashcardCallback = void Function(String question, String answer); 4 | 5 | class EditFlashcardPage extends StatefulWidget { 6 | final String question; 7 | final String answer; 8 | final bool isEditing; 9 | final FlashcardCallback onSaveAction; 10 | 11 | EditFlashcardPage( 12 | this.question, 13 | this.answer, { 14 | this.isEditing = true, 15 | this.onSaveAction, 16 | }); 17 | 18 | @override 19 | _EditFlashcardPageState createState() => _EditFlashcardPageState(); 20 | } 21 | 22 | class _EditFlashcardPageState extends State { 23 | final questionTextCtrl = TextEditingController(); 24 | final answerTextCtrl = TextEditingController(); 25 | final _formValidator = GlobalKey(); 26 | 27 | bool get isEditing => widget.isEditing; 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | final questionTextField = TextFormField( 32 | controller: questionTextCtrl, 33 | validator: (text) => text.trim().isEmpty ? '' : null, 34 | maxLines: 8, 35 | decoration: InputDecoration( 36 | labelText: 'Question', 37 | ), 38 | textCapitalization: TextCapitalization.sentences, 39 | maxLength: 256, 40 | ); 41 | 42 | final answerTextField = TextFormField( 43 | controller: answerTextCtrl, 44 | validator: (text) => text.trim().isEmpty ? '' : null, 45 | maxLines: 8, 46 | decoration: InputDecoration( 47 | labelText: 'Answer', 48 | ), 49 | textCapitalization: TextCapitalization.sentences, 50 | maxLength: 256, 51 | ); 52 | 53 | final textFields = Padding( 54 | padding: const EdgeInsets.all(10.0), 55 | child: Column( 56 | children: [ 57 | questionTextField, 58 | answerTextField, 59 | ], 60 | ), 61 | ); 62 | 63 | final form = Form( 64 | key: _formValidator, 65 | child: textFields, 66 | ); 67 | 68 | final appBar = AppBar( 69 | title: Text(isEditing ? 'Edit Flashcard' : 'New Flashcard'), 70 | actions: [ 71 | IconButton( 72 | icon: Icon(Icons.check), 73 | tooltip: 'Save flashcard', 74 | onPressed: widget.onSaveAction != null 75 | ? () { 76 | if (_formValidator.currentState.validate()) { 77 | widget.onSaveAction( 78 | questionTextCtrl.text.trim(), 79 | answerTextCtrl.text.trim(), 80 | ); 81 | Navigator.of(context).pop(); 82 | } 83 | } 84 | : null, 85 | ), 86 | ], 87 | ); 88 | 89 | final scaffold = Scaffold( 90 | appBar: appBar, 91 | body: SingleChildScrollView( 92 | child: form, 93 | ), 94 | ); 95 | 96 | return scaffold; 97 | } 98 | 99 | @override 100 | void initState() { 101 | super.initState(); 102 | questionTextCtrl.text = widget.question; 103 | answerTextCtrl.text = widget.answer; 104 | } 105 | 106 | @override 107 | void dispose() { 108 | answerTextCtrl.dispose(); 109 | questionTextCtrl.dispose(); 110 | super.dispose(); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /lib/ui/leitner_system_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:flutter_markdown/flutter_markdown.dart'; 4 | 5 | import '../bloc/leitner_system_bloc.dart'; 6 | import '../model/deck.dart'; 7 | import '../model/flashcard.dart'; 8 | import '../repository/flashcard_repository.dart'; 9 | 10 | class LeitnerSystemPage extends StatefulWidget { 11 | final Deck deck; 12 | final FlashcardRepository flashcardRepository; 13 | 14 | LeitnerSystemPage(this.deck, this.flashcardRepository); 15 | 16 | @override 17 | _LeitnerSystemPageState createState() => _LeitnerSystemPageState(); 18 | } 19 | 20 | class _LeitnerSystemPageState extends State { 21 | LeitnerSystemBloc bloc; 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | final flashcard = BlocBuilder( 26 | bloc: bloc, 27 | builder: _buildFlashcard, 28 | ); 29 | 30 | final appBar = AppBar( 31 | title: Text(bloc.deck.title), 32 | ); 33 | 34 | final scaffold = Scaffold( 35 | appBar: appBar, 36 | body: flashcard, 37 | ); 38 | 39 | return scaffold; 40 | } 41 | 42 | Widget _buildFlashcard(BuildContext context, LSState state) { 43 | if (state.currentFlashcard == null) { 44 | return Center( 45 | child: CircularProgressIndicator(), 46 | ); 47 | } 48 | 49 | final flashcard = state.currentFlashcard; 50 | 51 | final question = Markdown( 52 | data: flashcard.question, 53 | ); 54 | final answer = state.isAnswerVisible 55 | ? Markdown( 56 | data: flashcard.answer, 57 | ) 58 | : Center( 59 | child: SingleChildScrollView( 60 | child: FlatButton( 61 | onPressed: () => bloc.dispatch(RevealAnswerLSEvent()), 62 | color: Theme.of(context).accentColor, 63 | textColor: Colors.white, 64 | child: const Text('Reveal'), 65 | ), 66 | ), 67 | ); 68 | final bottom = state.isAnswerVisible 69 | ? Row( 70 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 71 | children: [ 72 | FlatButton( 73 | onPressed: () => bloc 74 | .dispatch(ClassifyFlashcardLSEvent(Classification.easy)), 75 | color: Colors.green[100], 76 | textColor: Colors.green, 77 | child: const Text('Easy'), 78 | ), 79 | FlatButton( 80 | onPressed: () => bloc 81 | .dispatch(ClassifyFlashcardLSEvent(Classification.hard)), 82 | color: Colors.red[100], 83 | textColor: Colors.red, 84 | child: const Text('Hard'), 85 | ), 86 | ], 87 | ) 88 | : SizedBox(height: 36.0); 89 | 90 | return Column( 91 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 92 | crossAxisAlignment: CrossAxisAlignment.center, 93 | children: [ 94 | Expanded(child: question), 95 | Divider(), 96 | Expanded(child: answer), 97 | bottom, 98 | SizedBox(height: 5.0), 99 | ], 100 | ); 101 | } 102 | 103 | @override 104 | void initState() { 105 | super.initState(); 106 | bloc = LeitnerSystemBloc(widget.deck, widget.flashcardRepository) 107 | ..dispatch(StartLearningLSEvent()); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /lib/bloc/leitner_system_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc/bloc.dart'; 2 | 3 | import '../model/deck.dart'; 4 | import '../model/flashcard.dart'; 5 | import '../repository/flashcard_repository.dart'; 6 | 7 | class LeitnerSystemBloc extends Bloc { 8 | final Deck deck; 9 | final FlashcardRepository flashcardRepository; 10 | int currentFlashcardIdx = 0; 11 | int currentSession = 0; 12 | List learningSet = []; 13 | 14 | LeitnerSystemBloc(this.deck, this.flashcardRepository); 15 | 16 | @override 17 | LSState get initialState => LSState(null); 18 | 19 | @override 20 | Stream mapEventToState(LSEvent event) async* { 21 | if (event is StartLearningLSEvent) { 22 | // We can't start the system with a dirty learning set. 23 | assert(learningSet.isEmpty); 24 | 25 | // Load all the deck's flashcards, then sort it by group. 26 | learningSet = await flashcardRepository.loadAllByDeckId(deck.id); 27 | learningSet.sort((a, b) => a.group.compareTo(b.group)); 28 | 29 | // Use the first flashcard as the initial one. 30 | yield LSState(learningSet.first); 31 | } 32 | 33 | if (event is RevealAnswerLSEvent) { 34 | // Make the answer part of the flashcard visible to the user. 35 | yield LSState(currentState.currentFlashcard, isAnswerVisible: true); 36 | } 37 | 38 | if (event is ClassifyFlashcardLSEvent) { 39 | // Change the current flashcard's group classification. If it was a 40 | // positive classification, then promote the flashcard, otherwise set it 41 | // back to the initial group. 42 | if (event.classification == Classification.easy) { 43 | // Promote this flashcard, but only if it's not in the last group. 44 | if (currentState.currentFlashcard.group < (deck.maxGroup-1)) { 45 | currentState.currentFlashcard.group++; 46 | } 47 | } else { 48 | assert(event.classification == Classification.hard); 49 | // Reset the flashcard to the initial group, so it can be iterated 50 | // again in the next session. 51 | currentState.currentFlashcard.group = 0; 52 | } 53 | 54 | // Save the flashcard modifications. 55 | await flashcardRepository.store(currentState.currentFlashcard); 56 | 57 | // Go forward to the next flashcard, or, if it's gone through all 58 | // flashcard, advance one session. 59 | if (currentFlashcardIdx < (learningSet.length - 1) && 60 | learningSet[currentFlashcardIdx + 1].group <= currentSession) { 61 | // Still in the same session, so advance one flashcard. 62 | currentFlashcardIdx++; 63 | } else { 64 | // This session has ended, so advance one session and start from the 65 | // first flashcard. If it's the last session, then reset it to the 66 | // first one. 67 | currentFlashcardIdx = 0; 68 | currentSession = (currentSession + 1) % deck.maxGroup; 69 | learningSet.sort((a, b) => a.group.compareTo(b.group)); 70 | 71 | // Sometimes, a group is left with no flashcard in it. So, this means 72 | // that some sessions may be skipped to the very next one that contains 73 | // any flashcards (i.e., the first flashcard's group indicates to which 74 | // session it should skip). 75 | if (learningSet.first.group > currentSession) { 76 | currentSession = learningSet.first.group; 77 | } 78 | } 79 | 80 | yield LSState(learningSet[currentFlashcardIdx]); 81 | } 82 | } 83 | } 84 | 85 | abstract class LSEvent {} 86 | 87 | class StartLearningLSEvent implements LSEvent {} 88 | 89 | enum Classification { 90 | easy, 91 | hard, 92 | } 93 | 94 | class RevealAnswerLSEvent implements LSEvent {} 95 | 96 | class ClassifyFlashcardLSEvent implements LSEvent { 97 | final Classification classification; 98 | ClassifyFlashcardLSEvent(this.classification); 99 | } 100 | 101 | class LSState { 102 | final Flashcard currentFlashcard; 103 | final bool isAnswerVisible; 104 | LSState(this.currentFlashcard, {this.isAnswerVisible = false}); 105 | } 106 | -------------------------------------------------------------------------------- /lib/bloc/home_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'dart:convert'; 3 | 4 | import 'package:bloc/bloc.dart'; 5 | //import 'package:file_picker/file_picker.dart'; 6 | import 'package:intl/intl.dart' as intl; 7 | import 'package:path_provider/path_provider.dart' 8 | show getApplicationDocumentsDirectory, getExternalStorageDirectory; 9 | import 'package:simple_permissions/simple_permissions.dart'; 10 | 11 | import '../model/deck.dart'; 12 | import '../model/flashcard.dart'; 13 | import '../repository/deck_repository.dart'; 14 | import '../repository/flashcard_repository.dart'; 15 | 16 | class HomeBloc extends Bloc { 17 | final DeckRepository deckRepository; 18 | final FlashcardRepository flashcardRepository; 19 | 20 | @override 21 | HomeState get initialState => LoadingHomeState(); 22 | 23 | HomeBloc(this.deckRepository, this.flashcardRepository); 24 | 25 | @override 26 | Stream mapEventToState(HomeEvent event) async* { 27 | if (event is LoadDecksHomeEvent) { 28 | yield LoadingHomeState(); 29 | final decks = await deckRepository.loadAll(); 30 | yield DecksHomeState(decks); 31 | } 32 | 33 | if (event is HomeEventDeleteDeck) { 34 | final flashcards = 35 | await flashcardRepository.loadAllByDeckId(event.deck.id); 36 | for (final flashcard in flashcards) { 37 | await flashcardRepository.remove(flashcard.id); 38 | } 39 | await deckRepository.remove(event.deck.id); 40 | final decks = await deckRepository.loadAll(); 41 | yield DecksHomeState(decks); 42 | } 43 | 44 | if (event is HomeEventExportData) { 45 | await SimplePermissions.requestPermission( 46 | Permission.WriteExternalStorage); 47 | final bool permitted = await SimplePermissions.checkPermission( 48 | Permission.WriteExternalStorage); 49 | 50 | if (permitted) { 51 | yield LoadingHomeState(); 52 | 53 | final decks = await deckRepository.loadAll(); 54 | final flashcards = await deckRepository.loadAll(); 55 | final collection = { 56 | 'decks': decks.map((deck) => deck.toMap()).toList(), 57 | 'flashcards': 58 | flashcards.map((flashcard) => flashcard.toMap()).toList(), 59 | }; 60 | final data = json.encode(collection); 61 | 62 | final dateFmt = intl.DateFormat('yyyy-MM-dd'); 63 | final now = dateFmt.format(DateTime.now()); 64 | final externalDir = (await getExternalStorageDirectory()).absolute.path; 65 | final downloadDir = Directory('$externalDir/Download'); 66 | final file = File('${downloadDir.path}/cognita_data_$now.json'); 67 | await file.writeAsString(data); 68 | 69 | yield DecksHomeState(decks); 70 | } 71 | } 72 | 73 | if (event is HomeEventImportData) { 74 | await SimplePermissions.requestPermission(Permission.ReadExternalStorage); 75 | final bool permitted = await SimplePermissions.checkPermission( 76 | Permission.ReadExternalStorage); 77 | 78 | if (permitted) { 79 | yield LoadingHomeState(); 80 | /* 81 | final file = await FilePicker.getFile( 82 | type: FileType.CUSTOM, fileExtension: 'JSON'); 83 | final data = await file.readAsString(); 84 | final collection = json.decode(data); 85 | final decks = 86 | collection['decks'].map((map) => Deck.fromMap(map)).toList(); 87 | final flashcards = collection['flashcards'] 88 | .map((map) => Flashcard.fromMap(map)) 89 | .toList(); 90 | 91 | for (final deck in decks) { 92 | final oldDeckId = deck.id; 93 | deck.id = null; 94 | final newDeck = await deckRepository.store(deck); 95 | for (final flashcard 96 | in flashcards.where((fc) => fc.deckId == oldDeckId)) { 97 | flashcard.id = null; 98 | flashcard.deckId = newDeck.id; 99 | await flashcardRepository.store(flashcard); 100 | } 101 | } 102 | 103 | */ 104 | yield DecksHomeState(await deckRepository.loadAll()); 105 | } 106 | } 107 | } 108 | } 109 | 110 | abstract class HomeEvent {} 111 | 112 | class LoadDecksHomeEvent implements HomeEvent {} 113 | 114 | class HomeEventDeleteDeck implements HomeEvent { 115 | final Deck deck; 116 | HomeEventDeleteDeck(this.deck); 117 | } 118 | 119 | class HomeEventExportData implements HomeEvent {} 120 | 121 | class HomeEventImportData implements HomeEvent {} 122 | 123 | abstract class HomeState {} 124 | 125 | class LoadingHomeState implements HomeState {} 126 | 127 | class DecksHomeState implements HomeState { 128 | final List decks; 129 | DecksHomeState(this.decks); 130 | } 131 | -------------------------------------------------------------------------------- /lib/ui/create_deck_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_markdown/flutter_markdown.dart'; 3 | 4 | import '../model/deck.dart'; 5 | import '../repository/deck_repository.dart'; 6 | 7 | const String sessionExplanationMessage = 8 | "A deck contains a number of boxes which holds flashcards. When you learn a " 9 | "deck, you start by taking the flashcards from the first box. When you are done " 10 | "classifying them as easy or hard, you put some of the flashcards back to the " 11 | "first box if you failed them, or to the next box if you succeeded them. " 12 | "On the next learning session, you take the flashcards from the first and second boxes " 13 | "and repeat the same process." 14 | "\n\n" 15 | "A session is an iteration of the deck's flashcards. The first session takes " 16 | "the flashcards from the first box. The second session takes the flashcards from " 17 | "the first and second box, and so on. " 18 | "\n\n" 19 | "There are as many sessions as boxes. The idea is to get in a place where all " 20 | "of the deck's flashcards are held by the last box, which means you learned the " 21 | "entire deck! "; 22 | 23 | class CreateDeckPage extends StatefulWidget { 24 | final DeckRepository deckRepository; 25 | 26 | CreateDeckPage(this.deckRepository); 27 | 28 | @override 29 | _CreateDeckPageState createState() => _CreateDeckPageState(); 30 | } 31 | 32 | class _CreateDeckPageState extends State { 33 | final titleTextCtrl = TextEditingController(); 34 | final groupTextCtrl = TextEditingController(); 35 | final _formValidator = GlobalKey(); 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | final titleTextField = TextFormField( 40 | controller: titleTextCtrl, 41 | validator: (text) { 42 | if (text.trim().isEmpty) { 43 | return 'Provide the deck\'s title'; 44 | } 45 | return null; 46 | }, 47 | decoration: InputDecoration( 48 | labelText: 'Title', 49 | ), 50 | textCapitalization: TextCapitalization.sentences, 51 | maxLength: 32, 52 | ); 53 | 54 | final groupTextField = TextFormField( 55 | controller: groupTextCtrl, 56 | validator: (text) { 57 | if (text.trim().isEmpty) { 58 | return 'Obligatory field'; 59 | } 60 | try { 61 | final input = int.parse(text); 62 | if (input <= 2 || input > 10) { 63 | return 'Sessions are a number between 3 and 10'; 64 | } 65 | } on FormatException { 66 | return 'Sessions should be a positive number'; 67 | } 68 | return null; 69 | }, 70 | decoration: InputDecoration( 71 | suffixIcon: IconButton( 72 | icon: Icon(Icons.help_outline), 73 | tooltip: 'What is a session?', 74 | onPressed: () { 75 | showDialog( 76 | context: context, 77 | builder: (context) { 78 | return AlertDialog( 79 | title: const Text('Boxes and sessions'), 80 | content: SingleChildScrollView( 81 | child: Text(sessionExplanationMessage), 82 | ), 83 | ); 84 | }, 85 | ); 86 | }, 87 | ), 88 | labelText: 'Sessions', 89 | ), 90 | keyboardType: TextInputType.number, 91 | maxLength: 2, 92 | ); 93 | 94 | final textFields = ListView( 95 | primary: false, 96 | padding: const EdgeInsets.all(10.0), 97 | children: [ 98 | titleTextField, 99 | groupTextField, 100 | ], 101 | ); 102 | 103 | final form = Form( 104 | key: _formValidator, 105 | child: textFields, 106 | ); 107 | 108 | final appBar = AppBar( 109 | title: Text('New Deck'), 110 | actions: [ 111 | IconButton( 112 | icon: Icon(Icons.check), 113 | tooltip: 'Create deck', 114 | onPressed: () async { 115 | if (_formValidator.currentState.validate()) { 116 | await widget.deckRepository.store(Deck( 117 | null, 118 | titleTextCtrl.text.trim(), 119 | int.parse(groupTextCtrl.text.trim()), 120 | )); 121 | Navigator.of(context).pop(); 122 | } 123 | }, 124 | ), 125 | ], 126 | ); 127 | 128 | final scaffold = Scaffold( 129 | appBar: appBar, 130 | body: form, 131 | ); 132 | 133 | return scaffold; 134 | } 135 | 136 | @override 137 | void dispose() { 138 | groupTextCtrl.dispose(); 139 | titleTextCtrl.dispose(); 140 | super.dispose(); 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /lib/ui/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | 4 | import '../bloc/home_bloc.dart'; 5 | import '../model/deck.dart'; 6 | import '../repository/deck_repository.dart'; 7 | import '../repository/flashcard_repository.dart'; 8 | import '../ui/create_deck_page.dart'; 9 | import '../ui/edit_deck_page.dart'; 10 | 11 | enum HomeMenuAction { 12 | importData, 13 | exportData, 14 | } 15 | 16 | class HomePage extends StatefulWidget { 17 | final DeckRepository deckRepository; 18 | final FlashcardRepository flashcardRepository; 19 | 20 | HomePage(this.deckRepository, this.flashcardRepository); 21 | 22 | @override 23 | _HomePageState createState() => _HomePageState(); 24 | } 25 | 26 | class _HomePageState extends State { 27 | HomeBloc homeBloc; 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | final appBar = AppBar( 32 | title: const Text('Cognita'), 33 | actions: [ 34 | PopupMenuButton( 35 | onSelected: (HomeMenuAction action) async { 36 | if (action == HomeMenuAction.exportData) { 37 | homeBloc.dispatch(HomeEventExportData()); 38 | } 39 | 40 | if (action == HomeMenuAction.importData) { 41 | homeBloc.dispatch(HomeEventImportData()); 42 | } 43 | }, 44 | itemBuilder: (context) => >[ 45 | const PopupMenuItem( 46 | value: HomeMenuAction.importData, 47 | child: const Text('Import data'), 48 | ), 49 | const PopupMenuItem( 50 | value: HomeMenuAction.exportData, 51 | child: const Text('Export data'), 52 | ), 53 | ], 54 | ), 55 | ], 56 | ); 57 | 58 | final scaffold = Scaffold( 59 | appBar: appBar, 60 | body: _buildDeckList(context), 61 | floatingActionButton: FloatingActionButton( 62 | onPressed: () async => await _onCreateDeck(context), 63 | child: Icon(Icons.library_add), 64 | ), 65 | ); 66 | 67 | return scaffold; 68 | } 69 | 70 | Widget _buildDeckList(BuildContext context) { 71 | return BlocBuilder( 72 | bloc: homeBloc, 73 | builder: (context, state) { 74 | if (state is LoadingHomeState) { 75 | return Center(child: CircularProgressIndicator()); 76 | } 77 | 78 | if (state is DecksHomeState) { 79 | if (state.decks.isEmpty) { 80 | return Center( 81 | child: Text( 82 | 'Empty', 83 | style: Theme.of(context) 84 | .textTheme 85 | .caption 86 | .copyWith(fontSize: 24.0), 87 | ), 88 | ); 89 | } 90 | 91 | return ListView.separated( 92 | separatorBuilder: (ctx, index) => Divider(height: 0.0), 93 | itemBuilder: (ctx, index) => 94 | _buildDeckTile(ctx, state.decks[index]), 95 | itemCount: state.decks.length, 96 | ); 97 | } 98 | }, 99 | ); 100 | } 101 | 102 | Widget _buildDeckTile(BuildContext context, Deck deck) { 103 | final tile = ListTile( 104 | leading: Icon(Icons.library_books, color: Theme.of(context).accentColor), 105 | title: Text(deck.title), 106 | onTap: () => _onEditDeck(context, deck), 107 | ); 108 | 109 | return Dismissible( 110 | key: Key('deck ${deck.id}'), 111 | child: tile, 112 | background: Container( 113 | alignment: AlignmentDirectional.centerStart, 114 | color: Colors.red, 115 | child: Padding( 116 | padding: const EdgeInsets.all(16.0), 117 | child: Icon(Icons.delete_forever, color: Colors.white), 118 | )), 119 | secondaryBackground: Container( 120 | alignment: AlignmentDirectional.centerEnd, 121 | color: Colors.red, 122 | child: Padding( 123 | padding: const EdgeInsets.all(16.0), 124 | child: Icon(Icons.delete_forever, color: Colors.white), 125 | )), 126 | onDismissed: (direction) => _onDeckDismissed(deck, direction), 127 | confirmDismiss: (direction) => 128 | _confirmDeckDismiss(context, direction, deck), 129 | ); 130 | } 131 | 132 | void _onDeckDismissed(Deck deck, DismissDirection direction) async { 133 | await widget.deckRepository.remove(deck.id); 134 | homeBloc.dispatch(HomeEventDeleteDeck(deck)); 135 | } 136 | 137 | Future _confirmDeckDismiss( 138 | BuildContext context, DismissDirection direction, Deck deck) async { 139 | return showDialog( 140 | context: context, 141 | barrierDismissible: false, 142 | builder: (ctx) { 143 | return AlertDialog( 144 | title: Text('Delete ${deck.title}?'), 145 | content: SingleChildScrollView( 146 | child: ListBody( 147 | children: [ 148 | const Text('This will remove this deck and its flashcards.'), 149 | ], 150 | ), 151 | ), 152 | actions: [ 153 | FlatButton( 154 | child: const Text('CANCEL'), 155 | onPressed: () => Navigator.of(ctx).pop(false), 156 | ), 157 | FlatButton( 158 | child: const Text('OK'), 159 | onPressed: () => Navigator.of(ctx).pop(true), 160 | ), 161 | ], 162 | ); 163 | }, 164 | ); 165 | } 166 | 167 | void _onCreateDeck(BuildContext context) async { 168 | await Navigator.of(context).push(MaterialPageRoute( 169 | builder: (context) => CreateDeckPage(widget.deckRepository), 170 | )); 171 | homeBloc.dispatch(LoadDecksHomeEvent()); 172 | } 173 | 174 | void _onEditDeck(BuildContext context, Deck deck) async { 175 | await Navigator.of(context).push(MaterialPageRoute( 176 | builder: (context) => EditDeckPage(deck, widget.flashcardRepository), 177 | )); 178 | homeBloc.dispatch(LoadDecksHomeEvent()); 179 | } 180 | 181 | @override 182 | void initState() { 183 | super.initState(); 184 | homeBloc = HomeBloc(widget.deckRepository, widget.flashcardRepository) 185 | ..dispatch(LoadDecksHomeEvent()); 186 | } 187 | 188 | @override 189 | void dispose() { 190 | homeBloc.dispose(); 191 | super.dispose(); 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /lib/ui/edit_deck_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:flutter_markdown/flutter_markdown.dart'; 4 | 5 | import '../bloc/edit_deck_bloc.dart'; 6 | import '../model/deck.dart'; 7 | import '../model/flashcard.dart'; 8 | import '../repository/flashcard_repository.dart'; 9 | import '../ui/edit_flashcard_page.dart'; 10 | import '../ui/leitner_system_page.dart'; 11 | 12 | class EditDeckPage extends StatefulWidget { 13 | final Deck deck; 14 | final FlashcardRepository flashcardRepository; 15 | 16 | EditDeckPage(this.deck, this.flashcardRepository); 17 | 18 | @override 19 | _EditDeckPageState createState() => _EditDeckPageState(); 20 | } 21 | 22 | class _EditDeckPageState extends State { 23 | EditDeckBloc editDeckBloc; 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return BlocBuilder( 28 | bloc: editDeckBloc, 29 | builder: (context, state) { 30 | final hasFlashcards = state is! EDStateFlashcards || 31 | (state as EDStateFlashcards).flashcards.isNotEmpty; 32 | final actions = [ 33 | IconButton( 34 | icon: Icon(Icons.video_library), 35 | tooltip: 'Learn deck', 36 | onPressed: hasFlashcards 37 | ? () async { 38 | await Navigator.of(context).push(MaterialPageRoute( 39 | builder: (context) => LeitnerSystemPage( 40 | widget.deck, widget.flashcardRepository), 41 | )); 42 | editDeckBloc.dispatch(EDEventLoadFlashcards()); 43 | } 44 | : null, 45 | ), 46 | IconButton( 47 | icon: Icon(Icons.replay), 48 | tooltip: 'Reset learning', 49 | onPressed: hasFlashcards 50 | ? () async { 51 | final bool shouldResetDeck = 52 | await _dialogShouldResetDeck(context); 53 | if (shouldResetDeck) { 54 | editDeckBloc.dispatch(EDEventResetFlashcardsGroup()); 55 | } 56 | } 57 | : null, 58 | ), 59 | ]; 60 | 61 | final appBar = AppBar( 62 | title: Text(editDeckBloc.deck.title), 63 | actions: actions, 64 | ); 65 | 66 | final scaffold = Scaffold( 67 | appBar: appBar, 68 | body: _buildBody(context, state), 69 | floatingActionButton: FloatingActionButton( 70 | onPressed: () async => await _onCreateFlashcard(context), 71 | child: Icon(Icons.note_add), 72 | ), 73 | ); 74 | 75 | return scaffold; 76 | }, 77 | ); 78 | } 79 | 80 | Widget _buildBody(BuildContext context, EDState state) { 81 | if (state is EDStateLoading) { 82 | return Center(child: CircularProgressIndicator()); 83 | } 84 | 85 | if (state is EDStateFlashcards) { 86 | return _buildFlashcardList(context, state.flashcards); 87 | } 88 | } 89 | 90 | Widget _buildFlashcardList(BuildContext context, List flashcards) { 91 | if (flashcards.isEmpty) { 92 | return Center( 93 | child: Text( 94 | 'Empty', 95 | style: Theme.of(context).textTheme.caption.copyWith(fontSize: 24.0), 96 | ), 97 | ); 98 | } 99 | 100 | final proficiencyColors = [ 101 | Colors.red, 102 | Colors.blue, 103 | Colors.green, 104 | ]; 105 | 106 | return ListView.separated( 107 | separatorBuilder: (ctx, index) => Divider(height: 0.0), 108 | itemBuilder: (ctx, index) { 109 | if (index < flashcards.length) { 110 | final proficiencyColorIndex = 111 | (((flashcards[index].group) / editDeckBloc.deck.maxGroup) * 3) 112 | .toInt(); 113 | final boxPositionNumber = '${flashcards[index].group + 1}'; 114 | final boxPositionSuffix = boxPositionNumber.endsWith('1') 115 | ? 'st' 116 | : boxPositionNumber.endsWith('2') 117 | ? 'nd' 118 | : boxPositionNumber.endsWith('3') ? 'rd' : 'th'; 119 | final boxPosition = '$boxPositionNumber$boxPositionSuffix'; 120 | final tile = ListTile( 121 | leading: Icon(Icons.note, color: Theme.of(context).accentColor), 122 | trailing: Icon(Icons.offline_bolt, 123 | color: proficiencyColors[proficiencyColorIndex]), 124 | title: MarkdownBody( 125 | data: flashcards[index].question, 126 | ), 127 | subtitle: Text('In $boxPosition box'), 128 | onTap: () => _onEditFlashcard(context, flashcards[index]), 129 | ); 130 | return Dismissible( 131 | key: Key('flashcard ${flashcards[index].id}'), 132 | child: tile, 133 | onDismissed: (direction) => 134 | _onFlashcardDismissed(flashcards[index], direction), 135 | confirmDismiss: (direction) => 136 | _confirmFlashcardDismiss(context, direction), 137 | background: Container( 138 | alignment: AlignmentDirectional.centerStart, 139 | color: Colors.red, 140 | child: Padding( 141 | padding: const EdgeInsets.all(16.0), 142 | child: Icon(Icons.delete_forever, color: Colors.white), 143 | )), 144 | secondaryBackground: Container( 145 | alignment: AlignmentDirectional.centerEnd, 146 | color: Colors.red, 147 | child: Padding( 148 | padding: const EdgeInsets.all(16.0), 149 | child: Icon(Icons.delete_forever, color: Colors.white), 150 | )), 151 | ); 152 | } else { 153 | return SizedBox(height: 80.0); 154 | } 155 | }, 156 | itemCount: flashcards.length + 1, 157 | ); 158 | } 159 | 160 | void _onCreateFlashcard(BuildContext context) async { 161 | await Navigator.of(context).push(MaterialPageRoute( 162 | builder: (context) => EditFlashcardPage( 163 | '', 164 | '', 165 | isEditing: false, 166 | onSaveAction: (question, answer) { 167 | editDeckBloc.dispatch(EDEventCreateFlashcard(question, answer)); 168 | }, 169 | ), 170 | )); 171 | } 172 | 173 | void _onEditFlashcard(BuildContext context, Flashcard flashcard) async { 174 | await Navigator.of(context).push(MaterialPageRoute( 175 | builder: (context) => EditFlashcardPage( 176 | flashcard.question, 177 | flashcard.answer, 178 | onSaveAction: (question, answer) { 179 | editDeckBloc.dispatch(EDEventEditFlashcard(flashcard.copyWith( 180 | question: question, 181 | answer: answer, 182 | ))); 183 | }, 184 | ), 185 | )); 186 | } 187 | 188 | void _onFlashcardDismissed( 189 | Flashcard flashcard, DismissDirection direction) async { 190 | await widget.flashcardRepository.remove(flashcard.id); 191 | editDeckBloc.dispatch(EDEventLoadFlashcards()); 192 | } 193 | 194 | Future _confirmFlashcardDismiss( 195 | BuildContext context, DismissDirection direction) async { 196 | final dialogMessage = 'This will remove this flashcard from the deck.'; 197 | return showDialog( 198 | context: context, 199 | barrierDismissible: false, 200 | builder: (ctx) { 201 | return AlertDialog( 202 | title: const Text('Delete flashcard?'), 203 | content: SingleChildScrollView( 204 | child: ListBody( 205 | children: [ 206 | Text(dialogMessage), 207 | ], 208 | ), 209 | ), 210 | actions: [ 211 | FlatButton( 212 | child: const Text('CANCEL'), 213 | onPressed: () => Navigator.of(ctx).pop(false), 214 | ), 215 | FlatButton( 216 | child: const Text('OK'), 217 | onPressed: () => Navigator.of(ctx).pop(true), 218 | ), 219 | ], 220 | ); 221 | }, 222 | ); 223 | } 224 | 225 | Future _dialogShouldResetDeck(BuildContext context) { 226 | return showDialog( 227 | context: context, 228 | barrierDismissible: false, 229 | builder: (ctx) { 230 | return AlertDialog( 231 | title: const Text('Unlearn flashcards?'), 232 | content: SingleChildScrollView( 233 | child: ListBody( 234 | children: [ 235 | Text( 236 | 'This will bring the flashcards back to the first box.'), 237 | ], 238 | ), 239 | ), 240 | actions: [ 241 | FlatButton( 242 | child: const Text('CANCEL'), 243 | onPressed: () => Navigator.of(ctx).pop(false), 244 | ), 245 | FlatButton( 246 | child: const Text('OK'), 247 | onPressed: () => Navigator.of(ctx).pop(true), 248 | ), 249 | ], 250 | ); 251 | }, 252 | ); 253 | } 254 | 255 | @override 256 | void initState() { 257 | super.initState(); 258 | editDeckBloc = EditDeckBloc(widget.deck, widget.flashcardRepository) 259 | ..dispatch(EDEventLoadFlashcards()); 260 | } 261 | 262 | @override 263 | void dispose() { 264 | editDeckBloc.dispose(); 265 | super.dispose(); 266 | } 267 | } 268 | -------------------------------------------------------------------------------- /fonts/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile 3 | packages: 4 | analyzer: 5 | dependency: transitive 6 | description: 7 | name: analyzer 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.35.4" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.1" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.1.0" 25 | bloc: 26 | dependency: "direct main" 27 | description: 28 | name: bloc 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "0.13.0" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.0.4" 39 | charcode: 40 | dependency: transitive 41 | description: 42 | name: charcode 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.2" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.14.11" 53 | convert: 54 | dependency: transitive 55 | description: 56 | name: convert 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.1" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.0.6" 67 | cupertino_icons: 68 | dependency: "direct main" 69 | description: 70 | name: cupertino_icons 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "0.1.2" 74 | dart_style: 75 | dependency: transitive 76 | description: 77 | name: dart_style 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.2.4" 81 | flutter: 82 | dependency: "direct main" 83 | description: flutter 84 | source: sdk 85 | version: "0.0.0" 86 | flutter_bloc: 87 | dependency: "direct main" 88 | description: 89 | name: flutter_bloc 90 | url: "https://pub.dartlang.org" 91 | source: hosted 92 | version: "0.13.0" 93 | flutter_markdown: 94 | dependency: "direct main" 95 | description: 96 | name: flutter_markdown 97 | url: "https://pub.dartlang.org" 98 | source: hosted 99 | version: "0.2.0" 100 | flutter_test: 101 | dependency: "direct dev" 102 | description: flutter 103 | source: sdk 104 | version: "0.0.0" 105 | front_end: 106 | dependency: transitive 107 | description: 108 | name: front_end 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "0.1.14" 112 | glob: 113 | dependency: transitive 114 | description: 115 | name: glob 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "1.1.7" 119 | http: 120 | dependency: transitive 121 | description: 122 | name: http 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "0.12.0+2" 126 | http_multi_server: 127 | dependency: transitive 128 | description: 129 | name: http_multi_server 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "2.0.6" 133 | http_parser: 134 | dependency: transitive 135 | description: 136 | name: http_parser 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "3.1.3" 140 | intl: 141 | dependency: "direct main" 142 | description: 143 | name: intl 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "0.15.8" 147 | intl_translation: 148 | dependency: "direct dev" 149 | description: 150 | name: intl_translation 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.17.4" 154 | io: 155 | dependency: transitive 156 | description: 157 | name: io 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "0.3.3" 161 | js: 162 | dependency: transitive 163 | description: 164 | name: js 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "0.6.1+1" 168 | json_rpc_2: 169 | dependency: transitive 170 | description: 171 | name: json_rpc_2 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "2.1.0" 175 | kernel: 176 | dependency: transitive 177 | description: 178 | name: kernel 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "0.3.14" 182 | markdown: 183 | dependency: transitive 184 | description: 185 | name: markdown 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "2.0.3" 189 | matcher: 190 | dependency: transitive 191 | description: 192 | name: matcher 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "0.12.5" 196 | meta: 197 | dependency: transitive 198 | description: 199 | name: meta 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "1.1.6" 203 | mime: 204 | dependency: transitive 205 | description: 206 | name: mime 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "0.9.6+2" 210 | multi_server_socket: 211 | dependency: transitive 212 | description: 213 | name: multi_server_socket 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "1.0.2" 217 | node_preamble: 218 | dependency: transitive 219 | description: 220 | name: node_preamble 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "1.4.4" 224 | package_config: 225 | dependency: transitive 226 | description: 227 | name: package_config 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "1.0.5" 231 | package_resolver: 232 | dependency: transitive 233 | description: 234 | name: package_resolver 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "1.0.10" 238 | path: 239 | dependency: transitive 240 | description: 241 | name: path 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "1.6.2" 245 | path_provider: 246 | dependency: "direct main" 247 | description: 248 | name: path_provider 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "1.1.0" 252 | pedantic: 253 | dependency: transitive 254 | description: 255 | name: pedantic 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "1.5.0" 259 | petitparser: 260 | dependency: transitive 261 | description: 262 | name: petitparser 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "2.2.1" 266 | pool: 267 | dependency: transitive 268 | description: 269 | name: pool 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "1.4.0" 273 | pub_semver: 274 | dependency: transitive 275 | description: 276 | name: pub_semver 277 | url: "https://pub.dartlang.org" 278 | source: hosted 279 | version: "1.4.2" 280 | quiver: 281 | dependency: transitive 282 | description: 283 | name: quiver 284 | url: "https://pub.dartlang.org" 285 | source: hosted 286 | version: "2.0.2" 287 | rxdart: 288 | dependency: transitive 289 | description: 290 | name: rxdart 291 | url: "https://pub.dartlang.org" 292 | source: hosted 293 | version: "0.22.0" 294 | shelf: 295 | dependency: transitive 296 | description: 297 | name: shelf 298 | url: "https://pub.dartlang.org" 299 | source: hosted 300 | version: "0.7.5" 301 | shelf_packages_handler: 302 | dependency: transitive 303 | description: 304 | name: shelf_packages_handler 305 | url: "https://pub.dartlang.org" 306 | source: hosted 307 | version: "1.0.4" 308 | shelf_static: 309 | dependency: transitive 310 | description: 311 | name: shelf_static 312 | url: "https://pub.dartlang.org" 313 | source: hosted 314 | version: "0.2.8" 315 | shelf_web_socket: 316 | dependency: transitive 317 | description: 318 | name: shelf_web_socket 319 | url: "https://pub.dartlang.org" 320 | source: hosted 321 | version: "0.2.3" 322 | simple_permissions: 323 | dependency: "direct main" 324 | description: 325 | name: simple_permissions 326 | url: "https://pub.dartlang.org" 327 | source: hosted 328 | version: "0.1.9" 329 | sky_engine: 330 | dependency: transitive 331 | description: flutter 332 | source: sdk 333 | version: "0.0.99" 334 | source_map_stack_trace: 335 | dependency: transitive 336 | description: 337 | name: source_map_stack_trace 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "1.1.5" 341 | source_maps: 342 | dependency: transitive 343 | description: 344 | name: source_maps 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "0.10.8" 348 | source_span: 349 | dependency: transitive 350 | description: 351 | name: source_span 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "1.5.5" 355 | sqflite: 356 | dependency: "direct main" 357 | description: 358 | name: sqflite 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "1.1.5" 362 | stack_trace: 363 | dependency: transitive 364 | description: 365 | name: stack_trace 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "1.9.3" 369 | stream_channel: 370 | dependency: transitive 371 | description: 372 | name: stream_channel 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "2.0.0" 376 | string_scanner: 377 | dependency: transitive 378 | description: 379 | name: string_scanner 380 | url: "https://pub.dartlang.org" 381 | source: hosted 382 | version: "1.0.4" 383 | synchronized: 384 | dependency: transitive 385 | description: 386 | name: synchronized 387 | url: "https://pub.dartlang.org" 388 | source: hosted 389 | version: "2.1.0" 390 | term_glyph: 391 | dependency: transitive 392 | description: 393 | name: term_glyph 394 | url: "https://pub.dartlang.org" 395 | source: hosted 396 | version: "1.1.0" 397 | test: 398 | dependency: "direct dev" 399 | description: 400 | name: test 401 | url: "https://pub.dartlang.org" 402 | source: hosted 403 | version: "1.6.1" 404 | test_api: 405 | dependency: transitive 406 | description: 407 | name: test_api 408 | url: "https://pub.dartlang.org" 409 | source: hosted 410 | version: "0.2.4" 411 | test_core: 412 | dependency: transitive 413 | description: 414 | name: test_core 415 | url: "https://pub.dartlang.org" 416 | source: hosted 417 | version: "0.2.3" 418 | typed_data: 419 | dependency: transitive 420 | description: 421 | name: typed_data 422 | url: "https://pub.dartlang.org" 423 | source: hosted 424 | version: "1.1.6" 425 | vector_math: 426 | dependency: transitive 427 | description: 428 | name: vector_math 429 | url: "https://pub.dartlang.org" 430 | source: hosted 431 | version: "2.0.8" 432 | vm_service_client: 433 | dependency: transitive 434 | description: 435 | name: vm_service_client 436 | url: "https://pub.dartlang.org" 437 | source: hosted 438 | version: "0.2.6+1" 439 | watcher: 440 | dependency: transitive 441 | description: 442 | name: watcher 443 | url: "https://pub.dartlang.org" 444 | source: hosted 445 | version: "0.9.7+10" 446 | web_socket_channel: 447 | dependency: transitive 448 | description: 449 | name: web_socket_channel 450 | url: "https://pub.dartlang.org" 451 | source: hosted 452 | version: "1.0.12" 453 | yaml: 454 | dependency: transitive 455 | description: 456 | name: yaml 457 | url: "https://pub.dartlang.org" 458 | source: hosted 459 | version: "2.1.15" 460 | sdks: 461 | dart: ">=2.2.0 <3.0.0" 462 | flutter: ">=1.2.1 <2.0.0" 463 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 64 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3B80C3931E831B6300D905FE /* App.framework */, 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 77 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 78 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 79 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 80 | ); 81 | name = Flutter; 82 | sourceTree = ""; 83 | }; 84 | 97C146E51CF9000F007C117D = { 85 | isa = PBXGroup; 86 | children = ( 87 | 9740EEB11CF90186004384FC /* Flutter */, 88 | 97C146F01CF9000F007C117D /* Runner */, 89 | 97C146EF1CF9000F007C117D /* Products */, 90 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 106 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 97C146F11CF9000F007C117D /* Supporting Files */, 112 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 113 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 114 | ); 115 | path = Runner; 116 | sourceTree = ""; 117 | }; 118 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146F21CF9000F007C117D /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 97C146ED1CF9000F007C117D /* Runner */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 132 | buildPhases = ( 133 | 9740EEB61CF901F6004384FC /* Run Script */, 134 | 97C146EA1CF9000F007C117D /* Sources */, 135 | 97C146EB1CF9000F007C117D /* Frameworks */, 136 | 97C146EC1CF9000F007C117D /* Resources */, 137 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 138 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = Runner; 145 | productName = Runner; 146 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | /* End PBXNativeTarget section */ 150 | 151 | /* Begin PBXProject section */ 152 | 97C146E61CF9000F007C117D /* Project object */ = { 153 | isa = PBXProject; 154 | attributes = { 155 | LastUpgradeCheck = 0910; 156 | ORGANIZATIONNAME = "The Chromium Authors"; 157 | TargetAttributes = { 158 | 97C146ED1CF9000F007C117D = { 159 | CreatedOnToolsVersion = 7.3.1; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | Base, 170 | ); 171 | mainGroup = 97C146E51CF9000F007C117D; 172 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 97C146ED1CF9000F007C117D /* Runner */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 97C146EC1CF9000F007C117D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 187 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 188 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 189 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 190 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | name = "Thin Binary"; 205 | outputPaths = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | shellPath = /bin/sh; 209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 210 | }; 211 | 9740EEB61CF901F6004384FC /* Run Script */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | ); 218 | name = "Run Script"; 219 | outputPaths = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 224 | }; 225 | /* End PBXShellScriptBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | 97C146EA1CF9000F007C117D /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 233 | 97C146F31CF9000F007C117D /* main.m in Sources */, 234 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 97C146FB1CF9000F007C117D /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 97C147001CF9000F007C117D /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 261 | isa = XCBuildConfiguration; 262 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | CLANG_ANALYZER_NONNULL = YES; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 275 | CLANG_WARN_EMPTY_BODY = YES; 276 | CLANG_WARN_ENUM_CONVERSION = YES; 277 | CLANG_WARN_INFINITE_RECURSION = YES; 278 | CLANG_WARN_INT_CONVERSION = YES; 279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNREACHABLE_CODE = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_NO_COMMON_BLOCKS = YES; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 301 | MTL_ENABLE_DEBUG_INFO = NO; 302 | SDKROOT = iphoneos; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | VALIDATE_PRODUCT = YES; 305 | }; 306 | name = Profile; 307 | }; 308 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 314 | DEVELOPMENT_TEAM = S8QB4VV633; 315 | ENABLE_BITCODE = NO; 316 | FRAMEWORK_SEARCH_PATHS = ( 317 | "$(inherited)", 318 | "$(PROJECT_DIR)/Flutter", 319 | ); 320 | INFOPLIST_FILE = Runner/Info.plist; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | LIBRARY_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "$(PROJECT_DIR)/Flutter", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = com.example.cognita; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | VERSIONING_SYSTEM = "apple-generic"; 329 | }; 330 | name = Profile; 331 | }; 332 | 97C147031CF9000F007C117D /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 355 | CLANG_WARN_STRICT_PROTOTYPES = YES; 356 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = dwarf; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | ENABLE_TESTABILITY = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_DYNAMIC_NO_PIC = NO; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 379 | MTL_ENABLE_DEBUG_INFO = YES; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = iphoneos; 382 | TARGETED_DEVICE_FAMILY = "1,2"; 383 | }; 384 | name = Debug; 385 | }; 386 | 97C147041CF9000F007C117D /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_ANALYZER_NONNULL = YES; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_COMMA = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INFINITE_RECURSION = YES; 404 | CLANG_WARN_INT_CONVERSION = YES; 405 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 409 | CLANG_WARN_STRICT_PROTOTYPES = YES; 410 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 411 | CLANG_WARN_UNREACHABLE_CODE = YES; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 414 | COPY_PHASE_STRIP = NO; 415 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 416 | ENABLE_NS_ASSERTIONS = NO; 417 | ENABLE_STRICT_OBJC_MSGSEND = YES; 418 | GCC_C_LANGUAGE_STANDARD = gnu99; 419 | GCC_NO_COMMON_BLOCKS = YES; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 427 | MTL_ENABLE_DEBUG_INFO = NO; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = "1,2"; 430 | VALIDATE_PRODUCT = YES; 431 | }; 432 | name = Release; 433 | }; 434 | 97C147061CF9000F007C117D /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 440 | ENABLE_BITCODE = NO; 441 | FRAMEWORK_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "$(PROJECT_DIR)/Flutter", 444 | ); 445 | INFOPLIST_FILE = Runner/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | LIBRARY_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | PRODUCT_BUNDLE_IDENTIFIER = com.example.cognita; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | VERSIONING_SYSTEM = "apple-generic"; 454 | }; 455 | name = Debug; 456 | }; 457 | 97C147071CF9000F007C117D /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 460 | buildSettings = { 461 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 462 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 463 | ENABLE_BITCODE = NO; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(inherited)", 466 | "$(PROJECT_DIR)/Flutter", 467 | ); 468 | INFOPLIST_FILE = Runner/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 470 | LIBRARY_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | PRODUCT_BUNDLE_IDENTIFIER = com.example.cognita; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | VERSIONING_SYSTEM = "apple-generic"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147031CF9000F007C117D /* Debug */, 487 | 97C147041CF9000F007C117D /* Release */, 488 | 249021D3217E4FDB00AE95B9 /* Profile */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | 97C147061CF9000F007C117D /* Debug */, 497 | 97C147071CF9000F007C117D /* Release */, 498 | 249021D4217E4FDB00AE95B9 /* Profile */, 499 | ); 500 | defaultConfigurationIsVisible = 0; 501 | defaultConfigurationName = Release; 502 | }; 503 | /* End XCConfigurationList section */ 504 | }; 505 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 506 | } 507 | --------------------------------------------------------------------------------