├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ ├── flutter_export_environment.sh │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.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 │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ ├── xcshareddata │ └── xcschemes │ │ └── Runner.xcscheme │ └── project.pbxproj ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── binary_search │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── build.gradle ├── web └── index.html ├── .idea └── runConfigurations │ └── main_dart.xml ├── .metadata ├── lib ├── alogrithms │ ├── search │ │ ├── linear_search.dart │ │ └── binary_search.dart │ └── sort │ │ ├── insertion_sort.dart │ │ ├── bubble_sort.dart │ │ ├── selection_sort.dart │ │ └── quick_sort.dart ├── utils │ ├── wait.dart │ └── screen_size.dart ├── providers │ ├── base_provider.dart │ ├── search │ │ ├── linear_search_provider.dart │ │ ├── binary_search_provider.dart │ │ └── search_provider.dart │ └── sort │ │ ├── insertion_sort_provider.dart │ │ ├── bubble_sort_provider.dart │ │ ├── selection_sort_provider.dart │ │ ├── quick_sort_provider.dart │ │ └── sort_provider.dart ├── models │ ├── sort_model.dart │ └── search_model.dart ├── ux │ ├── widgets │ │ ├── search │ │ │ ├── search_speed.dart │ │ │ ├── search_visualizer.dart │ │ │ ├── search_message.dart │ │ │ ├── search.dart │ │ │ ├── search_indicator.dart │ │ │ └── search_widget.dart │ │ └── sort │ │ │ ├── sort_speed.dart │ │ │ ├── sort_button.dart │ │ │ ├── sort_visualizer.dart │ │ │ └── sort_widget.dart │ ├── pages │ │ ├── home │ │ │ ├── widgets │ │ │ │ ├── category_switcher.dart │ │ │ │ ├── configuration_widget.dart │ │ │ │ └── category_widget.dart │ │ │ └── home.dart │ │ ├── sort_page.dart │ │ └── search_page.dart │ └── providers │ │ └── pages_provider.dart └── main.dart ├── README.md ├── test └── widget_test.dart ├── pubspec.yaml ├── .gitignore └── analysis_options.yaml /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | android.enableR8=true 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/funwithflutter/flutter_algorithm_visualizer/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/funwithflutter/flutter_algorithm_visualizer/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/funwithflutter/flutter_algorithm_visualizer/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/funwithflutter/flutter_algorithm_visualizer/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/funwithflutter/flutter_algorithm_visualizer/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/funwithflutter/flutter_algorithm_visualizer/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/funwithflutter/flutter_algorithm_visualizer/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/funwithflutter/flutter_algorithm_visualizer/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/funwithflutter/flutter_algorithm_visualizer/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/funwithflutter/flutter_algorithm_visualizer/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 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | webby 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.idea/runConfigurations/main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.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: 68587a0916366e9512a78df22c44163d041dd5f3 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /lib/alogrithms/search/linear_search.dart: -------------------------------------------------------------------------------- 1 | /// This function is not used within the application 2 | /// It only serves to illustrate the relevant operation 3 | 4 | int linearSearch(List list, int target) { 5 | for (var i = 0; i < list.length; i++) { 6 | if (list[i] == target) { 7 | return i; 8 | } 9 | } 10 | return -1; 11 | } 12 | -------------------------------------------------------------------------------- /lib/utils/wait.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | Future sleepSum(int valueOne, int valueTwo) { 4 | return Future.delayed(const Duration(seconds: 1), () => valueOne + valueTwo); 5 | } 6 | 7 | Future wait({double speed = 0.5}) { 8 | final milliseconds = lerpDouble(100, 2000, speed).toInt(); 9 | return Future.delayed(Duration(milliseconds: milliseconds)); 10 | } 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/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/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /lib/alogrithms/sort/insertion_sort.dart: -------------------------------------------------------------------------------- 1 | /// This function is not used within the application 2 | /// It only serves to illustrate the relevant operation 3 | 4 | List insertionSort(List list) { 5 | for (var i = 0; i < list.length; i++) { 6 | for (var j = i; j > 0 && list[j] < list[j - 1]; j--) { 7 | final tmp = list[j]; 8 | list[j] = list[j - 1]; 9 | list[j - 1] = tmp; 10 | } 11 | } 12 | return list; 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/binary_search/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.binary_search 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=/home/gordon/development/flutter" 4 | export "FLUTTER_APPLICATION_PATH=/home/gordon/Documents/fun_with_flutter/code/projects/visualizer/binary_search" 5 | export "FLUTTER_TARGET=lib/main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build/ios" 8 | export "FLUTTER_FRAMEWORK_DIR=/home/gordon/development/flutter/bin/cache/artifacts/engine/ios" 9 | export "FLUTTER_BUILD_NAME=1.0.0" 10 | export "FLUTTER_BUILD_NUMBER=1" 11 | -------------------------------------------------------------------------------- /lib/alogrithms/sort/bubble_sort.dart: -------------------------------------------------------------------------------- 1 | /// This function is not used within the application 2 | /// It only serves to illustrate the relevant operation 3 | 4 | List bubbleSort(List list) { 5 | var sorted = false; 6 | var counter = 0; 7 | 8 | while (!sorted) { 9 | sorted = true; 10 | for (var i = 0; i < list.length - 1 - counter; i++) { 11 | if (list[i] > list[i + 1]) { 12 | final tmp = list[i]; 13 | list[i] = list[i + 1]; 14 | list[i + 1] = tmp; 15 | sorted = false; 16 | } 17 | } 18 | counter++; 19 | } 20 | return list; 21 | } 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # binary_search 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /lib/alogrithms/sort/selection_sort.dart: -------------------------------------------------------------------------------- 1 | /// This function is not used within the application 2 | /// It only serves to illustrate the relevant operation 3 | 4 | List selectionSort(List list) { 5 | for (var currentIndex = 0; currentIndex <= list.length - 1; currentIndex++) { 6 | var smallestIndex = currentIndex; 7 | for (var i = currentIndex + 1; i < list.length; i++) { 8 | if (list[i] < list[smallestIndex]) { 9 | smallestIndex = i; 10 | } 11 | } 12 | final tmp = list[currentIndex]; 13 | list[currentIndex] = list[smallestIndex]; 14 | list[smallestIndex] = tmp; 15 | } 16 | 17 | return list; 18 | } 19 | -------------------------------------------------------------------------------- /lib/alogrithms/search/binary_search.dart: -------------------------------------------------------------------------------- 1 | /// These functions are not used within the application 2 | /// They only serve to illustrate the relevant operation 3 | 4 | int binarySearch(List list, int target) { 5 | return _binarySearchHelper(list, target, 0, list.length - 1); 6 | } 7 | 8 | int _binarySearchHelper(List list, int target, int left, int right) { 9 | while (left <= right) { 10 | final middle = (left + right) ~/ 2; 11 | final potentialMatch = list[middle]; 12 | if (target == potentialMatch) { 13 | return middle; 14 | } else if (target < potentialMatch) { 15 | right = middle - 1; 16 | } else { 17 | left = middle + 1; 18 | } 19 | } 20 | return -1; 21 | } 22 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.2.71' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.2.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /lib/providers/base_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/utils/wait.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | abstract class BaseProvider extends ChangeNotifier { 5 | double _executionSpeed = 0.5; 6 | double get executionSpeed => _executionSpeed; 7 | set executionSpeed(double speed) { 8 | if (speed > 1.0) { 9 | _executionSpeed = 1; 10 | return; 11 | } 12 | if (speed < 0) { 13 | _executionSpeed = 0; 14 | return; 15 | } 16 | _executionSpeed = speed; 17 | render(); 18 | } 19 | 20 | @protected 21 | void render() { 22 | notifyListeners(); 23 | } 24 | 25 | @protected 26 | Future pause() async { 27 | await wait(speed: executionSpeed); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/utils/screen_size.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | enum DeviceScreenType { Mobile, Tablet, Desktop } 4 | 5 | DeviceScreenType deviceScreenType(double width) { 6 | if (width > 950) { 7 | return DeviceScreenType.Desktop; 8 | } 9 | if (width > 600) { 10 | return DeviceScreenType.Tablet; 11 | } 12 | return DeviceScreenType.Mobile; 13 | } 14 | 15 | // class SizingInformation { 16 | // // final Orientation orientation; 17 | // final DeviceScreenType deviceType; 18 | // final Size screenSize; 19 | // // final Size localWidgetSize; 20 | 21 | // SizingInformation({ 22 | // // this.orientation, 23 | // this.deviceType, 24 | // this.screenSize, 25 | // // this.localWidgetSize, 26 | // }); 27 | // } 28 | -------------------------------------------------------------------------------- /lib/providers/search/linear_search_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/models/search_model.dart'; 2 | import 'package:algorithms_visualizer/providers/search/search_provider.dart'; 3 | 4 | class LinearSearchProvider extends SearchProvider { 5 | @override 6 | void search({int value = 34}) { 7 | super.search(value: value); 8 | _startSearch(numbers, value); 9 | } 10 | 11 | Future _startSearch(List list, int target) async { 12 | for (var index = 0; index < list.length; index++) { 13 | potentialNode(index); 14 | await pause(); 15 | if (numbers[index].value == target) { 16 | foundNode(index); 17 | return; 18 | } else { 19 | discardNode(index); 20 | } 21 | } 22 | nodeNotFound(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/models/sort_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | enum SortState { 4 | open, 5 | sort, 6 | sorted, 7 | pivot, 8 | } 9 | 10 | class SortModel { 11 | SortModel(this.value) : key = GlobalKey() { 12 | state = SortState.open; 13 | color = Colors.black54; 14 | } 15 | 16 | final int value; 17 | final GlobalKey key; 18 | SortState state; 19 | Color color; 20 | 21 | void reset() { 22 | state = SortState.open; 23 | color = Colors.black54; 24 | } 25 | 26 | void sort() { 27 | state = SortState.sort; 28 | color = Colors.blue; 29 | } 30 | 31 | void sorted() { 32 | state = SortState.sorted; 33 | color = Colors.green; 34 | } 35 | 36 | void pivot() { 37 | state = SortState.pivot; 38 | color = Colors.pink; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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/models/search_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | enum SearchState { open, discard, search, searched, found } 4 | 5 | class SearchModel { 6 | SearchModel(this.value) 7 | : state = ValueNotifier(SearchState.open), 8 | color = Colors.black54, 9 | key = GlobalKey(); 10 | 11 | final int value; 12 | ValueNotifier state; 13 | Color color; 14 | GlobalKey key; 15 | 16 | void reset() { 17 | state.value = SearchState.open; 18 | color = Colors.black54; 19 | } 20 | 21 | void potential() { 22 | state.value = SearchState.search; 23 | color = Colors.blue; 24 | } 25 | 26 | void discard() { 27 | state.value = SearchState.discard; 28 | color = Colors.red; 29 | } 30 | 31 | void found() { 32 | state.value = SearchState.found; 33 | color = Colors.green; 34 | } 35 | 36 | void searched() { 37 | state.value = SearchState.searched; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/ux/widgets/search/search_speed.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/search/search_provider.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:provider/provider.dart'; 4 | 5 | class SearchSpeed extends StatelessWidget { 6 | const SearchSpeed({Key key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Column( 11 | children: [ 12 | Text('Search Speed', style: Theme.of(context).textTheme.caption), 13 | Consumer( 14 | builder: (context, provider, child) { 15 | return Container( 16 | constraints: const BoxConstraints(maxWidth: 300), 17 | child: Slider( 18 | value: provider.executionSpeed, 19 | onChanged: (value) => provider.executionSpeed = value, 20 | ), 21 | ); 22 | }, 23 | ), 24 | ], 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/providers/sort/insertion_sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/models/sort_model.dart'; 2 | import 'package:algorithms_visualizer/providers/sort/sort_provider.dart'; 3 | 4 | class InsertionSortProvider extends SortProvider { 5 | @override 6 | void sort() { 7 | super.sort(); 8 | _startSort(numbers); 9 | } 10 | 11 | Future _startSort(List list) async { 12 | for (var i = 0; i < list.length; i++) { 13 | if (i > 1) { 14 | markNodesAsNotSorted(0, i - 2); 15 | } 16 | for (var j = i; j > 0 && (list[j].value < list[j - 1].value); j--) { 17 | markNodesForSorting(j - 1, j); 18 | await pause(); 19 | render(); 20 | final tmp = list[j]; 21 | list[j] = list[j - 1]; 22 | list[j - 1] = tmp; 23 | await pause(); 24 | render(); 25 | markNodeAsNotSorted(j); 26 | } 27 | } 28 | markNodesAsSorted(0, list.length - 1); 29 | setStateToSorted(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/alogrithms/sort/quick_sort.dart: -------------------------------------------------------------------------------- 1 | List quickSort(List list) { 2 | return _helper(list, 0, list.length - 1); 3 | } 4 | 5 | List _helper(List list, int start, int end) { 6 | if (start >= end) { 7 | return list; 8 | } 9 | 10 | final pivot = start; // pivot pointer 11 | var leftP = start + 1; // left pointer 12 | var rightP = end; // right pointer 13 | 14 | while (rightP >= leftP) { 15 | if (list[leftP] > list[pivot] && list[rightP] < list[pivot]) { 16 | final tmp = list[leftP]; 17 | list[leftP] = list[rightP]; 18 | list[rightP] = tmp; 19 | } 20 | if (list[leftP] <= list[pivot]) { 21 | leftP++; 22 | } 23 | if (list[rightP] >= list[pivot]) { 24 | rightP--; 25 | } 26 | } 27 | 28 | final tmp = list[pivot]; 29 | list[pivot] = list[rightP]; 30 | list[rightP] = tmp; 31 | 32 | if (rightP - 1 - start < end - (rightP + 1)) { 33 | _helper(list, start, rightP - 1); 34 | _helper(list, rightP + 1, end); 35 | } else { 36 | _helper(list, rightP + 1, end); 37 | _helper(list, start, rightP - 1); 38 | } 39 | 40 | return list; 41 | } 42 | -------------------------------------------------------------------------------- /lib/ux/widgets/search/search_visualizer.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/models/search_model.dart'; 2 | import 'package:algorithms_visualizer/providers/search/search_provider.dart'; 3 | import 'package:algorithms_visualizer/ux/widgets/search/search_widget.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:provider/provider.dart'; 6 | 7 | class SearchVisualizer extends StatelessWidget { 8 | const SearchVisualizer({ 9 | Key key, 10 | }) : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Center( 15 | child: Selector>( 16 | selector: (context, provider) => provider.numbers, 17 | builder: (_, numbers, __) { 18 | return Wrap( 19 | alignment: WrapAlignment.center, 20 | crossAxisAlignment: WrapCrossAlignment.center, 21 | children: [ 22 | for (var number in numbers) 23 | SearchWidget( 24 | number: number, 25 | ) 26 | ], 27 | ); 28 | }, 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/providers/sort/bubble_sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/models/sort_model.dart'; 2 | import 'package:algorithms_visualizer/providers/sort/sort_provider.dart'; 3 | 4 | class BubbleSortProvider extends SortProvider { 5 | @override 6 | void sort() { 7 | super.sort(); 8 | _startSort(numbers); 9 | } 10 | 11 | Future _startSort(List list) async { 12 | var sorted = false; 13 | var counter = 0; 14 | 15 | while (!sorted) { 16 | sorted = true; 17 | for (var i = 0; i < list.length - 1 - counter; i++) { 18 | markNodesForSorting(i, i + 1); 19 | render(); 20 | if (list[i].value > list[i + 1].value) { 21 | await pause(); 22 | final tmp = list[i]; 23 | list[i] = list[i + 1]; 24 | list[i + 1] = tmp; 25 | sorted = false; 26 | render(); 27 | } 28 | await pause(); 29 | markNodesAsNotSorted(0, i); 30 | } 31 | markNodeAsSorted(list.length - 1 - counter); 32 | counter++; 33 | } 34 | markNodesAsSorted(0, list.length - 1 - counter); 35 | setStateToSorted(); 36 | render(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /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:algorithms_visualizer/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 | -------------------------------------------------------------------------------- /lib/ux/pages/home/widgets/category_switcher.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/ux/pages/home/widgets/category_widget.dart'; 2 | import 'package:algorithms_visualizer/ux/providers/pages_provider.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class CategorySwitcher extends StatelessWidget { 7 | const CategorySwitcher({ 8 | Key key, 9 | }) : super(key: key); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Consumer( 14 | builder: (_, homeProvider, child) { 15 | return AnimatedSwitcher( 16 | duration: const Duration(seconds: 1), 17 | transitionBuilder: (child, animation) { 18 | return SlideTransition( 19 | position: Tween( 20 | begin: const Offset(1, 0), 21 | end: const Offset(0, 0), 22 | ).animate( 23 | CurvedAnimation(parent: animation, curve: Curves.ease), 24 | ), 25 | child: child); 26 | }, 27 | child: CategoryWidget( 28 | pages: homeProvider.pages, 29 | key: ValueKey(homeProvider.categoryKey), 30 | ), 31 | ); 32 | }, 33 | ); 34 | } 35 | } -------------------------------------------------------------------------------- /lib/providers/search/binary_search_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/models/search_model.dart'; 2 | import 'package:algorithms_visualizer/providers/search/search_provider.dart'; 3 | 4 | class BinarySearchProvider extends SearchProvider { 5 | @override 6 | void search({int value = 34}) { 7 | super.search(); 8 | _startBinarySearch(numbers, value); 9 | } 10 | 11 | Future _startBinarySearch(List list, int target) async { 12 | return _binarySearchHelper(list, target, 0, list.length - 1); 13 | } 14 | 15 | Future _binarySearchHelper( 16 | List list, int target, int left, int right) async { 17 | while (left <= right) { 18 | final middle = (left + right) ~/ 2; 19 | potentialNode(middle); 20 | await pause(); 21 | final potentialMatch = list[middle].value; 22 | if (target == potentialMatch) { 23 | foundNode(middle); 24 | return middle; 25 | } else if (target < potentialMatch) { 26 | discardNodes(middle + 1, right); 27 | await pause(); 28 | 29 | right = middle - 1; 30 | } else { 31 | discardNodes(left, middle - 1); 32 | await pause(); 33 | 34 | left = middle + 1; 35 | } 36 | searchedNode(middle); 37 | } 38 | nodeNotFound(); 39 | return -1; // not found 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/ux/widgets/sort/sort_speed.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/sort/sort_provider.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:provider/provider.dart'; 4 | 5 | class SortSpeed extends StatelessWidget { 6 | const SortSpeed({Key key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | // return Selector( 11 | // selector: (_, bubble) => bubble.sortSpeed, 12 | // builder: (_, value, child) { 13 | // return Slider( 14 | // value: value, 15 | // onChanged: (val) { 16 | // // value = val; 17 | // Provider.of(context, listen: false) 18 | // .sortSpeed = val; 19 | // }, 20 | // ); 21 | // }); 22 | return Column( 23 | children: [ 24 | Text('Sort Speed', style: Theme.of(context).textTheme.caption), 25 | Selector( 26 | selector: (context, provider) => provider.executionSpeed, 27 | builder: (context, executionSpeed, child) { 28 | return Container( 29 | constraints: const BoxConstraints(maxWidth: 300), 30 | child: Slider( 31 | value: executionSpeed, 32 | onChanged: (value) => Provider.of(context, listen: false) 33 | .executionSpeed = value, 34 | ), 35 | ); 36 | }, 37 | ), 38 | ], 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/ux/widgets/sort/sort_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/sort/sort_provider.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:provider/provider.dart'; 4 | 5 | class SortButton extends StatelessWidget { 6 | const SortButton({ 7 | Key key, 8 | }) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | // return Selector( 13 | // selector: (_, bubble) => bubble.isSorting, 14 | // builder: (_, data, child) { 15 | // return RaisedButton( 16 | // onPressed: data 17 | // ? null 18 | // : () { 19 | // Provider.of(context, listen: false) 20 | // .sort(); 21 | // }, 22 | // child: child); 23 | // }, 24 | // child: const Text('Sort')); 25 | return Padding( 26 | padding: const EdgeInsets.all(8.0), 27 | child: Selector( 28 | selector: (_, provider) => provider.isSorting, 29 | builder: (_, isSorting, child) { 30 | return RaisedButton( 31 | child: child, 32 | color: Colors.blue, 33 | disabledColor: Colors.blueGrey, 34 | onPressed: isSorting 35 | ? null 36 | : () { 37 | Provider.of(context, listen: false).sort(); 38 | }, 39 | ); 40 | }, 41 | child: const Text('Sort', style: TextStyle(color: Colors.white)), 42 | ), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/ux/pages/sort_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/sort/sort_provider.dart'; 2 | import 'package:algorithms_visualizer/ux/widgets/sort/sort_speed.dart'; 3 | import 'package:algorithms_visualizer/ux/widgets/sort/sort_visualizer.dart'; 4 | import 'package:algorithms_visualizer/ux/widgets/sort/sort_button.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class SortPage extends StatelessWidget { 8 | const SortPage({Key key, @required this.title, this.blockSize = 100}) 9 | : assert(title != null), 10 | super(key: key); 11 | 12 | final String title; 13 | final double blockSize; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return LayoutBuilder(builder: (_, constraints) { 18 | return Center( 19 | child: Column( 20 | mainAxisAlignment: MainAxisAlignment.spaceAround, 21 | children: [ 22 | Padding( 23 | padding: const EdgeInsets.only(top: 32.0), 24 | child: Text(title, style: Theme.of(context).textTheme.headline4), 25 | ), 26 | //Cannot be const 27 | Expanded( 28 | child: Container( 29 | width: constraints.maxWidth, 30 | child: Center( 31 | child: SortVisualizer( 32 | blockSize: blockSize, 33 | width: constraints.maxWidth, 34 | ), 35 | ), 36 | ), 37 | ), 38 | SortSpeed(), 39 | SortButton(), 40 | ], 41 | ), 42 | ); 43 | }); 44 | // return 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/ux/widgets/sort/sort_visualizer.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/sort/sort_provider.dart'; 2 | import 'package:algorithms_visualizer/ux/widgets/sort/sort_widget.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class SortVisualizer extends StatelessWidget { 7 | const SortVisualizer({ 8 | Key key, 9 | this.blockSize = 100, 10 | @required this.width, 11 | }) : super(key: key); 12 | 13 | final double blockSize; 14 | final double width; 15 | 16 | double _getHeight(double width, int numOfWidgets) { 17 | final horizontalFit = width ~/ blockSize; 18 | final rows = (numOfWidgets / horizontalFit).ceil(); 19 | return rows * blockSize; 20 | } 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return SingleChildScrollView( 25 | child: Consumer( 26 | builder: (_, provider, __) { 27 | return SizedBox( 28 | width: width, 29 | height: _getHeight( 30 | width, 31 | provider.numbers.length, 32 | ), 33 | child: Stack( 34 | children: [ 35 | for (var i = 0; i < provider.numbers.length; i++) 36 | SortWidget( 37 | key: provider.numbers[i].key, 38 | number: provider.numbers[i], 39 | index: i, 40 | widgetSize: blockSize, 41 | containerWidth: width, 42 | ) 43 | ], 44 | ), 45 | ); 46 | }, 47 | ), 48 | ); 49 | // child: 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /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/ux/pages/home/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/utils/screen_size.dart'; 2 | import 'package:algorithms_visualizer/ux/pages/home/widgets/category_switcher.dart'; 3 | import 'package:algorithms_visualizer/ux/pages/home/widgets/configuration_widget.dart'; 4 | import 'package:algorithms_visualizer/ux/providers/pages_provider.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:provider/provider.dart'; 7 | 8 | class Home extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return ChangeNotifierProvider( 12 | create: (_) => PagesProvider(), 13 | child: deviceScreenType(MediaQuery.of(context).size.width) == 14 | DeviceScreenType.Desktop 15 | ? const HomeDesktop() 16 | : const HomeMobile(), 17 | ); 18 | } 19 | } 20 | 21 | class HomeMobile extends StatelessWidget { 22 | const HomeMobile({Key key}) : super(key: key); 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Column( 27 | children: const [ 28 | ConfigurationWidget(), 29 | Expanded( 30 | child: CategorySwitcher(), 31 | ) 32 | ], 33 | ); 34 | } 35 | } 36 | 37 | class HomeDesktop extends StatelessWidget { 38 | const HomeDesktop({ 39 | Key key, 40 | }) : super(key: key); 41 | 42 | @override 43 | Widget build(BuildContext context) { 44 | return Center( 45 | child: Row( 46 | children: const [ 47 | Expanded( 48 | child: ConfigurationWidget(), 49 | ), 50 | Expanded( 51 | child: CategorySwitcher(), 52 | ), 53 | ], 54 | ), 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | binary_search 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 | -------------------------------------------------------------------------------- /lib/ux/widgets/search/search_message.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/search/search_provider.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:provider/provider.dart'; 4 | 5 | class SearchMessage extends StatefulWidget { 6 | const SearchMessage({ 7 | Key key, 8 | }) : super(key: key); 9 | 10 | @override 11 | _SearchMessageState createState() => _SearchMessageState(); 12 | } 13 | 14 | class _SearchMessageState 15 | extends State> { 16 | var _fontSize = 16.0; 17 | 18 | var _color = Colors.black; 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Selector( 23 | selector: (_, provider) => provider.position, 24 | builder: (_, position, __) { 25 | String outputMessage; 26 | if (position == -2) { 27 | outputMessage = ''; 28 | _fontSize = 0; 29 | _color = Colors.black; 30 | } else if (position == -1) { 31 | outputMessage = 'Value not found'; 32 | _fontSize = 24; 33 | _color = Colors.red; 34 | } else { 35 | outputMessage = 36 | 'Value found at position: ${(position + 1).toString()}'; 37 | _fontSize = 24; 38 | _color = Colors.black; 39 | } 40 | return Container( 41 | height: 50, 42 | child: AnimatedDefaultTextStyle( 43 | duration: const Duration(milliseconds: 400), 44 | curve: Curves.ease, 45 | style: Theme.of(context).textTheme.headline5.copyWith( 46 | fontSize: _fontSize, 47 | color: _color, 48 | ), 49 | child: Text( 50 | outputMessage, 51 | ), 52 | ), 53 | ); 54 | }); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/providers/sort/selection_sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/models/sort_model.dart'; 2 | import 'package:algorithms_visualizer/providers/sort/sort_provider.dart'; 3 | 4 | class SelectionSortProvider extends SortProvider { 5 | @override 6 | void sort() { 7 | super.sort(); 8 | _startSort(numbers); 9 | } 10 | 11 | Future _startSort(List list) async { 12 | for (var currentIndex = 0; 13 | currentIndex <= list.length - 1; 14 | currentIndex++) { 15 | var smallestIndex = currentIndex; 16 | await _markSmallestAndRender(smallestIndex); 17 | for (var i = currentIndex + 1; i < list.length; i++) { 18 | await _markInterestedAndRender(i); 19 | if (list[i].value < list[smallestIndex].value) { 20 | _resetStateAndRender(smallestIndex); 21 | smallestIndex = i; 22 | await _markSmallestAndRender(i); 23 | } else { 24 | await _resetStateAndRender(i); 25 | } 26 | } 27 | _markSortedAndRender(smallestIndex); 28 | final tmp = list[currentIndex]; 29 | list[currentIndex] = list[smallestIndex]; 30 | list[smallestIndex] = tmp; 31 | } 32 | 33 | setStateToSortedAndRender(); 34 | return list; 35 | } 36 | 37 | Future _resetStateAndRender(int index) async { 38 | markNodeAsNotSorted(index); 39 | render(); 40 | pause(); 41 | } 42 | 43 | Future _markInterestedAndRender(int index) async { 44 | markNodeForSorting(index); 45 | render(); 46 | await pause(); 47 | } 48 | 49 | Future _markSmallestAndRender(int index) async { 50 | markNodeAsPivot(index); 51 | render(); 52 | await pause(); 53 | } 54 | 55 | Future _markSortedAndRender(int index) async { 56 | markNodeAsSorted(index); 57 | render(); 58 | await pause(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/sort/insertion_sort_provider.dart'; 2 | import 'package:algorithms_visualizer/providers/sort/quick_sort_provider.dart'; 3 | import 'package:algorithms_visualizer/providers/sort/selection_sort_provider.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:provider/provider.dart'; 6 | import 'package:algorithms_visualizer/providers/search/linear_search_provider.dart'; 7 | import 'package:algorithms_visualizer/providers/search/binary_search_provider.dart'; 8 | import 'package:algorithms_visualizer/providers/sort/bubble_sort_provider.dart'; 9 | import 'package:algorithms_visualizer/ux/pages/home/home.dart'; 10 | 11 | void main() => runApp(MyApp()); 12 | 13 | class MyApp extends StatelessWidget { 14 | @override 15 | Widget build(BuildContext context) { 16 | return MaterialApp( 17 | title: 'Algorithms', 18 | debugShowCheckedModeBanner: false, 19 | // showPerformanceOverlay: true, 20 | home: Scaffold( 21 | body: MultiProvider( 22 | providers: [ 23 | ChangeNotifierProvider( 24 | create: (_) => LinearSearchProvider(), 25 | ), 26 | ChangeNotifierProvider( 27 | create: (_) => BinarySearchProvider(), 28 | ), 29 | ChangeNotifierProvider( 30 | create: (_) => BubbleSortProvider(), 31 | ), 32 | ChangeNotifierProvider( 33 | create: (_) => InsertionSortProvider(), 34 | ), 35 | ChangeNotifierProvider( 36 | create: (_) => QuickSortProvider(), 37 | ), 38 | ChangeNotifierProvider( 39 | create: (_) => SelectionSortProvider(), 40 | ) 41 | ], 42 | child: Home(), 43 | ), 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/ux/pages/search_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/search/search_provider.dart'; 2 | import 'package:algorithms_visualizer/ux/widgets/search/search.dart'; 3 | import 'package:algorithms_visualizer/ux/widgets/search/search_indicator.dart'; 4 | import 'package:algorithms_visualizer/ux/widgets/search/search_message.dart'; 5 | import 'package:algorithms_visualizer/ux/widgets/search/search_speed.dart'; 6 | import 'package:algorithms_visualizer/ux/widgets/search/search_visualizer.dart'; 7 | import 'package:flutter/material.dart'; 8 | 9 | class SearchPage extends StatelessWidget { 10 | SearchPage({Key key, @required this.title}) 11 | : assert(title != null), 12 | super(key: key); 13 | 14 | final String title; 15 | 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | GlobalKey key = GlobalKey(debugLabel: title); 20 | return Stack( 21 | key: key, 22 | children: [ 23 | Column( 24 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 25 | children: [ 26 | Padding( 27 | padding: const EdgeInsets.only(top: 32.0), 28 | child: Text( 29 | title, 30 | style: Theme.of(context).textTheme.headline4, 31 | ), 32 | ), 33 | const SizedBox(height: 24), 34 | //Below can not be constant 35 | Expanded( 36 | child: SearchVisualizer(), 37 | ), 38 | SearchMessage(), 39 | const SizedBox(height: 24), 40 | SearchSpeed(), 41 | Search(), 42 | const SizedBox(height: 24), 43 | ], 44 | ), 45 | SearchIndicator( 46 | parentKey: key, 47 | ), 48 | ], 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /lib/ux/providers/pages_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/search/binary_search_provider.dart'; 2 | import 'package:algorithms_visualizer/providers/search/linear_search_provider.dart'; 3 | import 'package:algorithms_visualizer/providers/sort/bubble_sort_provider.dart'; 4 | import 'package:algorithms_visualizer/providers/sort/insertion_sort_provider.dart'; 5 | import 'package:algorithms_visualizer/providers/sort/quick_sort_provider.dart'; 6 | import 'package:algorithms_visualizer/providers/sort/selection_sort_provider.dart'; 7 | import 'package:algorithms_visualizer/ux/pages/search_page.dart'; 8 | import 'package:algorithms_visualizer/ux/pages/sort_page.dart'; 9 | import 'package:flutter/material.dart'; 10 | 11 | class PagesProvider extends ChangeNotifier { 12 | String categoryKey = 'Search'; 13 | 14 | final _searchPages = [ 15 | SearchPage(title: 'Linear Search'), 16 | SearchPage(title: 'Binary Search'), 17 | ]; 18 | final _sortPages = [ 19 | const SortPage(title: 'Selection Sort'), 20 | const SortPage( 21 | title: 'Quick Sort', 22 | blockSize: 70, 23 | ), 24 | const SortPage(title: 'Bubble Sort'), 25 | const SortPage( 26 | title: 'Insertion Sort', 27 | ), 28 | ]; 29 | 30 | void changeKey(String key) { 31 | categoryKey = key; 32 | notifyListeners(); 33 | } 34 | 35 | List get pages { 36 | // if (categoryKey == 'Search') { 37 | // return 38 | // } 39 | switch (categoryKey) { 40 | case 'Search': 41 | return _searchPages; 42 | break; 43 | case 'Sort': 44 | return _sortPages; 45 | break; 46 | default: 47 | return _searchPages; 48 | break; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/providers/search/search_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/base_provider.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:algorithms_visualizer/models/search_model.dart'; 4 | 5 | abstract class SearchProvider extends BaseProvider { 6 | final List numbers = [ 7 | SearchModel(0), 8 | SearchModel(1), 9 | SearchModel(4), 10 | SearchModel(11), 11 | SearchModel(19), 12 | SearchModel(22), 13 | SearchModel(34), 14 | SearchModel(35), 15 | SearchModel(38), 16 | SearchModel(39), 17 | SearchModel(44), 18 | SearchModel(46), 19 | SearchModel(47), 20 | SearchModel(49), 21 | SearchModel(57), 22 | SearchModel(62), 23 | SearchModel(69), 24 | SearchModel(74), 25 | ]; 26 | 27 | bool _isSearching = false; 28 | int _position = -2; 29 | 30 | bool get isSearching => _isSearching; 31 | int get position => _position; 32 | 33 | @mustCallSuper 34 | void search({int value = 34}) { 35 | reset(); 36 | _isSearching = true; 37 | } 38 | 39 | @protected 40 | void reset() { 41 | _isSearching = false; 42 | _position = -2; 43 | for (var number in numbers) { 44 | number.reset(); 45 | } 46 | notifyListeners(); 47 | } 48 | 49 | @protected 50 | void potentialNode(int index) { 51 | numbers[index].potential(); 52 | notifyListeners(); 53 | } 54 | 55 | @protected 56 | void searchedNode(int index) { 57 | numbers[index].searched(); 58 | notifyListeners(); 59 | } 60 | 61 | @protected 62 | void discardNode(int index) { 63 | numbers[index].discard(); 64 | notifyListeners(); 65 | } 66 | 67 | @protected 68 | void discardNodes(int left, int right) { 69 | for (var index = left; index <= right; index++) { 70 | numbers[index].discard(); 71 | } 72 | notifyListeners(); 73 | } 74 | 75 | @protected 76 | void foundNode(int index) { 77 | _isSearching = false; 78 | numbers[index].found(); 79 | _position = index; 80 | notifyListeners(); 81 | } 82 | 83 | @protected 84 | void nodeNotFound() { 85 | _isSearching = false; 86 | _position = -1; 87 | notifyListeners(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /lib/providers/sort/quick_sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/models/sort_model.dart'; 2 | import 'package:algorithms_visualizer/providers/sort/sort_provider.dart'; 3 | 4 | class QuickSortProvider extends SortProvider { 5 | @override 6 | void sort() { 7 | super.sort(); 8 | _startSort(numbers); 9 | } 10 | 11 | Future _startSort(List list) async { 12 | await _helper(list, 0, list.length - 1); 13 | markNodesAsSorted(0, list.length - 1); 14 | setStateToSorted(); 15 | render(); 16 | } 17 | 18 | Future> _helper( 19 | List list, int start, int end) async { 20 | if (start >= end) { 21 | if (start == end) { 22 | markNodeAsSorted(start); 23 | render(); 24 | await pause(); 25 | } 26 | return list; 27 | } 28 | 29 | final pivot = start; // pivot pointer 30 | var leftP = start + 1; // left pointer 31 | var rightP = end; // right pointer 32 | 33 | while (rightP >= leftP) { 34 | markNodeAsPivot(pivot); 35 | markNodeForSorting(leftP); 36 | markNodeForSorting(rightP); 37 | render(); 38 | await pause(); 39 | if (list[leftP].value > list[pivot].value && 40 | list[rightP].value < list[pivot].value) { 41 | final tmp = list[leftP]; 42 | list[leftP] = list[rightP]; 43 | list[rightP] = tmp; 44 | render(); 45 | await pause(); 46 | } 47 | if (list[leftP].value <= list[pivot].value) { 48 | markNodeAsNotSorted(leftP); 49 | leftP++; 50 | } 51 | if (list[rightP].value >= list[pivot].value) { 52 | markNodeAsNotSorted(rightP); 53 | rightP--; 54 | } 55 | } 56 | markNodeForSorting(rightP); 57 | render(); 58 | await pause(); 59 | final tmp = list[pivot]; 60 | list[pivot] = list[rightP]; 61 | list[rightP] = tmp; 62 | markNodeAsSorted(rightP); 63 | render(); 64 | await pause(); 65 | 66 | if (rightP - 1 - start < end - (rightP + 1)) { 67 | await _helper(list, start, rightP - 1); 68 | await _helper(list, rightP + 1, end); 69 | } else { 70 | await _helper(list, rightP + 1, end); 71 | await _helper(list, start, rightP - 1); 72 | } 73 | 74 | return list; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.binary_search" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 67 | } 68 | -------------------------------------------------------------------------------- /lib/ux/widgets/search/search.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/providers/search/search_provider.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/services.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class Search extends StatefulWidget { 7 | const Search({ 8 | Key key, 9 | }) : super(key: key); 10 | 11 | @override 12 | _SearchState createState() => _SearchState(); 13 | } 14 | 15 | class _SearchState extends State> { 16 | final searchController = TextEditingController(); 17 | 18 | void _search() { 19 | try { 20 | final val = int.parse(searchController.text); 21 | Provider.of(context, listen: false).search(value: val); 22 | } catch (e) { 23 | print(e); 24 | } 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Row( 30 | mainAxisAlignment: MainAxisAlignment.center, 31 | children: [ 32 | Container( 33 | width: 100, 34 | child: TextField( 35 | controller: searchController, 36 | decoration: const InputDecoration( 37 | labelText: 'Value', 38 | ), 39 | inputFormatters: [ 40 | WhitelistingTextInputFormatter.digitsOnly 41 | ], 42 | keyboardType: TextInputType.number, 43 | ), 44 | ), 45 | // Selector( 46 | // selector: (_, searchProvider) => searchProvider.isSearching, 47 | // builder: (_, isSearching, child) { 48 | // return RaisedButton( 49 | // onPressed: isSearching ? null : _search, 50 | // child: child, 51 | // ); 52 | // }, 53 | // child: const Text('Search'), 54 | // ) 55 | 56 | Selector( 57 | selector: (_, provider) => provider.isSearching, 58 | builder: (_, isSearching, child) { 59 | return RaisedButton( 60 | color: Colors.blue, 61 | disabledColor: Colors.blueGrey, 62 | onPressed: isSearching ? null : _search, 63 | child: child, 64 | ); 65 | }, 66 | child: const Text('Search', style: TextStyle(color: Colors.white)), 67 | ) 68 | ], 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/ux/widgets/search/search_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:after_layout/after_layout.dart'; 2 | import 'package:algorithms_visualizer/models/search_model.dart'; 3 | import 'package:algorithms_visualizer/providers/search/search_provider.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:provider/provider.dart'; 6 | 7 | class SearchIndicator extends StatefulWidget { 8 | const SearchIndicator({ 9 | Key key, 10 | @required this.parentKey, 11 | }) : super(key: key); 12 | 13 | final GlobalKey parentKey; 14 | @override 15 | _SearchIndicatorState createState() => _SearchIndicatorState(); 16 | } 17 | 18 | class _SearchIndicatorState 19 | extends State> 20 | with AfterLayoutMixin> { 21 | var _position = Offset.zero; 22 | 23 | @override 24 | void afterFirstLayout(BuildContext context) { 25 | final numbers = Provider.of(context, listen: false).numbers; 26 | setState(() { 27 | _position = _getIndicatorOffset(numbers[numbers.length ~/ 2]); 28 | }); 29 | } 30 | 31 | Offset _getIndicatorOffset(SearchModel number) { 32 | var pos = Offset.zero; 33 | try { 34 | final RenderBox rObject = number.key.currentContext.findRenderObject(); 35 | final RenderBox parentObject = 36 | widget.parentKey.currentContext.findRenderObject(); 37 | final parentPos = parentObject.localToGlobal(const Offset(0, 0)); 38 | pos = -rObject.globalToLocal(parentPos); 39 | } catch (e) { 40 | print(e); 41 | } 42 | return pos; 43 | } 44 | 45 | @override 46 | Widget build(BuildContext context) { 47 | return Consumer( 48 | builder: (_, searchProvider, child) { 49 | for (var number in searchProvider.numbers) { 50 | if (number.state.value == SearchState.search) { 51 | _position = _getIndicatorOffset(number); 52 | break; 53 | } 54 | } 55 | return AnimatedPositioned( 56 | duration: const Duration(milliseconds: 400), 57 | curve: Curves.ease, 58 | left: _position.dx, 59 | top: _position.dy, 60 | child: Visibility(visible: searchProvider.isSearching, child: child), 61 | ); 62 | }, 63 | child: Container( 64 | height: 60, 65 | width: 60, 66 | decoration: BoxDecoration( 67 | border: Border.all(), 68 | borderRadius: const BorderRadius.all( 69 | Radius.circular(5.0), 70 | ), 71 | ), 72 | ), 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/providers/sort/sort_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/models/sort_model.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../base_provider.dart'; 5 | 6 | abstract class SortProvider extends BaseProvider { 7 | List numbers = [ 8 | SortModel(22), 9 | SortModel(4), 10 | SortModel(38), 11 | SortModel(1), 12 | SortModel(11), 13 | SortModel(34), 14 | SortModel(19), 15 | SortModel(46), 16 | SortModel(0), 17 | SortModel(62), 18 | SortModel(74), 19 | SortModel(35), 20 | SortModel(39), 21 | SortModel(44), 22 | SortModel(49), 23 | SortModel(47), 24 | SortModel(57), 25 | SortModel(69), 26 | ]; 27 | 28 | bool _isSorting = false; 29 | bool get isSorting => _isSorting; 30 | 31 | bool _isSorted = false; 32 | bool get isSorted => _isSorted; 33 | 34 | @mustCallSuper 35 | void sort() { 36 | reset(); 37 | _isSorting = true; 38 | } 39 | 40 | @protected 41 | void reset() { 42 | _isSorting = false; 43 | _isSorted = false; 44 | for (final number in numbers) { 45 | number.reset(); 46 | } 47 | numbers.shuffle(); 48 | notifyListeners(); 49 | } 50 | 51 | @protected 52 | void markNodeAsNotSorted(int index) { 53 | numbers[index].reset(); 54 | } 55 | 56 | @protected 57 | void markNodesAsNotSorted(int left, int right) { 58 | if (left < 0 || right > numbers.length - 1 || left > right) { 59 | print('left: $left, right: $right'); 60 | return; 61 | } 62 | for (var index = left; index <= right; index++) { 63 | numbers[index].reset(); 64 | } 65 | } 66 | 67 | @protected 68 | void markNodeForSorting(int index) { 69 | if (index < 0 || index >= numbers.length) { 70 | return; 71 | } 72 | numbers[index].sort(); 73 | } 74 | 75 | @protected 76 | void markNodesForSorting(int indexOne, int indexTwo) { 77 | numbers[indexOne].sort(); 78 | numbers[indexTwo].sort(); 79 | } 80 | 81 | @protected 82 | void markNodeAsSorted(int index) { 83 | numbers[index].sorted(); 84 | } 85 | 86 | @protected 87 | void markNodesAsSorted(int left, int right) { 88 | for (var i = left; i <= right; i++) { 89 | numbers[i].sorted(); 90 | } 91 | } 92 | 93 | @protected 94 | void markNodeAsPivot(int index) { 95 | numbers[index].pivot(); 96 | } 97 | 98 | @protected 99 | void setStateToSorted() { 100 | _isSorting = false; 101 | _isSorted = true; 102 | } 103 | 104 | @protected 105 | void setStateToSortedAndRender() { 106 | _isSorting = false; 107 | _isSorted = true; 108 | render(); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /lib/ux/widgets/sort/sort_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/models/sort_model.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class SortWidget extends StatelessWidget { 5 | const SortWidget({ 6 | Key key, 7 | @required this.number, 8 | @required this.index, 9 | @required this.widgetSize, @required this.containerWidth, 10 | }) : assert(number != null && index != null && widgetSize != null), 11 | assert(index >= 0 && widgetSize > 30), 12 | super(key: key); 13 | 14 | final SortModel number; 15 | final int index; 16 | final double widgetSize; 17 | final double containerWidth; 18 | 19 | 20 | Offset _getPosition(double width) { 21 | final horizontalFit = width ~/ widgetSize; 22 | final leftOver = width - (horizontalFit * widgetSize); 23 | final verticalIndex = index ~/ horizontalFit; 24 | final horizontalIndex = index % horizontalFit; 25 | return Offset((widgetSize * horizontalIndex) + leftOver / 2, 26 | widgetSize * verticalIndex); 27 | } 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | final offset = _getPosition(containerWidth); 32 | 33 | var _fontSize = 20.0; 34 | var _borderRadius = 5.0; 35 | var _borderWidth = 1.0; 36 | var _borderColor = Colors.black54; 37 | if (number.state == SortState.sort) { 38 | _fontSize = 32; 39 | _borderRadius = 40.0; 40 | _borderWidth = 2.0; 41 | } else if (number.state == SortState.sorted) { 42 | _fontSize = 20; 43 | _borderRadius = 5.0; 44 | _borderWidth = 1.0; 45 | _borderColor = Colors.green; 46 | } 47 | 48 | return AnimatedPositioned( 49 | duration: const Duration(milliseconds: 2250), 50 | curve: Curves.elasticOut, 51 | left: offset.dx, 52 | top: offset.dy, 53 | child: SizedBox( 54 | width: widgetSize, 55 | height: widgetSize, 56 | child: Padding( 57 | padding: const EdgeInsets.all(8.0), 58 | child: AnimatedContainer( 59 | duration: const Duration(milliseconds: 400), 60 | curve: Curves.ease, 61 | decoration: BoxDecoration( 62 | border: Border.all( 63 | color: _borderColor, 64 | width: _borderWidth, 65 | ), 66 | borderRadius: BorderRadius.all( 67 | Radius.circular(_borderRadius), 68 | ), 69 | ), 70 | child: Center( 71 | child: AnimatedDefaultTextStyle( 72 | duration: const Duration(milliseconds: 400), 73 | curve: Curves.ease, 74 | style: TextStyle( 75 | color: number.color, 76 | fontSize: _fontSize, 77 | ), 78 | child: Text( 79 | number.value.toString(), 80 | ), 81 | ), 82 | ), 83 | ), 84 | ), 85 | ), 86 | ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: algorithms_visualizer 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.2.2 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | provider: ^3.1.0+1 24 | after_layout: ^1.0.7+2 25 | dots_indicator: ^1.1.0 26 | 27 | # The following adds the Cupertino Icons font to your application. 28 | # Use with the CupertinoIcons class for iOS style icons. 29 | cupertino_icons: ^0.1.2 30 | 31 | dev_dependencies: 32 | flutter_test: 33 | sdk: flutter 34 | 35 | 36 | # For information on the generic Dart part of this file, see the 37 | # following page: https://dart.dev/tools/pub/pubspec 38 | 39 | # The following section is specific to Flutter. 40 | flutter: 41 | 42 | # The following line ensures that the Material Icons font is 43 | # included with your application, so that you can use the icons in 44 | # the material Icons class. 45 | uses-material-design: true 46 | 47 | # To add assets to your application, add an assets section, like this: 48 | # assets: 49 | # - images/a_dot_burr.jpeg 50 | # - images/a_dot_ham.jpeg 51 | 52 | # An image asset can refer to one or more resolution-specific "variants", see 53 | # https://flutter.dev/assets-and-images/#resolution-aware. 54 | 55 | # For details regarding adding assets from package dependencies, see 56 | # https://flutter.dev/assets-and-images/#from-packages 57 | 58 | # To add custom fonts to your application, add a fonts section here, 59 | # in this "flutter" section. Each entry in this list should have a 60 | # "family" key with the font family name, and a "fonts" key with a 61 | # list giving the asset and other descriptors for the font. For 62 | # example: 63 | # fonts: 64 | # - family: Schyler 65 | # fonts: 66 | # - asset: fonts/Schyler-Regular.ttf 67 | # - asset: fonts/Schyler-Italic.ttf 68 | # style: italic 69 | # - family: Trajan Pro 70 | # fonts: 71 | # - asset: fonts/TrajanPro.ttf 72 | # - asset: fonts/TrajanPro_Bold.ttf 73 | # weight: 700 74 | # 75 | # For details regarding fonts from package dependencies, 76 | # see https://flutter.dev/custom-fonts/#from-packages 77 | -------------------------------------------------------------------------------- /lib/ux/pages/home/widgets/configuration_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/utils/screen_size.dart'; 2 | import 'package:algorithms_visualizer/ux/providers/pages_provider.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class ConfigurationWidget extends StatelessWidget { 7 | const ConfigurationWidget({Key key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return deviceScreenType(MediaQuery.of(context).size.width) == 12 | DeviceScreenType.Desktop 13 | ? const _ConfigurationWidgetDesktop() 14 | : const _ConfigurationWidgetMobile(); 15 | } 16 | } 17 | 18 | class _ConfigurationWidgetMobile extends StatelessWidget { 19 | const _ConfigurationWidgetMobile({Key key}) : super(key: key); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return const CategorySelector(); 24 | } 25 | } 26 | 27 | class _ConfigurationWidgetDesktop extends StatelessWidget { 28 | const _ConfigurationWidgetDesktop({Key key}) : super(key: key); 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | return Column( 33 | mainAxisAlignment: MainAxisAlignment.center, 34 | children: [ 35 | Text( 36 | 'Configuration', 37 | style: Theme.of(context).textTheme.headline3, 38 | ), 39 | const SizedBox( 40 | height: 32, 41 | ), 42 | const CategorySelector(), 43 | ], 44 | ); 45 | } 46 | } 47 | 48 | class CategorySelector extends StatelessWidget { 49 | const CategorySelector({ 50 | Key key, 51 | }) : super(key: key); 52 | 53 | @override 54 | Widget build(BuildContext context) { 55 | return Consumer( 56 | builder: (_, categoryProvider, child) { 57 | return Row( 58 | mainAxisAlignment: MainAxisAlignment.center, 59 | children: [ 60 | Padding( 61 | padding: const EdgeInsets.all(8.0), 62 | child: 63 | Text('Category:', style: Theme.of(context).textTheme.caption), 64 | ), 65 | DropdownButton( 66 | hint: const Text('Category'), 67 | value: categoryProvider.categoryKey, 68 | icon: Icon(Icons.arrow_drop_down), 69 | iconSize: 24, 70 | elevation: 16, 71 | underline: Container( 72 | height: 2, 73 | color: Colors.black87, 74 | ), 75 | onChanged: (String newValue) { 76 | categoryProvider.changeKey(newValue); 77 | }, 78 | items: [ 79 | 'Search', 80 | 'Sort', 81 | ].map>( 82 | (String value) { 83 | return DropdownMenuItem( 84 | value: value, 85 | child: Text(value), 86 | ); 87 | }, 88 | ).toList(), 89 | ), 90 | ], 91 | ); 92 | }, 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /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/ux/pages/home/widgets/category_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/utils/screen_size.dart'; 2 | import 'package:dots_indicator/dots_indicator.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class CategoryWidget extends StatelessWidget { 6 | const CategoryWidget({ 7 | Key key, 8 | @required this.pages, 9 | }) : assert(pages != null), 10 | super(key: key); 11 | 12 | final List pages; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return (deviceScreenType(MediaQuery.of(context).size.width) == 17 | DeviceScreenType.Desktop) 18 | ? _CategoryWidgetDesktop(pages: pages) 19 | : _CategoryWidgetMobile(pages: pages); 20 | } 21 | } 22 | 23 | class _CategoryWidgetDesktop extends StatelessWidget { 24 | const _CategoryWidgetDesktop({Key key, @required this.pages}) 25 | : super(key: key); 26 | 27 | final List pages; 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return Padding( 32 | padding: const EdgeInsets.all(64.0), 33 | child: Card( 34 | child: _AlgorithmCategory(pages: pages), 35 | ), 36 | ); 37 | } 38 | } 39 | 40 | class _CategoryWidgetMobile extends StatelessWidget { 41 | const _CategoryWidgetMobile({Key key, @required this.pages}) 42 | : super(key: key); 43 | 44 | final List pages; 45 | 46 | @override 47 | Widget build(BuildContext context) { 48 | return _AlgorithmCategory(pages: pages); 49 | } 50 | } 51 | 52 | class _AlgorithmCategory extends StatefulWidget { 53 | const _AlgorithmCategory({ 54 | Key key, 55 | @required this.pages, 56 | }) : super(key: key); 57 | 58 | final List pages; 59 | 60 | @override 61 | _AlgorithmCategoryState createState() => _AlgorithmCategoryState(); 62 | } 63 | 64 | class _AlgorithmCategoryState extends State<_AlgorithmCategory> { 65 | PageController pageController = PageController(keepPage: false); 66 | 67 | var page = 0.0; 68 | 69 | void _updateIndicator(int pageNumber) { 70 | setState(() { 71 | page = pageNumber.toDouble(); 72 | }); 73 | } 74 | 75 | @override 76 | Widget build(BuildContext context) { 77 | return Container( 78 | padding: const EdgeInsets.all(8), 79 | constraints: BoxConstraints( 80 | maxWidth: MediaQuery.of(context).size.width > 800 81 | ? 800 82 | : MediaQuery.of(context).size.width, 83 | ), 84 | child: Column( 85 | children: [ 86 | Expanded( 87 | child: PageView.builder( 88 | controller: pageController, 89 | itemCount: widget.pages.length, 90 | onPageChanged: (page) { 91 | _updateIndicator(page); 92 | }, 93 | itemBuilder: (context, index) { 94 | return widget.pages[index]; 95 | }, 96 | ), 97 | ), 98 | Padding( 99 | padding: const EdgeInsets.only(bottom: 32), 100 | child: DotsIndicator( 101 | dotsCount: widget.pages.length, 102 | position: page, 103 | decorator: DotsDecorator( 104 | activeColor: Colors.red, 105 | spacing: const EdgeInsets.symmetric(horizontal: 12), 106 | size: const Size(10, 10), 107 | activeSize: const Size(14, 14), 108 | ), 109 | ), 110 | ), 111 | ], 112 | ), 113 | ); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /lib/ux/widgets/search/search_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:algorithms_visualizer/models/search_model.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class SearchWidget extends StatelessWidget { 5 | const SearchWidget({Key key, this.number}) : super(key: key); 6 | 7 | final SearchModel number; 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return ValueListenableBuilder( 12 | valueListenable: number.state, 13 | builder: (context, state, child) { 14 | double fontSize = 20; 15 | if (state == SearchState.search) { 16 | fontSize = 42; 17 | } else if (state == SearchState.found) { 18 | fontSize = 42; 19 | } else if (state == SearchState.searched) { 20 | fontSize = 20; 21 | } 22 | return AnimatedContainer( 23 | key: number.key, 24 | duration: const Duration(milliseconds: 900), 25 | curve: Curves.ease, 26 | width: 60, 27 | height: 60, 28 | decoration: BoxDecoration( 29 | border: (state == SearchState.found) 30 | ? Border.all( 31 | color: Colors.green, 32 | ) 33 | : null, 34 | borderRadius: const BorderRadius.all(Radius.circular(5.0)), 35 | ), 36 | child: CustomTextStyle(fontSize: fontSize, number: number, numberValue: number.value.toString(), state: state), 37 | ); 38 | }, 39 | // child: AnimatedContainer( 40 | // key: number.key, 41 | // duration: const Duration(milliseconds: 900), 42 | // curve: Curves.ease, 43 | // width: 60, 44 | // height: 60, 45 | // decoration: BoxDecoration( 46 | // border: (number.state.value == SearchState.found) 47 | // ? Border.all( 48 | // color: Colors.green, 49 | // ) 50 | // : null, 51 | // borderRadius: const BorderRadius.all(Radius.circular(5.0)), 52 | // ), 53 | // child: AnimatedDefaultTextStyle( 54 | // curve: Curves.easeOut, 55 | // duration: const Duration(milliseconds: 300), 56 | // style: TextStyle( 57 | // fontSize: fontSize, 58 | // decoration: (number.state.value == SearchState.discard) 59 | // ? TextDecoration.lineThrough 60 | // : TextDecoration.none, 61 | // decorationStyle: TextDecorationStyle.solid, 62 | // decorationThickness: 1.7, 63 | // color: number.color, 64 | // ), 65 | // child: Center( 66 | // child: Text( 67 | // number.value.toString(), 68 | // ), 69 | // ), 70 | // ), 71 | // ), 72 | ); 73 | } 74 | } 75 | 76 | class CustomTextStyle extends StatelessWidget { 77 | const CustomTextStyle({ 78 | Key key, 79 | @required this.fontSize, 80 | @required this.number, 81 | @required this.numberValue, 82 | @required this.state, 83 | }) : super(key: key); 84 | 85 | final double fontSize; 86 | final SearchModel number; 87 | final String numberValue; 88 | final SearchState state; 89 | 90 | @override 91 | Widget build(BuildContext context) { 92 | // return Text(numberValue); 93 | return AnimatedDefaultTextStyle( 94 | curve: Curves.easeOut, 95 | duration: const Duration(milliseconds: 300), 96 | style: TextStyle( 97 | fontSize: fontSize, 98 | decoration: (state == SearchState.discard) 99 | ? TextDecoration.lineThrough 100 | : TextDecoration.none, 101 | decorationStyle: TextDecorationStyle.solid, 102 | decorationThickness: 1.7, 103 | color: number.color, 104 | ), 105 | child: Center( 106 | child: Text( 107 | numberValue 108 | ), 109 | ), 110 | ); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/dart,flutter,android,androidstudio,visualstudiocode 3 | # Edit at https://www.gitignore.io/?templates=dart,flutter,android,androidstudio,visualstudiocode 4 | 5 | ### Android ### 6 | # Built application files 7 | *.apk 8 | *.ap_ 9 | *.aab 10 | 11 | # Files for the ART/Dalvik VM 12 | *.dex 13 | 14 | # Java class files 15 | *.class 16 | 17 | # Generated files 18 | bin/ 19 | gen/ 20 | out/ 21 | release/ 22 | 23 | # Gradle files 24 | .gradle/ 25 | build/ 26 | 27 | # Local configuration file (sdk path, etc) 28 | local.properties 29 | 30 | # Proguard folder generated by Eclipse 31 | proguard/ 32 | 33 | # Log Files 34 | *.log 35 | 36 | # Android Studio Navigation editor temp files 37 | .navigation/ 38 | 39 | # Android Studio captures folder 40 | captures/ 41 | 42 | # IntelliJ 43 | *.iml 44 | .idea/workspace.xml 45 | .idea/tasks.xml 46 | .idea/gradle.xml 47 | .idea/assetWizardSettings.xml 48 | .idea/dictionaries 49 | .idea/libraries 50 | # Android Studio 3 in .gitignore file. 51 | .idea/caches 52 | .idea/modules.xml 53 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 54 | .idea/navEditor.xml 55 | 56 | # Keystore files 57 | # Uncomment the following lines if you do not want to check your keystore files in. 58 | #*.jks 59 | #*.keystore 60 | 61 | # External native build folder generated in Android Studio 2.2 and later 62 | .externalNativeBuild 63 | 64 | # Google Services (e.g. APIs or Firebase) 65 | # google-services.json 66 | 67 | # Freeline 68 | freeline.py 69 | freeline/ 70 | freeline_project_description.json 71 | 72 | # fastlane 73 | fastlane/report.xml 74 | fastlane/Preview.html 75 | fastlane/screenshots 76 | fastlane/test_output 77 | fastlane/readme.md 78 | 79 | # Version control 80 | vcs.xml 81 | 82 | # lint 83 | lint/intermediates/ 84 | lint/generated/ 85 | lint/outputs/ 86 | lint/tmp/ 87 | # lint/reports/ 88 | 89 | ### Android Patch ### 90 | gen-external-apklibs 91 | output.json 92 | 93 | # Replacement of .externalNativeBuild directories introduced 94 | # with Android Studio 3.5. 95 | .cxx/ 96 | 97 | ### Dart ### 98 | # See https://www.dartlang.org/guides/libraries/private-files 99 | 100 | # Files and directories created by pub 101 | .dart_tool/ 102 | .packages 103 | # If you're building an application, you may want to check-in your pubspec.lock 104 | pubspec.lock 105 | 106 | # Directory created by dartdoc 107 | # If you don't generate documentation locally you can remove this line. 108 | doc/api/ 109 | 110 | # Avoid committing generated Javascript files: 111 | *.dart.js 112 | *.info.json # Produced by the --dump-info flag. 113 | *.js # When generated by dart2js. Don't specify *.js if your 114 | # project includes source files written in JavaScript. 115 | *.js_ 116 | *.js.deps 117 | *.js.map 118 | 119 | ### Flutter ### 120 | # Flutter/Dart/Pub related 121 | **/doc/api/ 122 | .flutter-plugins 123 | .pub-cache/ 124 | .pub/ 125 | 126 | # Android related 127 | **/android/**/gradle-wrapper.jar 128 | **/android/.gradle 129 | **/android/captures/ 130 | **/android/gradlew 131 | **/android/gradlew.bat 132 | **/android/local.properties 133 | **/android/**/GeneratedPluginRegistrant.java 134 | 135 | # iOS/XCode related 136 | **/ios/**/*.mode1v3 137 | **/ios/**/*.mode2v3 138 | **/ios/**/*.moved-aside 139 | **/ios/**/*.pbxuser 140 | **/ios/**/*.perspectivev3 141 | **/ios/**/*sync/ 142 | **/ios/**/.sconsign.dblite 143 | **/ios/**/.tags* 144 | **/ios/**/.vagrant/ 145 | **/ios/**/DerivedData/ 146 | **/ios/**/Icon? 147 | **/ios/**/Pods/ 148 | **/ios/**/.symlinks/ 149 | **/ios/**/profile 150 | **/ios/**/xcuserdata 151 | **/ios/.generated/ 152 | **/ios/Flutter/App.framework 153 | **/ios/Flutter/Flutter.framework 154 | **/ios/Flutter/Generated.xcconfig 155 | **/ios/Flutter/app.flx 156 | **/ios/Flutter/app.zip 157 | **/ios/Flutter/flutter_assets/ 158 | **/ios/ServiceDefinitions.json 159 | **/ios/Runner/GeneratedPluginRegistrant.* 160 | 161 | # Exceptions to above rules. 162 | !**/ios/**/default.mode1v3 163 | !**/ios/**/default.mode2v3 164 | !**/ios/**/default.pbxuser 165 | !**/ios/**/default.perspectivev3 166 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 167 | 168 | ### VisualStudioCode ### 169 | .vscode/* 170 | !.vscode/settings.json 171 | !.vscode/tasks.json 172 | !.vscode/launch.json 173 | !.vscode/extensions.json 174 | 175 | ### VisualStudioCode Patch ### 176 | # Ignore all local history of files 177 | .history 178 | 179 | ### AndroidStudio ### 180 | # Covers files to be ignored for android development using Android Studio. 181 | 182 | # Built application files 183 | 184 | # Files for the ART/Dalvik VM 185 | 186 | # Java class files 187 | 188 | # Generated files 189 | 190 | # Gradle files 191 | .gradle 192 | 193 | # Signing files 194 | .signing/ 195 | 196 | # Local configuration file (sdk path, etc) 197 | 198 | # Proguard folder generated by Eclipse 199 | 200 | # Log Files 201 | 202 | # Android Studio 203 | /*/build/ 204 | /*/local.properties 205 | /*/out 206 | /*/*/build 207 | /*/*/production 208 | *.ipr 209 | *~ 210 | *.swp 211 | 212 | # Android Patch 213 | 214 | # External native build folder generated in Android Studio 2.2 and later 215 | 216 | # NDK 217 | obj/ 218 | 219 | # IntelliJ IDEA 220 | *.iws 221 | /out/ 222 | 223 | # User-specific configurations 224 | .idea/caches/ 225 | .idea/libraries/ 226 | .idea/shelf/ 227 | .idea/.name 228 | .idea/compiler.xml 229 | .idea/copyright/profiles_settings.xml 230 | .idea/encodings.xml 231 | .idea/misc.xml 232 | .idea/scopes/scope_settings.xml 233 | .idea/vcs.xml 234 | .idea/jsLibraryMappings.xml 235 | .idea/datasources.xml 236 | .idea/dataSources.ids 237 | .idea/sqlDataSources.xml 238 | .idea/dynamic.xml 239 | .idea/uiDesigner.xml 240 | 241 | # OS-specific files 242 | .DS_Store 243 | .DS_Store? 244 | ._* 245 | .Spotlight-V100 246 | .Trashes 247 | ehthumbs.db 248 | Thumbs.db 249 | 250 | # Legacy Eclipse project files 251 | .classpath 252 | .project 253 | .cproject 254 | .settings/ 255 | 256 | # Mobile Tools for Java (J2ME) 257 | .mtj.tmp/ 258 | 259 | # Package Files # 260 | *.war 261 | *.ear 262 | 263 | # virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml) 264 | hs_err_pid* 265 | 266 | ## Plugin-specific files: 267 | 268 | # mpeltonen/sbt-idea plugin 269 | .idea_modules/ 270 | 271 | # JIRA plugin 272 | atlassian-ide-plugin.xml 273 | 274 | # Mongo Explorer plugin 275 | .idea/mongoSettings.xml 276 | 277 | # Crashlytics plugin (for Android Studio and IntelliJ) 278 | com_crashlytics_export_strings.xml 279 | crashlytics.properties 280 | crashlytics-build.properties 281 | fabric.properties 282 | 283 | ### AndroidStudio Patch ### 284 | 285 | !/gradle/wrapper/gradle-wrapper.jar 286 | 287 | # End of https://www.gitignore.io/api/dart,flutter,android,androidstudio,visualstudiocode -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Specify analysis options. 2 | # 3 | # Until there are meta linter rules, each desired lint must be explicitly enabled. 4 | # See: https://github.com/dart-lang/linter/issues/288 5 | # 6 | # For a list of lints, see: http://dart-lang.github.io/linter/lints/ 7 | # See the configuration guide for more 8 | # https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer 9 | # 10 | # There are other similar analysis options files in the flutter repos, 11 | # which should be kept in sync with this file: 12 | # 13 | # - analysis_options.yaml (this file) 14 | # - packages/flutter/lib/analysis_options_user.yaml 15 | # - https://github.com/flutter/plugins/blob/master/analysis_options.yaml 16 | # - https://github.com/flutter/engine/blob/master/analysis_options.yaml 17 | # 18 | # This file contains the analysis options used by Flutter tools, such as IntelliJ, 19 | # Android Studio, and the `flutter analyze` command. 20 | 21 | analyzer: 22 | strong-mode: 23 | implicit-dynamic: true 24 | errors: 25 | # treat missing required parameters as a warning (not a hint) 26 | missing_required_param: warning 27 | # treat missing returns as a warning (not a hint) 28 | missing_return: warning 29 | # allow having TODOs in the code 30 | todo: ignore 31 | # Ignore analyzer hints for updating pubspecs when using Future or 32 | # Stream and not importing dart:async 33 | # Please see https://github.com/flutter/flutter/pull/24528 for details. 34 | sdk_version_async_exported_from_core: ignore 35 | exclude: 36 | - "bin/cache/**" 37 | # the following two are relative to the stocks example and the flutter package respectively 38 | # see https://github.com/dart-lang/sdk/issues/28463 39 | - "lib/i18n/messages_*.dart" 40 | - "lib/src/http/**" 41 | 42 | linter: 43 | rules: 44 | # these rules are documented on and in the same order as 45 | # the Dart Lint rules page to make maintenance easier 46 | # https://github.com/dart-lang/linter/blob/master/example/all.yaml 47 | - always_declare_return_types 48 | - always_put_control_body_on_new_line 49 | # - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219 50 | - always_require_non_null_named_parameters 51 | # - always_specify_types 52 | - annotate_overrides 53 | # - avoid_annotating_with_dynamic # conflicts with always_specify_types 54 | - avoid_as 55 | - avoid_bool_literals_in_conditional_expressions 56 | # - avoid_catches_without_on_clauses # we do this commonly 57 | # - avoid_catching_errors # we do this commonly 58 | - avoid_classes_with_only_static_members 59 | # - avoid_double_and_int_checks # only useful when targeting JS runtime 60 | - avoid_empty_else 61 | - avoid_field_initializers_in_const_classes 62 | - avoid_function_literals_in_foreach_calls 63 | # - avoid_implementing_value_types # not yet tested 64 | - avoid_init_to_null 65 | # - avoid_js_rounded_ints # only useful when targeting JS runtime 66 | - avoid_null_checks_in_equality_operators 67 | # - avoid_positional_boolean_parameters # not yet tested 68 | # - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356) 69 | - avoid_relative_lib_imports 70 | - avoid_renaming_method_parameters 71 | - avoid_return_types_on_setters 72 | # - avoid_returning_null # there are plenty of valid reasons to return null 73 | # - avoid_returning_null_for_future # not yet tested 74 | - avoid_returning_null_for_void 75 | # - avoid_returning_this # there are plenty of valid reasons to return this 76 | # - avoid_setters_without_getters # not yet tested 77 | # - avoid_shadowing_type_parameters # not yet tested 78 | # - avoid_single_cascade_in_expression_statements # not yet tested 79 | - avoid_slow_async_io 80 | - avoid_types_as_parameter_names 81 | # - avoid_types_on_closure_parameters # conflicts with always_specify_types 82 | - avoid_unused_constructor_parameters 83 | - avoid_void_async 84 | - await_only_futures 85 | - camel_case_types 86 | - cancel_subscriptions 87 | # - cascade_invocations # not yet tested 88 | # - close_sinks # not reliable enough 89 | # - comment_references # blocked on https://github.com/flutter/flutter/issues/20765 90 | # - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204 91 | - control_flow_in_finally 92 | # - curly_braces_in_flow_control_structures # not yet tested 93 | # - diagnostic_describe_all_properties # not yet tested 94 | - directives_ordering 95 | - empty_catches 96 | - empty_constructor_bodies 97 | - empty_statements 98 | # - file_names # not yet tested 99 | - flutter_style_todos 100 | - hash_and_equals 101 | - implementation_imports 102 | # - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811 103 | - iterable_contains_unrelated_type 104 | # - join_return_with_assignment # not yet tested 105 | - library_names 106 | - library_prefixes 107 | # - lines_longer_than_80_chars # not yet tested 108 | - list_remove_unrelated_type 109 | # - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181 110 | - no_adjacent_strings_in_list 111 | - no_duplicate_case_values 112 | - non_constant_identifier_names 113 | # - null_closures # not yet tested 114 | # - omit_local_variable_types # opposite of always_specify_types 115 | # - one_member_abstracts # too many false positives 116 | # - only_throw_errors # https://github.com/flutter/flutter/issues/5792 117 | - overridden_fields 118 | - package_api_docs 119 | - package_names 120 | - package_prefixed_library_names 121 | # - parameter_assignments # we do this commonly 122 | - prefer_adjacent_string_concatenation 123 | - prefer_asserts_in_initializer_lists 124 | # - prefer_asserts_with_message # not yet tested 125 | - prefer_collection_literals 126 | - prefer_conditional_assignment 127 | - prefer_const_constructors 128 | - prefer_const_constructors_in_immutables 129 | - prefer_const_declarations 130 | - prefer_const_literals_to_create_immutables 131 | # - prefer_constructors_over_static_methods # not yet tested 132 | - prefer_contains 133 | # - prefer_double_quotes # opposite of prefer_single_quotes 134 | - prefer_equal_for_default_values 135 | # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods 136 | - prefer_final_fields 137 | # - prefer_final_in_for_each # not yet tested 138 | - prefer_final_locals 139 | # - prefer_for_elements_to_map_fromIterable # not yet tested 140 | - prefer_foreach 141 | # - prefer_function_declarations_over_variables # not yet tested 142 | - prefer_generic_function_type_aliases 143 | - prefer_if_elements_to_conditional_expressions 144 | - prefer_if_null_operators 145 | - prefer_initializing_formals 146 | - prefer_inlined_adds 147 | # - prefer_int_literals # not yet tested 148 | # - prefer_interpolation_to_compose_strings # not yet tested 149 | - prefer_is_empty 150 | - prefer_is_not_empty 151 | - prefer_iterable_whereType 152 | # - prefer_mixin # https://github.com/dart-lang/language/issues/32 153 | # - prefer_null_aware_operators # disable until NNBD, see https://github.com/flutter/flutter/pull/32711#issuecomment-492930932 154 | - prefer_single_quotes 155 | - prefer_spread_collections 156 | - prefer_typing_uninitialized_variables 157 | - prefer_void_to_null 158 | # - provide_deprecation_message # not yet tested 159 | # - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml 160 | - recursive_getters 161 | - slash_for_doc_comments 162 | # - sort_child_properties_last # not yet tested 163 | - sort_constructors_first 164 | - sort_pub_dependencies 165 | - sort_unnamed_constructors_first 166 | - test_types_in_equals 167 | - throw_in_finally 168 | # - type_annotate_public_apis # subset of always_specify_types 169 | - type_init_formals 170 | # - unawaited_futures # too many false positives 171 | # - unnecessary_await_in_return # not yet tested 172 | - unnecessary_brace_in_string_interps 173 | - unnecessary_const 174 | - unnecessary_getters_setters 175 | # - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498 176 | - unnecessary_new 177 | - unnecessary_null_aware_assignments 178 | - unnecessary_null_in_if_null_operators 179 | - unnecessary_overrides 180 | - unnecessary_parenthesis 181 | - unnecessary_statements 182 | - unnecessary_this 183 | - unrelated_type_equality_checks 184 | # - unsafe_html # not yet tested 185 | - use_full_hex_values_for_flutter_colors 186 | # - use_function_type_syntax_for_parameters # not yet tested 187 | - use_rethrow_when_possible 188 | # - use_setters_to_change_properties # not yet tested 189 | # - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182 190 | # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review 191 | - valid_regexps 192 | # - void_checks # not yet tested -------------------------------------------------------------------------------- /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 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 19 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 20 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXCopyFilesBuildPhase section */ 24 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 25 | isa = PBXCopyFilesBuildPhase; 26 | buildActionMask = 2147483647; 27 | dstPath = ""; 28 | dstSubfolderSpec = 10; 29 | files = ( 30 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 31 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 32 | ); 33 | name = "Embed Frameworks"; 34 | runOnlyForDeploymentPostprocessing = 0; 35 | }; 36 | /* End PBXCopyFilesBuildPhase section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 40 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 41 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 42 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 43 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 44 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 45 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 46 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 47 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 48 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 49 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 52 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 53 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 62 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 9740EEB11CF90186004384FC /* Flutter */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 3B80C3931E831B6300D905FE /* App.framework */, 73 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 74 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 75 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 76 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 77 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 78 | ); 79 | name = Flutter; 80 | sourceTree = ""; 81 | }; 82 | 97C146E51CF9000F007C117D = { 83 | isa = PBXGroup; 84 | children = ( 85 | 9740EEB11CF90186004384FC /* Flutter */, 86 | 97C146F01CF9000F007C117D /* Runner */, 87 | 97C146EF1CF9000F007C117D /* Products */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | 97C146EF1CF9000F007C117D /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 97C146EE1CF9000F007C117D /* Runner.app */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 97C146F01CF9000F007C117D /* Runner */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 103 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 104 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 105 | 97C147021CF9000F007C117D /* Info.plist */, 106 | 97C146F11CF9000F007C117D /* Supporting Files */, 107 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 108 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 109 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 110 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 111 | ); 112 | path = Runner; 113 | sourceTree = ""; 114 | }; 115 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | ); 119 | name = "Supporting Files"; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | 97C146ED1CF9000F007C117D /* Runner */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 128 | buildPhases = ( 129 | 9740EEB61CF901F6004384FC /* Run Script */, 130 | 97C146EA1CF9000F007C117D /* Sources */, 131 | 97C146EB1CF9000F007C117D /* Frameworks */, 132 | 97C146EC1CF9000F007C117D /* Resources */, 133 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 134 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | ); 140 | name = Runner; 141 | productName = Runner; 142 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 143 | productType = "com.apple.product-type.application"; 144 | }; 145 | /* End PBXNativeTarget section */ 146 | 147 | /* Begin PBXProject section */ 148 | 97C146E61CF9000F007C117D /* Project object */ = { 149 | isa = PBXProject; 150 | attributes = { 151 | LastUpgradeCheck = 1020; 152 | ORGANIZATIONNAME = "The Chromium Authors"; 153 | TargetAttributes = { 154 | 97C146ED1CF9000F007C117D = { 155 | CreatedOnToolsVersion = 7.3.1; 156 | LastSwiftMigration = 0910; 157 | }; 158 | }; 159 | }; 160 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 161 | compatibilityVersion = "Xcode 3.2"; 162 | developmentRegion = en; 163 | hasScannedForEncodings = 0; 164 | knownRegions = ( 165 | en, 166 | Base, 167 | ); 168 | mainGroup = 97C146E51CF9000F007C117D; 169 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | 97C146ED1CF9000F007C117D /* Runner */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | 97C146EC1CF9000F007C117D /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 184 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 185 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 186 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 187 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXResourcesBuildPhase section */ 192 | 193 | /* Begin PBXShellScriptBuildPhase section */ 194 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 195 | isa = PBXShellScriptBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | ); 199 | inputPaths = ( 200 | ); 201 | name = "Thin Binary"; 202 | outputPaths = ( 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | shellPath = /bin/sh; 206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 207 | }; 208 | 9740EEB61CF901F6004384FC /* Run Script */ = { 209 | isa = PBXShellScriptBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | inputPaths = ( 214 | ); 215 | name = "Run Script"; 216 | outputPaths = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | shellPath = /bin/sh; 220 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 221 | }; 222 | /* End PBXShellScriptBuildPhase section */ 223 | 224 | /* Begin PBXSourcesBuildPhase section */ 225 | 97C146EA1CF9000F007C117D /* Sources */ = { 226 | isa = PBXSourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 230 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | /* End PBXSourcesBuildPhase section */ 235 | 236 | /* Begin PBXVariantGroup section */ 237 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 238 | isa = PBXVariantGroup; 239 | children = ( 240 | 97C146FB1CF9000F007C117D /* Base */, 241 | ); 242 | name = Main.storyboard; 243 | sourceTree = ""; 244 | }; 245 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 246 | isa = PBXVariantGroup; 247 | children = ( 248 | 97C147001CF9000F007C117D /* Base */, 249 | ); 250 | name = LaunchScreen.storyboard; 251 | sourceTree = ""; 252 | }; 253 | /* End PBXVariantGroup section */ 254 | 255 | /* Begin XCBuildConfiguration section */ 256 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 257 | isa = XCBuildConfiguration; 258 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 259 | buildSettings = { 260 | ALWAYS_SEARCH_USER_PATHS = NO; 261 | CLANG_ANALYZER_NONNULL = YES; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 267 | CLANG_WARN_BOOL_CONVERSION = YES; 268 | CLANG_WARN_COMMA = YES; 269 | CLANG_WARN_CONSTANT_CONVERSION = YES; 270 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 271 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 272 | CLANG_WARN_EMPTY_BODY = YES; 273 | CLANG_WARN_ENUM_CONVERSION = YES; 274 | CLANG_WARN_INFINITE_RECURSION = YES; 275 | CLANG_WARN_INT_CONVERSION = YES; 276 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 278 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 279 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 280 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 281 | CLANG_WARN_STRICT_PROTOTYPES = YES; 282 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 286 | COPY_PHASE_STRIP = NO; 287 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 288 | ENABLE_NS_ASSERTIONS = NO; 289 | ENABLE_STRICT_OBJC_MSGSEND = YES; 290 | GCC_C_LANGUAGE_STANDARD = gnu99; 291 | GCC_NO_COMMON_BLOCKS = YES; 292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 294 | GCC_WARN_UNDECLARED_SELECTOR = YES; 295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 296 | GCC_WARN_UNUSED_FUNCTION = YES; 297 | GCC_WARN_UNUSED_VARIABLE = YES; 298 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 299 | MTL_ENABLE_DEBUG_INFO = NO; 300 | SDKROOT = iphoneos; 301 | TARGETED_DEVICE_FAMILY = "1,2"; 302 | VALIDATE_PRODUCT = YES; 303 | }; 304 | name = Profile; 305 | }; 306 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 307 | isa = XCBuildConfiguration; 308 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 309 | buildSettings = { 310 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 311 | CLANG_ENABLE_MODULES = YES; 312 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 313 | ENABLE_BITCODE = NO; 314 | FRAMEWORK_SEARCH_PATHS = ( 315 | "$(inherited)", 316 | "$(PROJECT_DIR)/Flutter", 317 | ); 318 | INFOPLIST_FILE = Runner/Info.plist; 319 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 320 | LIBRARY_SEARCH_PATHS = ( 321 | "$(inherited)", 322 | "$(PROJECT_DIR)/Flutter", 323 | ); 324 | PRODUCT_BUNDLE_IDENTIFIER = com.example.binarySearch; 325 | PRODUCT_NAME = "$(TARGET_NAME)"; 326 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 327 | SWIFT_VERSION = 4.0; 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_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 347 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 348 | CLANG_WARN_EMPTY_BODY = YES; 349 | CLANG_WARN_ENUM_CONVERSION = YES; 350 | CLANG_WARN_INFINITE_RECURSION = YES; 351 | CLANG_WARN_INT_CONVERSION = YES; 352 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 354 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 355 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 356 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 357 | CLANG_WARN_STRICT_PROTOTYPES = YES; 358 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 359 | CLANG_WARN_UNREACHABLE_CODE = YES; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 362 | COPY_PHASE_STRIP = NO; 363 | DEBUG_INFORMATION_FORMAT = dwarf; 364 | ENABLE_STRICT_OBJC_MSGSEND = YES; 365 | ENABLE_TESTABILITY = YES; 366 | GCC_C_LANGUAGE_STANDARD = gnu99; 367 | GCC_DYNAMIC_NO_PIC = NO; 368 | GCC_NO_COMMON_BLOCKS = YES; 369 | GCC_OPTIMIZATION_LEVEL = 0; 370 | GCC_PREPROCESSOR_DEFINITIONS = ( 371 | "DEBUG=1", 372 | "$(inherited)", 373 | ); 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 381 | MTL_ENABLE_DEBUG_INFO = YES; 382 | ONLY_ACTIVE_ARCH = YES; 383 | SDKROOT = iphoneos; 384 | TARGETED_DEVICE_FAMILY = "1,2"; 385 | }; 386 | name = Debug; 387 | }; 388 | 97C147041CF9000F007C117D /* Release */ = { 389 | isa = XCBuildConfiguration; 390 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 391 | buildSettings = { 392 | ALWAYS_SEARCH_USER_PATHS = NO; 393 | CLANG_ANALYZER_NONNULL = YES; 394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 395 | CLANG_CXX_LIBRARY = "libc++"; 396 | CLANG_ENABLE_MODULES = YES; 397 | CLANG_ENABLE_OBJC_ARC = YES; 398 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 399 | CLANG_WARN_BOOL_CONVERSION = YES; 400 | CLANG_WARN_COMMA = YES; 401 | CLANG_WARN_CONSTANT_CONVERSION = YES; 402 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INFINITE_RECURSION = YES; 407 | CLANG_WARN_INT_CONVERSION = YES; 408 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 409 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 413 | CLANG_WARN_STRICT_PROTOTYPES = YES; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNREACHABLE_CODE = YES; 416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 418 | COPY_PHASE_STRIP = NO; 419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 420 | ENABLE_NS_ASSERTIONS = NO; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | GCC_C_LANGUAGE_STANDARD = gnu99; 423 | GCC_NO_COMMON_BLOCKS = YES; 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 431 | MTL_ENABLE_DEBUG_INFO = NO; 432 | SDKROOT = iphoneos; 433 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 434 | TARGETED_DEVICE_FAMILY = "1,2"; 435 | VALIDATE_PRODUCT = YES; 436 | }; 437 | name = Release; 438 | }; 439 | 97C147061CF9000F007C117D /* Debug */ = { 440 | isa = XCBuildConfiguration; 441 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | CLANG_ENABLE_MODULES = YES; 445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 446 | ENABLE_BITCODE = NO; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | INFOPLIST_FILE = Runner/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | LIBRARY_SEARCH_PATHS = ( 454 | "$(inherited)", 455 | "$(PROJECT_DIR)/Flutter", 456 | ); 457 | PRODUCT_BUNDLE_IDENTIFIER = com.example.binarySearch; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 460 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 461 | SWIFT_VERSION = 4.0; 462 | VERSIONING_SYSTEM = "apple-generic"; 463 | }; 464 | name = Debug; 465 | }; 466 | 97C147071CF9000F007C117D /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 469 | buildSettings = { 470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 471 | CLANG_ENABLE_MODULES = YES; 472 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 473 | ENABLE_BITCODE = NO; 474 | FRAMEWORK_SEARCH_PATHS = ( 475 | "$(inherited)", 476 | "$(PROJECT_DIR)/Flutter", 477 | ); 478 | INFOPLIST_FILE = Runner/Info.plist; 479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 480 | LIBRARY_SEARCH_PATHS = ( 481 | "$(inherited)", 482 | "$(PROJECT_DIR)/Flutter", 483 | ); 484 | PRODUCT_BUNDLE_IDENTIFIER = com.example.binarySearch; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 487 | SWIFT_VERSION = 4.0; 488 | VERSIONING_SYSTEM = "apple-generic"; 489 | }; 490 | name = Release; 491 | }; 492 | /* End XCBuildConfiguration section */ 493 | 494 | /* Begin XCConfigurationList section */ 495 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | 97C147031CF9000F007C117D /* Debug */, 499 | 97C147041CF9000F007C117D /* Release */, 500 | 249021D3217E4FDB00AE95B9 /* Profile */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 506 | isa = XCConfigurationList; 507 | buildConfigurations = ( 508 | 97C147061CF9000F007C117D /* Debug */, 509 | 97C147071CF9000F007C117D /* Release */, 510 | 249021D4217E4FDB00AE95B9 /* Profile */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | /* End XCConfigurationList section */ 516 | 517 | }; 518 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 519 | } 520 | --------------------------------------------------------------------------------