diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d26fa9 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# THETA X Concept 7 + +After the startCapture command is run, the camera's status is in progress, until the user runs the stopCapture command. + +![gif](docs/test.gif) + +## Concepts + +The process id is parsed out from the `commands/execute` when the user starts the video. The id is passed into the state of the application and as a parameter for the `commands/status`. The `commands/status` outputs the state of the video command: inProgress or done. + +![chart](docs/chart.png) + +### inProgress + +The state of the process is `inProgress` while the camera is capturing the video. After the stopCapture command is run, the camera stitches the video together. The process is still `inProgress` even after stopping the video. The process is `done` once the video has finished stitching. While a video may be three seconds in duration, the process may take five seconds to complete. + +## API Features + +* [commands/status](https://api.ricoh/docs/theta-web-api-v2.1/protocols/commands_status/) +* [camera.startCapture](https://api.ricoh/docs/theta-web-api-v2.1/commands/camera.start_capture/) +* [camera.stopCapture](https://api.ricoh/docs/theta-web-api-v2.1/commands/camera.stop_capture/) +* [captureMode](https://api.ricoh/docs/theta-web-api-v2.1/options/capture_mode/) + +## Steps + +* Start capture with `commands/execute`. +* Parse out the id from the response + +```dart + var convertResponse = jsonDecode(response.bodyString); + var id = convertResponse['id']; +``` + +* Pass the process id into the state of the application and also into `commands/status`. With the specific id, the `commands/status` should emit the state of the video process. +* The `commands/status` is added in a while loop to the `commands/execute` until the state of the video process is done. A delay between calls prevents the application from crashing. +5. After the camera is finished processing, display the state to the screen. + +```dart +Text('State: ${state.cameraStatus}') +``` + +## Response Window + +The stopCapture command outputs the file url of the last video. This file url is passesd into the state of the application and displayed as an image. + +```dart + state.fileUrl.isNotEmpty && state.cameraStatus == 'done' + ? SizedBox( + width: 300, + child: Image.network( + '${state.fileUrl}?type=thumb',)) + +``` \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..61b6c4d --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..6f56801 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..31d29d9 --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,71 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.theta_concept_7" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..b4435f5 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f140cfe --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/example/theta_concept_7/MainActivity.kt b/android/app/src/main/kotlin/com/example/theta_concept_7/MainActivity.kt new file mode 100644 index 0000000..9e9a15d --- /dev/null +++ b/android/app/src/main/kotlin/com/example/theta_concept_7/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.theta_concept_7 + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..db77bb4 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..17987b7 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..09d4391 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..d5f1c8d Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..4d6372e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..b4435f5 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..83ae220 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.6.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.1.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..94adc3a --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..cc5527d --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..44e62bc --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/docs/chart.png b/docs/chart.png new file mode 100644 index 0000000..0f2ecf0 Binary files /dev/null and b/docs/chart.png differ diff --git a/docs/test.gif b/docs/test.gif new file mode 100644 index 0000000..f5af04a Binary files /dev/null and b/docs/test.gif differ diff --git a/lib/bloc/camera_use/camera_use_bloc.dart b/lib/bloc/camera_use/camera_use_bloc.dart new file mode 100644 index 0000000..4fa6936 --- /dev/null +++ b/lib/bloc/camera_use/camera_use_bloc.dart @@ -0,0 +1,74 @@ +import 'dart:convert'; + +import 'package:bloc/bloc.dart'; +import 'package:chopper/chopper.dart'; +import 'package:equatable/equatable.dart'; +import 'package:theta_concept_7/services/theta_service.dart'; + +part 'camera_use_event.dart'; +part 'camera_use_state.dart'; + +class CameraUseBloc extends Bloc { + CameraUseBloc() : super(CameraUseState.initial()) { + var chopper = ChopperClient( + services: [ThetaService.create()], converter: const JsonConverter()); + final thetaService = chopper.getService(); + Stopwatch stopwatch = Stopwatch(); + on((event, emit) async { + var response = + await thetaService.command({'name': 'camera.startCapture'}); + var convertResponse = jsonDecode(response.bodyString); + var id = convertResponse['id']; + + if (convertResponse != null && id != null) { + stopwatch.start(); + emit(CameraUseState(message: response.bodyString, id: id)); + while (state.cameraStatus != "done") { + add(CameraStatusEvent()); + await Future.delayed(Duration(milliseconds: 100)); + print(state.cameraStatus); + emit(CameraUseState( + message: response.bodyString, + id: id, + cameraStatus: state.cameraStatus, + fileUrl: state.fileUrl, + elapsedTime: stopwatch.elapsedMilliseconds.toDouble())); + } + stopwatch.stop(); + stopwatch.reset(); + } + }); + on((event, emit) async { + var response = await thetaService.command({'name': 'camera.stopCapture'}); + var convertResponse = jsonDecode(response.bodyString); + var fileUrl = convertResponse['results']['fileUrls'][0]; + print(fileUrl); + emit(CameraUseState( + message: response.bodyString, + elapsedTime: state.elapsedTime, + fileUrl: fileUrl)); + }); + on((event, emit) async { + if (state.id.isNotEmpty) { + var response = await thetaService.status({'id': state.id}); + var convertResponse = jsonDecode(response.bodyString); + var cameraState = convertResponse['state']; + + emit(CameraUseState( + message: response.bodyString, + id: state.id, + cameraStatus: cameraState, + elapsedTime: state.elapsedTime, + fileUrl: state.fileUrl)); + } + }); + on((event, emit) async { + var response = await thetaService.command({ + 'name': 'camera.setOptions', + 'parameters': { + 'options': {'captureMode': 'video'} + } + }); + }); + } +} diff --git a/lib/bloc/camera_use/camera_use_event.dart b/lib/bloc/camera_use/camera_use_event.dart new file mode 100644 index 0000000..fc6d476 --- /dev/null +++ b/lib/bloc/camera_use/camera_use_event.dart @@ -0,0 +1,16 @@ +part of 'camera_use_bloc.dart'; + +abstract class CameraUseEvent extends Equatable { + const CameraUseEvent(); + + @override + List get props => []; +} + +class StartCaptureEvent extends CameraUseEvent {} + +class StopCaptureEvent extends CameraUseEvent {} + +class VideoModeEvent extends CameraUseEvent {} + +class CameraStatusEvent extends CameraUseEvent {} diff --git a/lib/bloc/camera_use/camera_use_state.dart b/lib/bloc/camera_use/camera_use_state.dart new file mode 100644 index 0000000..ad6043c --- /dev/null +++ b/lib/bloc/camera_use/camera_use_state.dart @@ -0,0 +1,38 @@ +// ignore_for_file: public_member_api_docs, sort_constructors_first + +part of 'camera_use_bloc.dart'; + +class CameraUseState extends Equatable { + final String message; + final String id; + final String cameraStatus; + final String fileUrl; + double elapsedTime = 0.0; + CameraUseState( + {required this.message, + this.id = "", + this.cameraStatus = "", + this.fileUrl = "", + this.elapsedTime = 0.0}); + + factory CameraUseState.initial() => CameraUseState( + message: "initial", + id: "", + cameraStatus: "", + fileUrl: "", + elapsedTime: 0.0); + + @override + List get props => [message, id, cameraStatus, fileUrl, elapsedTime]; + + @override + bool get stringify => true; + + CameraUseState copyWith({ + String? message, + }) { + return CameraUseState( + message: message ?? this.message, + ); + } +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..3bd79e7 --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,87 @@ +import 'package:flutter/material.dart'; +import 'package:theta_concept_7/bloc/camera_use/camera_use_bloc.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (context) => CameraUseBloc(), + child: MaterialApp( + home: BlocBuilder( + builder: (context, state) { + return Scaffold( + body: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + onPressed: () { + context.read().add(VideoModeEvent()); + }, + iconSize: 40, + icon: const Icon( + Icons.video_camera_front, + color: Colors.black54, + )) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + onPressed: () { + context + .read() + .add(StartCaptureEvent()); + }, + iconSize: 80, + icon: const Icon( + Icons.play_circle_outline_outlined, + color: Color.fromARGB(255, 255, 126, 117), + )), + IconButton( + onPressed: () { + context.read().add(StopCaptureEvent()); + }, + iconSize: 80, + icon: const Icon(Icons.stop_circle_outlined, + color: Color.fromARGB(255, 255, 126, 117))) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [Text('State: ${state.cameraStatus}')], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [Text('${state.elapsedTime}')], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + state.fileUrl.isNotEmpty && state.cameraStatus == 'done' + ? SizedBox( + width: 300, + child: Image.network( + '${state.fileUrl}?type=thumb', + )) + : Container() + ], + ) + ], + )); + }, + ), + ), + ); + } +} diff --git a/lib/services/theta_service.chopper.dart b/lib/services/theta_service.chopper.dart new file mode 100644 index 0000000..d3e01b9 --- /dev/null +++ b/lib/services/theta_service.chopper.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'theta_service.dart'; + +// ************************************************************************** +// ChopperGenerator +// ************************************************************************** + +// ignore_for_file: always_put_control_body_on_new_line, always_specify_types, prefer_const_declarations, unnecessary_brace_in_string_interps +class _$ThetaService extends ThetaService { + _$ThetaService([ChopperClient? client]) { + if (client == null) return; + this.client = client; + } + + @override + final definitionType = ThetaService; + + @override + Future> command(Map body) { + final $url = 'http://192.168.1.1/osc/commands/execute'; + final $headers = { + 'Content-Type': 'application/json;charset=utf-8', + }; + + final $body = body; + final $request = + Request('POST', $url, client.baseUrl, body: $body, headers: $headers); + return client.send($request); + } + + @override + Future> status(Map body) { + final $url = 'http://192.168.1.1/osc/commands/status'; + final $headers = { + 'Content-Type': 'application/json;charset=utf-8', + }; + + final $body = body; + final $request = + Request('POST', $url, client.baseUrl, body: $body, headers: $headers); + return client.send($request); + } +} diff --git a/lib/services/theta_service.dart b/lib/services/theta_service.dart new file mode 100644 index 0000000..1e2c19e --- /dev/null +++ b/lib/services/theta_service.dart @@ -0,0 +1,18 @@ +import 'package:chopper/chopper.dart'; + +part 'theta_service.chopper.dart'; + +@ChopperApi(baseUrl: 'http://192.168.1.1/osc') +abstract class ThetaService extends ChopperService { + @Post( + path: '/commands/execute', + headers: {'Content-Type': 'application/json;charset=utf-8'}) + Future command(@Body() Map body); + @Post( + path: '/commands/status', + headers: {'Content-Type': 'application/json;charset=utf-8'}) + Future status(@Body() Map body); + static ThetaService create() { + return _$ThetaService(); + } +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..f850e54 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,511 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "41.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.0" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.1" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.2" + bloc: + dependency: transitive + description: + name: bloc + url: "https://pub.dartlang.org" + source: hosted + version: "8.0.3" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.11" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.3" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.3.3" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + chopper: + dependency: "direct main" + description: + name: chopper + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.6" + chopper_generator: + dependency: "direct dev" + description: + name: chopper_generator + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.6" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.16.0" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.3" + equatable: + dependency: "direct main" + description: + name: equatable + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: "direct main" + description: + name: flutter_bloc + url: "https://pub.dartlang.org" + source: hosted + version: "8.0.1" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.4" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.4" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.5.0" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" + provider: + dependency: transitive + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.3" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.2" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.2" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.9" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" +sdks: + dart: ">=2.17.5 <3.0.0" + flutter: ">=1.16.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..18aa75a --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,94 @@ +name: theta_concept_7 +description: A new Flutter project. + +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.17.5 <3.0.0" + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + equatable: ^2.0.3 + chopper: ^4.0.6 + flutter_bloc: ^8.0.1 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + chopper_generator: ^4.0.6 + build_runner: ^2.1.11 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..77be5c0 --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:theta_concept_7/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}