├── ios
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── 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
│ └── xcshareddata
│ │ ├── WorkspaceSettings.xcsettings
│ │ └── IDEWorkspaceChecks.plist
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
└── .gitignore
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ └── Icon-512.png
├── manifest.json
└── index.html
├── Screenshot_20200824-180154.jpg
├── Screenshot_20200824-180256.jpg
├── Screenshot_20200825-152025.jpg
├── Screenshot_20200825-152332.jpg
├── Screenshot_20200825-155059.jpg
├── Screenshot_20200825-155200.jpg
├── Screenshot_20200825-155355.jpg
├── Screenshot_20200825-155431.jpg
├── android
├── gradle.properties
├── .gitignore
├── 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
│ │ │ │ │ └── pawelfranitza
│ │ │ │ │ ├── chat_app
│ │ │ │ │ └── MainActivity.kt
│ │ │ │ │ └── chatapp
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── AndroidManifest.xml
│ │ ├── profile
│ │ │ └── AndroidManifest.xml
│ │ └── debug
│ │ │ └── AndroidManifest.xml
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── settings.gradle
└── build.gradle
├── lib
├── models
│ ├── StringExtension.dart
│ ├── ListExtension.dart
│ ├── Waypoint.dart
│ ├── NavMsgsOccupancyGridExtension.dart
│ └── Message.dart
├── widgets
│ ├── ShadowLine.dart
│ ├── RoundedCornersContainer.dart
│ ├── RainbowLinearIndicator.dart
│ ├── RainbowCircularIndicator.dart
│ ├── MapShelfButtons.dart
│ ├── MessagesList.dart
│ ├── RoomShelf.dart
│ ├── StatusInfo.dart
│ ├── FavoriteShelf.dart
│ ├── WirtualController.dart
│ ├── WaypointShelf.dart
│ ├── ColorPickerCustom.dart
│ ├── WaypointDialog.dart
│ └── MapPainter.dart
├── screens
│ ├── ChatPage.dart
│ ├── ControllerPage.dart
│ ├── MapPage.dart
│ └── MainPage.dart
├── providers
│ ├── AppStateProvider.dart
│ ├── AudioProvider.dart
│ ├── ChatInfoProvider.dart
│ ├── DialogflowProvider.dart
│ └── SettingsProvider.dart
├── l10n
│ ├── intl_en.arb
│ └── intl_pl.arb
├── generated
│ ├── intl
│ │ ├── messages_all.dart
│ │ ├── messages_en.dart
│ │ └── messages_pl.dart
│ └── l10n.dart
└── main.dart
├── .metadata
├── assets
└── template.txt
├── .gitignore
├── test
└── widget_test.dart
├── pubspec.yaml
├── README.md
└── pubspec.lock
/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"
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/Screenshot_20200824-180154.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/Screenshot_20200824-180154.jpg
--------------------------------------------------------------------------------
/Screenshot_20200824-180256.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/Screenshot_20200824-180256.jpg
--------------------------------------------------------------------------------
/Screenshot_20200825-152025.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/Screenshot_20200825-152025.jpg
--------------------------------------------------------------------------------
/Screenshot_20200825-152332.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/Screenshot_20200825-152332.jpg
--------------------------------------------------------------------------------
/Screenshot_20200825-155059.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/Screenshot_20200825-155059.jpg
--------------------------------------------------------------------------------
/Screenshot_20200825-155200.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/Screenshot_20200825-155200.jpg
--------------------------------------------------------------------------------
/Screenshot_20200825-155355.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/Screenshot_20200825-155355.jpg
--------------------------------------------------------------------------------
/Screenshot_20200825-155431.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/Screenshot_20200825-155431.jpg
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/lib/models/StringExtension.dart:
--------------------------------------------------------------------------------
1 | extension StringExtension on String {
2 | String capitalize() {
3 | return "${this[0].toUpperCase()}${this.substring(1)}";
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/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/Rongix/ros_navigation_command_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/pawelfranitza/chat_app/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.pawelfranitza.chat_app
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.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: f139b11009aeb8ed2a3a3aa8b0066e482709dde3
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/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/widgets/ShadowLine.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class ShadowLine extends StatelessWidget {
4 | const ShadowLine({Key key}) : super(key: key);
5 |
6 | @override
7 | Widget build(BuildContext context) {
8 | return Divider(
9 | height: 0,
10 | thickness: 1,
11 | // color: Theme.of(context).brightness == Brightness.light
12 | // ? Colors.black26
13 | // : Colors.black87,
14 | );
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/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/kotlin/com/pawelfranitza/chatapp/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.pawelfranitza.chatapp
2 |
3 | import androidx.annotation.NonNull;
4 | import io.flutter.embedding.android.FlutterActivity
5 | import io.flutter.embedding.engine.FlutterEngine
6 | import io.flutter.plugins.GeneratedPluginRegistrant
7 |
8 | class MainActivity: FlutterActivity() {
9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10 | GeneratedPluginRegistrant.registerWith(flutterEngine);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/models/ListExtension.dart:
--------------------------------------------------------------------------------
1 | extension ListExtension on List {
2 | List insertEveryNth(T item, {int insertOffset = 2}) {
3 | assert(insertOffset > 1);
4 |
5 | var listLength = length + (length / (insertOffset - 1)).floor();
6 | var returnList = List(listLength);
7 | var listIterator = iterator;
8 |
9 | for (var i = 0; i < listLength; ++i) {
10 | if (i % insertOffset != insertOffset - 1 && listIterator.moveNext()) {
11 | returnList[i] = listIterator.current;
12 | } else {
13 | returnList[i] = item;
14 | }
15 | }
16 |
17 | return returnList;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "chat_app",
3 | "short_name": "chat_app",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/assets/template.txt:
--------------------------------------------------------------------------------
1 | /api/dialogflowapi.json
2 | {
3 | "type": "service_account",
4 | "project_id": "XXXXXXXXXXXX",
5 | "private_key_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
6 | "private_key": "-----BEGIN PRIVATE KEY-----\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n-----END PRIVATE KEY-----\n",
7 | "client_email": "XXXXXXXXXXXXXXXXX",
8 | "client_id": "XXXXXXXXXXXX",
9 | "auth_uri": "XXXXXXXXXXXXXXXXXXXXXXX",
10 | "token_uri": "XXXXXXXXXXXXXXXXXXXXXXXX",
11 | "auth_provider_x509_cert_url": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
12 | "client_x509_cert_url": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
13 | }
14 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
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/models/Waypoint.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | class Waypoint {
4 | String name;
5 | Color color;
6 | double x;
7 | double y;
8 | double radius;
9 |
10 | Waypoint({this.name, this.color, this.x, this.y, this.radius = 0.0});
11 |
12 | toJSONEencodable() {
13 | Map encoded = Map();
14 |
15 | encoded['name'] = name;
16 | encoded['color'] = color;
17 | encoded['x'] = x;
18 | encoded['y'] = y;
19 | encoded['radius'] = radius;
20 |
21 | return encoded;
22 | }
23 | }
24 |
25 | class WaypointList {
26 | List waypoints;
27 |
28 | WaypointList(this.waypoints);
29 |
30 | toJSONEencodable() {
31 | return waypoints.map((item) {
32 | return item.toJSONEencodable();
33 | }).toList();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/lib/screens/ChatPage.dart:
--------------------------------------------------------------------------------
1 | import 'package:chatapp/widgets/ChatBar.dart';
2 | import 'package:chatapp/widgets/FavoriteShelf.dart';
3 | import 'package:chatapp/widgets/MessagesList.dart';
4 | import 'package:chatapp/widgets/ShadowLine.dart';
5 | import 'package:flutter/material.dart';
6 |
7 | class ChatPage extends StatelessWidget {
8 | const ChatPage({Key key}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Container(
13 | child: Column(
14 | children: [
15 | Messageslist(),
16 | // Divider(
17 | // height: 0,
18 | // thickness: 0.5,
19 | // ),
20 | ShadowLine(),
21 | FavoriteShelf(),
22 | ChatBar(),
23 | ],
24 | ),
25 | );
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | .vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Exceptions to above rules.
37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
38 |
39 | # Api keys
40 | /assets/api/*
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/NavMsgsOccupancyGridExtension.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'dart:typed_data';
3 | import 'dart:ui';
4 |
5 | import 'package:flutter/material.dart';
6 | import 'package:ros_nodes/messages/nav_msgs/OccupancyGrid.dart';
7 |
8 | extension CallMeBritney on NavMsgsOccupancyGrid {
9 | Uint8List toRGBA({@required Color border, @required Color fill}) {
10 | var buffor = BytesBuilder();
11 | for (var value in data) {
12 | switch (value) {
13 | case -1:
14 | {
15 | buffor.add([0, 0, 0, 0]);
16 | break;
17 | }
18 | case 0:
19 | {
20 | buffor.add([fill.red, fill.green, fill.blue, fill.alpha]);
21 | break;
22 | }
23 | default:
24 | {
25 | buffor.add([border.red, border.green, border.blue, border.alpha]);
26 | break;
27 | }
28 | }
29 | }
30 | return buffor.takeBytes();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/widgets/RoundedCornersContainer.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class RoundedCornersContainer extends StatelessWidget {
4 | RoundedCornersContainer(
5 | {Key key,
6 | @required this.child,
7 | @required this.top,
8 | @required this.bottom});
9 |
10 | final Widget child;
11 | final bool top;
12 | final bool bottom;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Container(
17 | color: Theme.of(context).canvasColor,
18 | child: ClipRRect(
19 | borderRadius: BorderRadius.only(
20 | topLeft: Radius.circular(top ? 10.0 : 0),
21 | topRight: Radius.circular(top ? 10.0 : 0),
22 | bottomLeft: Radius.circular(bottom ? 10.0 : 0),
23 | bottomRight: Radius.circular(bottom ? 10.0 : 0),
24 | ),
25 | child: Container(
26 | color: Theme.of(context).scaffoldBackgroundColor,
27 | child: child,
28 | ),
29 | ),
30 | );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/models/Message.dart:
--------------------------------------------------------------------------------
1 | import 'package:audio_recorder/audio_recorder.dart';
2 | import 'package:chatapp/providers/DialogflowProvider.dart';
3 | import 'package:flutter/widgets.dart';
4 |
5 | enum Sender { user, system, bot }
6 |
7 | class IconWithDescription {
8 | final Function onTap;
9 | final IconData icon;
10 | final String description;
11 |
12 | IconWithDescription({this.onTap, this.icon, this.description})
13 | : assert(onTap != null),
14 | assert(icon != null),
15 | assert(description != null);
16 | }
17 |
18 | class Message {
19 | final String heading;
20 |
21 | // If message has no heading or description, fill body only;
22 | String body;
23 | List actions;
24 |
25 | final Sender sender;
26 | final DateTime timestamp;
27 | final CustomAIResponse aiResponse;
28 | final Recording voiceActing;
29 |
30 | Message({
31 | this.heading,
32 | this.body,
33 | this.actions,
34 | this.sender,
35 | DateTime timestamp,
36 | this.aiResponse,
37 | this.voiceActing,
38 | }) : this.timestamp = timestamp ?? DateTime.now();
39 | }
40 |
--------------------------------------------------------------------------------
/lib/widgets/RainbowLinearIndicator.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class RainbowLinearIndicator extends StatefulWidget {
4 | RainbowLinearIndicator({Key key}) : super(key: key);
5 |
6 | @override
7 | _RainbowLinearIndicatorState createState() => _RainbowLinearIndicatorState();
8 | }
9 |
10 | class _RainbowLinearIndicatorState extends State
11 | with TickerProviderStateMixin {
12 | AnimationController _controller;
13 |
14 | @override
15 | void initState() {
16 | super.initState();
17 | _controller = AnimationController(
18 | vsync: this, // the SingleTickerProviderStateMixin
19 | duration: Duration(milliseconds: 2000),
20 | );
21 | _controller.repeat(reverse: true);
22 | }
23 |
24 | @override
25 | void dispose() {
26 | _controller.dispose();
27 | super.dispose();
28 | }
29 |
30 | @override
31 | Widget build(BuildContext context) {
32 | return LinearProgressIndicator(
33 | valueColor:
34 | ColorTween(begin: Theme.of(context).accentColor, end: Colors.amber)
35 | .animate(_controller),
36 | );
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:chatapp/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 |
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | chat_app
18 |
19 |
20 |
21 |
24 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/lib/providers/AppStateProvider.dart:
--------------------------------------------------------------------------------
1 | import 'package:chatapp/generated/l10n.dart';
2 | import 'package:chatapp/screens/ChatPage.dart';
3 | import 'package:chatapp/screens/ControllerPage.dart';
4 | import 'package:chatapp/screens/MapPage.dart';
5 | import 'package:flutter/cupertino.dart';
6 |
7 | class AppStateProvider extends ChangeNotifier {
8 | var _activePageIndex = 0;
9 | static const _appPages = [ChatPage(), ControllerPage(), MapPage()];
10 |
11 | var _navigationBarPageController =
12 | PageController(initialPage: 0, keepPage: true);
13 |
14 | void setActivePage(int index) {
15 | if (index != _activePageIndex) {
16 | _activePageIndex = index;
17 | // Navigation with PagedView
18 | // if (WidgetsBinding.instance.disableAnimations) {
19 | // _navigationBarPageController.jumpToPage(index);
20 | // } else {
21 | // _navigationBarPageController.animateToPage(index,
22 | // duration: Duration(milliseconds: 400), curve: Curves.easeOutQuad);
23 | // }
24 | notifyListeners();
25 | }
26 | }
27 |
28 | int get activePageIndex => _activePageIndex;
29 | PageController get navigationBarPageController =>
30 | _navigationBarPageController;
31 | List get appPages => _appPages;
32 | }
33 |
--------------------------------------------------------------------------------
/lib/widgets/RainbowCircularIndicator.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class RainbowCircularIndicator extends StatefulWidget {
4 | RainbowCircularIndicator({Key key}) : super(key: key);
5 |
6 | @override
7 | _RainbowCircularIndicatorState createState() =>
8 | _RainbowCircularIndicatorState();
9 | }
10 |
11 | class _RainbowCircularIndicatorState extends State
12 | with TickerProviderStateMixin {
13 | AnimationController _controller;
14 |
15 | @override
16 | void initState() {
17 | super.initState();
18 | _controller = AnimationController(
19 | vsync: this, // the SingleTickerProviderStateMixin
20 | duration: Duration(milliseconds: 2000),
21 | );
22 | _controller.repeat(reverse: true);
23 | }
24 |
25 | @override
26 | void dispose() {
27 | _controller.dispose();
28 | super.dispose();
29 | }
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | return CircularProgressIndicator(
34 | valueColor: ColorTween(
35 | begin: Theme.of(context).accentColor,
36 | end: Theme.of(context).brightness == Brightness.light
37 | ? Colors.pinkAccent[100]
38 | : Colors.amber)
39 | .animate(_controller),
40 | );
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | chatapp
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/widgets/MapShelfButtons.dart:
--------------------------------------------------------------------------------
1 | import 'package:chatapp/generated/l10n.dart';
2 | import 'package:chatapp/providers/RosProvider.dart';
3 | import 'package:chatapp/providers/SettingsProvider.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | class MapShelfButtons extends StatelessWidget {
8 | const MapShelfButtons({Key key}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Container(
13 | child: Wrap(children: [
14 | Consumer2(
15 | builder: (context, settingsProvider, rosProvider, child) =>
16 | FloatingActionButton(
17 | tooltip: S?.of(context)?.pageMapButtonGrid,
18 | backgroundColor: Theme.of(context).chipTheme.backgroundColor,
19 | elevation: Provider.of(context).mapImageAvailable
20 | ? null
21 | : 0,
22 | mini: true,
23 | child: Icon(
24 | settingsProvider.showMapGrid
25 | ? Icons.grid_on
26 | : Icons.grid_off,
27 | color: Provider.of(context).mapImageAvailable
28 | ? Theme.of(context).brightness == Brightness.light
29 | ? Colors.black45
30 | : Colors.white
31 | : Theme.of(context).brightness == Brightness.light
32 | ? Colors.black12
33 | : Colors.white24),
34 | onPressed: () {
35 | if (rosProvider.mapImageAvailable)
36 | settingsProvider.toggleMapGrid();
37 | }))
38 | ]));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
17 |
24 |
25 |
26 |
27 |
28 |
29 |
31 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/lib/widgets/MessagesList.dart:
--------------------------------------------------------------------------------
1 | import 'package:chatapp/providers/ChatInfoProvider.dart';
2 | import 'package:chatapp/providers/SettingsProvider.dart';
3 | import 'package:chatapp/widgets/BubbleMessage.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | class Messageslist extends StatelessWidget {
8 | final controller = ScrollController();
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | Provider.of(context, listen: false).addListener(
13 | () async {
14 | await Future.delayed(Duration(milliseconds: 250));
15 | if (controller.positions.isEmpty) return;
16 | if (WidgetsBinding.instance.disableAnimations) {
17 | controller.jumpTo(
18 | controller.position.maxScrollExtent,
19 | );
20 | } else {
21 | controller.animateTo(controller.position.maxScrollExtent,
22 | duration: Duration(milliseconds: 500), curve: Curves.easeInOut);
23 | }
24 | },
25 | );
26 | return Flexible(
27 | child: Consumer(
28 | builder: (context, provider, child) => AnimatedList(
29 | physics: Provider.of(context, listen: false)
30 | .limitAnimations ??
31 | false
32 | ? null
33 | : BouncingScrollPhysics(),
34 | padding: EdgeInsets.only(top: 5, bottom: 20, left: 0, right: 0),
35 | key: provider.listKey,
36 | reverse: false,
37 | controller: controller,
38 | initialItemCount: provider.messages.length,
39 | itemBuilder: (context, index, animation) {
40 | return SlideTransition(
41 | position: Tween(
42 | begin: const Offset(0, 1.5),
43 | end: Offset.zero,
44 | ).animate(animation),
45 | child: BubbleMessage(
46 | message: provider.messages[index],
47 | ),
48 | );
49 | },
50 | ),
51 | ),
52 | );
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/lib/providers/AudioProvider.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:io';
3 |
4 | import 'package:audio_recorder/audio_recorder.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:path_provider/path_provider.dart';
7 | import 'package:uuid/uuid.dart';
8 | import 'package:soundpool/soundpool.dart';
9 |
10 | //Recording and playing sounds
11 | class AudioProvider extends ChangeNotifier {
12 | final bubbleMessagePool = Soundpool();
13 |
14 | //Split into play/pause/stop?
15 | Future playBubbleUserMessageVoice(String path) async {
16 | bubbleMessagePool.release();
17 | final bubbleMessageContent = await File(path).readAsBytes();
18 | final soundId = await bubbleMessagePool.loadUint8List(bubbleMessageContent);
19 | bubbleMessagePool.play(soundId);
20 | }
21 |
22 | Future playBubbleBotMessageVoice(String audio) async {
23 | bubbleMessagePool.release();
24 | final soundId = await bubbleMessagePool.loadUint8List(base64Decode(audio));
25 | bubbleMessagePool.play(soundId);
26 | }
27 |
28 | //Updating recordID everytime new record is created
29 | Future getRecordingPath() async {
30 | var directory = await getTemporaryDirectory();
31 | return directory.path + '/recordings/' + Uuid().v1();
32 | }
33 |
34 | bool _hasPermission = true;
35 | bool get hasPermission => _hasPermission;
36 | Future _checkPermission() async {
37 | _hasPermission = await AudioRecorder.hasPermissions;
38 | return _hasPermission;
39 | }
40 |
41 | bool _isRecording = false;
42 | bool get isRecording => _isRecording;
43 |
44 | Future start() async {
45 | if (!await _checkPermission()) return;
46 |
47 | var path = await getRecordingPath();
48 | print(path);
49 | print("started!!!!!!!!");
50 | await AudioRecorder.start(
51 | path: path, audioOutputFormat: AudioOutputFormat.WAV);
52 | _isRecording = await AudioRecorder.isRecording;
53 | notifyListeners();
54 | }
55 |
56 | Future stop() async {
57 | var recorrding = await AudioRecorder.stop();
58 | _isRecording = await AudioRecorder.isRecording;
59 | notifyListeners();
60 |
61 | return recorrding;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/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.pawelfranitza.chatapp"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | testInstrumentationRunner "androidx.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 'androidx.test:runner:1.1.1'
66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
67 | }
68 |
--------------------------------------------------------------------------------
/lib/l10n/intl_en.arb:
--------------------------------------------------------------------------------
1 | {
2 | "tooltipStopActions": "Stop actions",
3 | "tooltipRefreshConnection": "Refresh connection",
4 | "tooltipSettings": "Settings",
5 | "tooltipChatMode": "Text input",
6 | "tooltipChatStar": "Quick Replies",
7 | "tooltipRandom": "Random name",
8 | "tooltipCurrentLocation": "Current robot location",
9 | "tooltipCoordinates": "Coordinates",
10 | "pageChatTitle": "Chat",
11 | "pageChatTexting": "Order",
12 | "pageChatRecording": "Recording",
13 | "pageChatIntroTitle": "Hello",
14 | "pageChatIntroBody": "Try to talk with voice assistant to issue commands. To begin:",
15 | "pageChatIntroAction1": "Click text icon or order field",
16 | "pageChatIntroAction2": "Hold mic icon",
17 | "pageControllerTitle": "Controller",
18 | "pageControllerInfoTitle": "Waiting for cammera topic",
19 | "pageMapTitle": "Map",
20 | "pageMapInfoTitle": "Waiting for map topic",
21 | "pageMapButtonGrid": "Show / hide grid",
22 | "pageMapButtonFloating": "Add new map marker",
23 | "pageMapInitialRooms": "{room, select, kitchen {Kitchen} livingRoom {Living room} bedroom {Bedroom} bathroom {Bathroom}",
24 | "pageSettingsTitle": "Settings",
25 | "pageSettingsGeneral": "{type, select, title {App settings} desc {General settings & accessibility}}",
26 | "pageSettingsThemes": "{theme, select, light {Light theme} dark {Dark theme} system {System theme}}",
27 | "pageSettingsAnimations": "{type, select, title {Limit animations} desc {Changes how lists and messages animate}}",
28 | "pageSettingsButtonsDesc": "{type, select, title {Button labels} desc {Show additional labels under buttons}}",
29 | "pageSettingsRos": "{type, select, title {Ros configuration} desc {Ros web config of main and current device}}",
30 | "pageSettingsRosMain": "Main server (ip)",
31 | "pageSettingsRosDevice": "This device (ip)",
32 | "pageSettingsRosOdom": "Odometry",
33 | "pageSettingsRosCamera": "Camera",
34 | "pageSettingsRosBattery": "Battery",
35 | "pageSettingsRosVelocity": "Linear / angular velocity",
36 | "pageSettingsRosMap": "Map",
37 | "pageSettingsRosNavigation": "Navigation / Goal",
38 | "pageSettingsRosChatter": "Chatter",
39 | "pageSettingsAbout": "About",
40 | "creatorAddNew": "Add new marker",
41 | "creatorEdit": "Edit marker",
42 | "creatorName": "Name",
43 | "creatorHue": "Hue"
44 | }
--------------------------------------------------------------------------------
/lib/generated/intl/messages_all.dart:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2 | // This is a library that looks up messages for specific locales by
3 | // delegating to the appropriate library.
4 |
5 | // Ignore issues from commonly used lints in this file.
6 | // ignore_for_file:implementation_imports, file_names, unnecessary_new
7 | // ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering
8 | // ignore_for_file:argument_type_not_assignable, invalid_assignment
9 | // ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases
10 | // ignore_for_file:comment_references
11 |
12 | import 'dart:async';
13 |
14 | import 'package:intl/intl.dart';
15 | import 'package:intl/message_lookup_by_library.dart';
16 | import 'package:intl/src/intl_helpers.dart';
17 |
18 | import 'messages_en.dart' as messages_en;
19 | import 'messages_pl.dart' as messages_pl;
20 |
21 | typedef Future LibraryLoader();
22 | Map _deferredLibraries = {
23 | 'en': () => new Future.value(null),
24 | 'pl': () => new Future.value(null),
25 | };
26 |
27 | MessageLookupByLibrary _findExact(String localeName) {
28 | switch (localeName) {
29 | case 'en':
30 | return messages_en.messages;
31 | case 'pl':
32 | return messages_pl.messages;
33 | default:
34 | return null;
35 | }
36 | }
37 |
38 | /// User programs should call this before using [localeName] for messages.
39 | Future initializeMessages(String localeName) async {
40 | var availableLocale = Intl.verifiedLocale(
41 | localeName,
42 | (locale) => _deferredLibraries[locale] != null,
43 | onFailure: (_) => null);
44 | if (availableLocale == null) {
45 | return new Future.value(false);
46 | }
47 | var lib = _deferredLibraries[availableLocale];
48 | await (lib == null ? new Future.value(false) : lib());
49 | initializeInternalMessageLookup(() => new CompositeMessageLookup());
50 | messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
51 | return new Future.value(true);
52 | }
53 |
54 | bool _messagesExistFor(String locale) {
55 | try {
56 | return _findExact(locale) != null;
57 | } catch (e) {
58 | return false;
59 | }
60 | }
61 |
62 | MessageLookupByLibrary _findGeneratedMessagesFor(String locale) {
63 | var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
64 | onFailure: (_) => null);
65 | if (actualLocale == null) return null;
66 | return _findExact(actualLocale);
67 | }
68 |
--------------------------------------------------------------------------------
/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/l10n/intl_pl.arb:
--------------------------------------------------------------------------------
1 | {
2 | "tooltipStopActions": "Zatrzymaj akcje robota",
3 | "tooltipRefreshConnection": "Odśwież połączenie",
4 | "tooltipSettings": "Ustawienia",
5 | "tooltipChatMode": "Polecenie tekstowe",
6 | "tooltipChatStar": "Szybkie odpowiedzi",
7 | "tooltipRandom": "Wylosuj nazwę",
8 | "tooltipCurrentLocation": "Aktualne położenie robota",
9 | "tooltipCoordinates": "Ręczne koordynaty",
10 | "pageChatTitle": "Chat",
11 | "pageChatTexting": "Polecenie",
12 | "pageChatRecording": "Nagrywam...",
13 | "pageChatIntroTitle": "Hello",
14 | "pageChatIntroBody": "Try to talk with voice assistant to issue commands. To begin:",
15 | "pageChatIntroAction1": "Click text icon or order field",
16 | "pageChatIntroAction2": "Hold mic icon",
17 | "pageControllerTitle": "Controller",
18 | "pageControllerInfoTitle": "Czekam na obraz z kamery",
19 | "pageMapTitle": "Mapa",
20 | "pageMapInfoTitle": "Czekam na obraz mapy",
21 | "pageMapButtonGrid": "Pokaż / ukryj siatkę",
22 | "pageMapButtonFloating": "Utwórz nowy znacznik lokalizacyjny",
23 | "pageMapInitialRooms": "{room, select, kitchen {Kitchen} livingRoom {Living room} bedroom {Bedroom} bathroom {Bathroom}",
24 | "pageSettingsTitle": "Ustawienia",
25 | "pageSettingsGeneral": "{type, select, title {Ustawienia aplikacji} desc {Ogólne ustawienia i opcje dostępu}}",
26 | "pageSettingsThemes": "{theme, select, light {Jasny motyw} dark {Ciemny motyw} system {Systemowy motyw}}",
27 | "pageSettingsAnimations": "{type, select, title {Ogranicz animacje} desc {Zmienia zachowanie list, wiadomości}}",
28 | "pageSettingsButtonsDesc": "{type, select, title {Podpisy przycisków} desc {Dodaje podpisy pod przyciskami nawigacji}}",
29 | "pageSettingsRos": "{type, select, title {Konfiguracja ROS} desc {Konfiguracja sieciowa ROS, należy wprowadzić adres urządzenia roscore i adres ip aktualnego urządzenia}}",
30 | "pageSettingsRosMain": "Główny serwer (ip)",
31 | "pageSettingsRosDevice": "To urządzenie (ip)",
32 | "pageSettingsRosOdom": "Odometria robota",
33 | "pageSettingsRosCamera": "Kamera",
34 | "pageSettingsRosBattery": "Bateria",
35 | "pageSettingsRosVelocity": "Prędkość liniowa / kątowa silników",
36 | "pageSettingsRosMap": "Mapa",
37 | "pageSettingsRosNavigation": "Nawigacja / Cel",
38 | "pageSettingsRosChatter": "Chatter",
39 | "pageSettingsAbout": "O aplikacji",
40 | "creatorAddNew": "Dodaj nowy znacznik",
41 | "creatorEdit": "Edytuj znacznik",
42 | "creatorName": "Nazwa",
43 | "creatorHue": "Barwa"
44 | }
--------------------------------------------------------------------------------
/lib/providers/ChatInfoProvider.dart:
--------------------------------------------------------------------------------
1 | import 'package:chatapp/generated/l10n.dart';
2 | import 'package:chatapp/models/Message.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter/scheduler.dart';
5 | import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
6 |
7 | class ChatInfoProvider extends ChangeNotifier {
8 | //favorite shelf
9 | var _favoriteShelfOpen = true;
10 | void toggleFavoriteShelf() {
11 | _favoriteShelfOpen = !_favoriteShelfOpen;
12 | notifyListeners();
13 | }
14 |
15 | var _listKey = GlobalKey();
16 | List _messages = [
17 | Message(
18 | heading: "Hello",
19 | body:
20 | 'Voice and chat commands are disabled by default in this app version. You can issue commands in controller and map pages. Your actions will show below',
21 | sender: Sender.system,
22 | actions: [
23 | // IconWithDescription(
24 | // onTap: () {
25 | // print('aaa');
26 | // },
27 | // icon: MdiIcons.textShort,
28 | // description:
29 | // 'Naciśnij ikonę tekstu lub kliknij pole "Polecenie"'),
30 | // IconWithDescription(
31 | // onTap: () {
32 | // print('aaa');
33 | // },
34 | // icon: Icons.mic,
35 | // description:
36 | // 'Trzymaj ikonę mikrofonu aby nagrać wiadomość głosową'),
37 | ])
38 | ];
39 |
40 | var _controller = TextEditingController();
41 | var _isControllerEmpty = true;
42 |
43 | ChatInfoProvider() : super() {
44 | _controller.addListener(_textUpdate);
45 | }
46 |
47 | void clearController() {
48 | SchedulerBinding.instance.addPostFrameCallback((_) {
49 | _controller.clear();
50 | });
51 | }
52 |
53 | void _textUpdate() {
54 | if (_isControllerEmpty != _controller.text.isEmpty) {
55 | _isControllerEmpty = _controller.text.isEmpty;
56 | notifyListeners();
57 | }
58 | }
59 |
60 | void addMessage({@required Message message}) {
61 | if (_listKey.currentWidget != null) {
62 | print("Animowanie");
63 | _listKey.currentState.insertItem(_messages.length,
64 | duration: const Duration(milliseconds: 150));
65 | clearController();
66 | }
67 | _messages.add(message);
68 | notifyListeners();
69 | }
70 |
71 | // Works as speech to text from dialogflow
72 | void updateLastVoiceMessageDescription(String description) {
73 | if (_messages[_messages.length - 2].body ==
74 | "Wiadomość głosowa bez transkrypcji") {
75 | _messages[_messages.length - 2].body = description;
76 | notifyListeners();
77 | }
78 | }
79 |
80 | bool get favoriteShelfOpen => _favoriteShelfOpen;
81 | bool get isControllerEmpty => _isControllerEmpty;
82 | TextEditingController get chatTextController => _controller;
83 | GlobalKey get listKey => _listKey;
84 | List get messages => _messages;
85 | }
86 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: chatapp
2 | description: Flutter chat app
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.8.0 <3.0.0"
18 |
19 | dependencies:
20 | flutter:
21 | sdk: flutter
22 | cupertino_icons: ^0.1.2
23 | provider: ^4.0.5+1
24 | flutter_dialogflow: ^0.1.3
25 | uuid: ^2.0.0
26 | soundpool: ^1.0.1
27 | audio_recorder: ^1.0.2
28 | path_provider: ^1.6.7
29 | basic_utils: ^2.5.3
30 | material_design_icons_flutter: ^4.0.5345
31 | shared_preferences: ^0.5.8
32 | ros_nodes:
33 | git:
34 | url: git://github.com/Sashiri/ros_nodes.git
35 | localstorage: ^3.0.0
36 | flutter_colorpicker: ^0.3.4
37 | english_words: ^3.1.5
38 | flutter_localizations:
39 | sdk: flutter
40 | permission_handler: ^5.0.1+1
41 |
42 | dev_dependencies:
43 | flutter_test:
44 | sdk: flutter
45 |
46 | # For information on the generic Dart part of this file, see the
47 | # following page: https://dart.dev/tools/pub/pubspec
48 | # The following section is specific to Flutter.
49 | flutter:
50 |
51 | # The following line ensures that the Material Icons font is
52 | # included with your application, so that you can use the icons in
53 | # the material Icons class.
54 | uses-material-design: true
55 |
56 | # To add assets to your application, add an assets section, like this:
57 | assets:
58 | - assets/dialogflowapi.json
59 | # - images/a_dot_burr.jpeg
60 | # - images/a_dot_ham.jpeg
61 | # An image asset can refer to one or more resolution-specific "variants", see
62 | # https://flutter.dev/assets-and-images/#resolution-aware.
63 | # For details regarding adding assets from package dependencies, see
64 | # https://flutter.dev/assets-and-images/#from-packages
65 | # To add custom fonts to your application, add a fonts section here,
66 | # in this "flutter" section. Each entry in this list should have a
67 | # "family" key with the font family name, and a "fonts" key with a
68 | # list giving the asset and other descriptors for the font. For
69 | # example:
70 | # fonts:
71 | # - family: Schyler
72 | # fonts:
73 | # - asset: fonts/Schyler-Regular.ttf
74 | # - asset: fonts/Schyler-Italic.ttf
75 | # style: italic
76 | # - family: Trajan Pro
77 | # fonts:
78 | # - asset: fonts/TrajanPro.ttf
79 | # - asset: fonts/TrajanPro_Bold.ttf
80 | # weight: 700
81 | #
82 | # For details regarding fonts from package dependencies,
83 | # see https://flutter.dev/custom-fonts/#from-packages
84 | flutter_intl:
85 | enabled: true
86 |
--------------------------------------------------------------------------------
/lib/widgets/RoomShelf.dart:
--------------------------------------------------------------------------------
1 | import 'package:chatapp/models/Message.dart';
2 | import 'package:chatapp/providers/ChatInfoProvider.dart';
3 | import 'package:chatapp/providers/DialogflowProvider.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:provider/provider.dart';
6 | import 'package:chatapp/models/ListExtension.dart';
7 |
8 | class RoomShelf extends StatelessWidget {
9 | List buildSugestions(BuildContext context) {
10 | var chatInfoProvider = Provider.of(context);
11 | var message = chatInfoProvider.messages.last;
12 |
13 | if (message.aiResponse == null) {
14 | return [];
15 | }
16 |
17 | var params = message.aiResponse.suggestions;
18 | return params
19 | .map(
20 | (suggestion) => GestureDetector(
21 | child: Chip(
22 | shape: StadiumBorder(
23 | side: BorderSide(color: Colors.amber[300], width: 2)),
24 | elevation: 0,
25 | label: Text(
26 | suggestion['title'],
27 | style: TextStyle(color: Colors.black),
28 | ),
29 | backgroundColor: Colors.amber[200],
30 | ),
31 | onTap: () {
32 | chatInfoProvider.addMessage(
33 | message:
34 | Message(body: suggestion['title'], sender: Sender.user));
35 | Provider.of(context, listen: false)
36 | .response(suggestion['title'])
37 | .then((response) => chatInfoProvider.addMessage(
38 | message: Message(
39 | body: response.getMessage(),
40 | sender: Sender.bot,
41 | aiResponse: response)));
42 | },
43 | ),
44 | )
45 | .toList();
46 | }
47 |
48 | @override
49 | Widget build(BuildContext context) {
50 | return Material(
51 | color: Colors.grey.withOpacity(0.1),
52 | // color: Colors.transparent,
53 | child: Consumer(
54 | builder: (BuildContext context, ChatInfoProvider chatInfoProvider,
55 | Widget child) {
56 | var isUser =
57 | chatInfoProvider.messages.last?.sender == Sender.user ?? true;
58 | var suggestionAvailable = chatInfoProvider
59 | .messages.last?.aiResponse?.suggestions?.isNotEmpty ??
60 | false;
61 | return Container(
62 | child: AnimatedContainer(
63 | height: chatInfoProvider.favoriteShelfOpen && suggestionAvailable
64 | ? 50
65 | : 0,
66 | width: MediaQuery.of(context).size.width,
67 | duration: Duration(
68 | milliseconds:
69 | WidgetsBinding.instance.disableAnimations ? 0 : 150),
70 | child: !isUser ? child : SizedBox(),
71 | ),
72 | );
73 | },
74 | child: Center(
75 | child: Container(
76 | child: ListView(
77 | reverse: false,
78 | padding: EdgeInsets.symmetric(horizontal: 16),
79 | scrollDirection: Axis.horizontal,
80 | shrinkWrap: true,
81 | children: buildSugestions(context).insertEveryNth(
82 | SizedBox(
83 | width: 10,
84 | ),
85 | ),
86 | ),
87 | ),
88 | ),
89 | ),
90 | );
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/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/widgets/StatusInfo.dart:
--------------------------------------------------------------------------------
1 | import 'package:chatapp/providers/RosProvider.dart';
2 | import 'package:chatapp/providers/SettingsProvider.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | class StatusInfo extends StatelessWidget {
8 | const StatusInfo({Key key}) : super(key: key);
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return Padding(
13 | padding: const EdgeInsets.only(top: 10, left: 10),
14 | child: Consumer2(
15 | builder: (context, settingsProvider, rosProvider, child) => Wrap(
16 | direction: Axis.horizontal,
17 | spacing: 5,
18 | children: [
19 | MiniInfoButton(
20 | iconData: MdiIcons.lightningBolt,
21 | text: settingsProvider.topicBattery,
22 | tooltip: 'Poziom naładowania baterii',
23 | iconColor: Colors.amberAccent,
24 | ),
25 | MiniInfoButton(
26 | iconData: MdiIcons.arrowUp,
27 | text: rosProvider.veliocityAvailable
28 | ? rosProvider.veliocity.linear.x >= 0
29 | ? ' ${rosProvider.veliocity.linear.x.toStringAsFixed(2)}'
30 | : rosProvider.veliocity.linear.x.toStringAsFixed(2)
31 | : settingsProvider.topicVelocity,
32 | tooltip: 'Prędkość liniowa',
33 | iconColor: Colors.greenAccent,
34 | ),
35 | MiniInfoButton(
36 | iconData: MdiIcons.rotateRight,
37 | text: rosProvider.veliocityAvailable
38 | ? rosProvider.veliocity.angular.z.sign >= 0
39 | ? ' ${rosProvider.veliocity.angular.z.toStringAsFixed(2)}'
40 | : rosProvider.veliocity.angular.z.toStringAsFixed(2)
41 | : settingsProvider.topicVelocity,
42 | tooltip: 'Prędkość kątowa',
43 | iconColor: Colors.blueAccent,
44 | ),
45 | ],
46 | ),
47 | ),
48 | );
49 | }
50 | }
51 |
52 | class MiniInfoButton extends StatelessWidget {
53 | const MiniInfoButton(
54 | {Key key,
55 | @required this.tooltip,
56 | @required this.text,
57 | @required this.iconData,
58 | this.iconColor})
59 | : assert(text != null),
60 | assert(iconData != null),
61 | assert(tooltip != null),
62 | super(key: key);
63 |
64 | final String tooltip;
65 | final String text;
66 | final IconData iconData;
67 | final Color iconColor;
68 |
69 | @override
70 | Widget build(BuildContext context) {
71 | return Tooltip(
72 | message: tooltip,
73 | child: Theme(
74 | data: Theme.of(context)
75 | .copyWith(canvasColor: Theme.of(context).canvasColor),
76 | child: Chip(
77 | elevation: 0,
78 | backgroundColor: Colors.transparent,
79 | // shape: StadiumBorder(
80 | // side: BorderSide(color: Theme.of(context).canvasColor, width: 1)),
81 | materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
82 | labelPadding: EdgeInsets.only(left: 3, right: 4),
83 | avatar: Icon(iconData,
84 | size: 18, color: iconColor ?? Theme.of(context).iconTheme.color),
85 | label: Text(
86 | text,
87 |
88 | //Theme.of(context).textTheme.caption
89 | style: Theme.of(context).textTheme.caption,
90 | ),
91 | visualDensity: VisualDensity.compact,
92 | ),
93 | ),
94 | );
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/lib/providers/DialogflowProvider.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:core';
3 | import 'dart:io';
4 |
5 | import 'package:flutter/material.dart';
6 | import 'package:flutter_dialogflow/dialogflow_v2.dart';
7 |
8 | //audiotesting
9 |
10 | import 'package:soundpool/soundpool.dart';
11 |
12 | extension MapExtensions on Map {
13 | Map getMap(K key) {
14 | var keyFound = this.containsKey(key);
15 | if (!keyFound) {
16 | return null;
17 | }
18 |
19 | var value = this[key];
20 | if (value is Map) {
21 | return value;
22 | }
23 | return null;
24 | }
25 |
26 | V getValue(K key) => this[key];
27 | }
28 |
29 | class CustomAIResponse extends AIResponse {
30 | List