Merge branch 'master' into othmane2

profile
Othmane BENJELLOUN 2 years ago
commit c266f87fc2

6
.gitignore vendored

@ -118,3 +118,9 @@ app.*.symbols
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
# Linux flutter
linux/flutter/generated_plugin_registrant.cc
linux/flutter/generated_plugins.cmake
windows/flutter/generated_plugin_registrant.cc
windows/flutter/generated_plugins.cmake

@ -24,6 +24,7 @@ if (flutterVersionName == null) {
android {
namespace "com.example.smartfit_app_mobile"
//compileSdkVersion localProperties.getProperty('flutter.compileSdkVersion').toInteger()
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
@ -45,8 +46,11 @@ android {
applicationId "com.example.smartfit_app_mobile"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
//minSdkVersion flutter.minSdkVersion
minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
//minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
targetSdkVersion flutter.targetSdkVersion
//argetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger()
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()

@ -1,16 +0,0 @@
/*
enum DeviceConnectionStatus { NOT_CONNECTED, CONNECTING, CONNECTED }
enum DeviceConnectionStatus { NOT_CONNECTED, CONNECTING, CONNECTED }
extension DeviceConnectionStatusExtenstion on DeviceConnectionStatus {
String get statusName {
switch (this) {
case DeviceConnectionStatus.NOT_CONNECTED:
return "Not connected";
case DeviceConnectionStatus.CONNECTING:
return "Connecting";
case DeviceConnectionStatus.CONNECTED:
return "MDS connected";
}
}
}*/

@ -1,55 +0,0 @@
/*
import 'package:smartfit_app_mobile/Modele/Mds/DeviceConnectionStatus.dart';
class Device {
String? _address;
String? _name;
String? _serial;
DeviceConnectionStatus _connectionStatus =
DeviceConnectionStatus.NOT_CONNECTED;
Device(String? name, String? address) {
_name = name;
_address = address;
}
//String? get name => _name != null ? _name : "";
String? get name {
if (_name == null) {
return "";
}
return _name;
}
//String? get address => _address != null ? _address : "";
String? get address {
if (_address == null) {
return "";
}
return _address;
}
//String? get serial => _serial != null ? _serial : "";
String? get serial {
if (_serial == null) {
return "";
}
return _serial;
}
DeviceConnectionStatus get connectionStatus => _connectionStatus;
void onConnecting() => _connectionStatus = DeviceConnectionStatus.CONNECTING;
void onMdsConnected(String serial) {
_serial = serial;
_connectionStatus = DeviceConnectionStatus.CONNECTED;
}
void onDisconnected() =>
_connectionStatus = DeviceConnectionStatus.NOT_CONNECTED;
bool operator ==(o) =>
o is Device && o._address == _address && o._name == _name;
int get hashCode => _address.hashCode * _name.hashCode;
}
*/

@ -1,101 +0,0 @@
/*
import 'dart:collection';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:mdsflutter/Mds.dart';
import 'package:smartfit_app_mobile/Modele/Mds/DeviceConnectionStatus.dart';
import 'package:smartfit_app_mobile/Modele/Mds/device.dart';
// Doc - https://pub.dev/packages/mdsflutter
//https://github.com/petri-lipponen-movesense/mdsflutter/tree/master/example/lib
class ManagerStateWatch extends ChangeNotifier {
final Set<Device> _deviceList = {};
bool _scanning = false;
// ------------------ //
bool get scanning => _scanning;
UnmodifiableListView<Device> get deviceList =>
UnmodifiableListView(_deviceList);
// ------------------ //
void startScan() {
// On deconnecte les devices si ils sont connecté
_deviceList.forEach((device) {
if (device.connectionStatus == DeviceConnectionStatus.CONNECTED) {
disconnect(device);
}
});
// On vide la liste
_deviceList.clear();
notifyListeners();
// On lance le scan
try {
Mds.startScan((name, address) {
Device device = Device(name, address);
if (!_deviceList.contains(device)) {
_deviceList.add(device);
notifyListeners();
}
});
_scanning = true;
notifyListeners();
} on PlatformException {
_scanning = false;
notifyListeners();
}
}
void stopScan() {
Mds.stopScan();
_scanning = false;
notifyListeners();
}
void disconnect(Device device) {
// Deconnexion matérielle
Mds.disconnect(device.address!);
disconnectOnModele(device.address);
}
void disconnectOnModele(String? address) {
// Deconnexion avec l'enum
Device foundDevice =
_deviceList.firstWhere((element) => element.address == address);
foundDevice.onDisconnected();
notifyListeners();
}
void connectToDevice(Device device) {
// Changement de l'enum (On connecting)
device.onConnecting();
// Connexion matérielle
Mds.connect(
device.address!,
// Connexion établi
(serial) => _onDeviceMdsConnected(device.address, serial),
// Connexion coupé
() => disconnectOnModele(device.address),
// Erreur dans la connexion
() => _onDeviceConnectError(device.address));
}
// Appeller si la connexion à réussi
void _onDeviceMdsConnected(String? address, String serial) {
Device foundDevice =
_deviceList.firstWhere((element) => element.address == address);
// On save le serial + changer l'enum en connected
foundDevice.onMdsConnected(serial);
notifyListeners();
}
// Appeller si une erreur survient dans la connexion
void _onDeviceConnectError(String? address) {
disconnectOnModele(address);
}
}*/

@ -1,5 +1,4 @@
import 'dart:convert';
import 'dart:ffi';
import 'dart:io';
import 'package:csv/csv.dart';
import 'package:fit_tool/fit_tool.dart';
@ -78,13 +77,15 @@ class ManagerFile {
firtTimeStamp = ligne[4];
}
//result.add([(ligne[4] - firtTimeStamp) ~/ 100, ligne[10]]);
result.add(FlSpot((ligne[4] - firtTimeStamp) ~/ 100, ligne[10]));
} else if (ligne.length >= 16 && ligne[16] == "heart_rate") {
result.add(
FlSpot((ligne[4] - firtTimeStamp) / 100, ligne[10].toDouble()));
} else if (ligne.length >= 16 && ligne[15] == "heart_rate") {
if (firtTimeStamp == 0) {
firtTimeStamp = ligne[4];
}
//result.add([(ligne[4] - firtTimeStamp) ~/ 100, ligne[17]]);
result.add(FlSpot((ligne[4] - firtTimeStamp) ~/ 100, ligne[17]));
result.add(
FlSpot((ligne[4] - firtTimeStamp) / 100, ligne[16].toDouble()));
}
}
}

@ -1,5 +1,4 @@
import 'package:smartfit_app_mobile/common_widget/steps.dart';
import 'package:smartfit_app_mobile/common_widget/dates.dart';
import 'package:smartfit_app_mobile/common_widget/graph.dart';
import 'package:smartfit_app_mobile/common_widget/info.dart' hide Stats;
import 'package:smartfit_app_mobile/common_widget/stats.dart';

@ -2,7 +2,6 @@ import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import '../../common/colo_extension.dart';
import '../../common_widget/latest_activity_row.dart';
import '../../common_widget/today_target_cell.dart';
class ActivityTrackerView extends StatefulWidget {
@ -209,23 +208,20 @@ class _ActivityTrackerViewState extends State<ActivityTrackerView> {
)),
],
),
SizedBox(
height: media.width * 0.05,
),
Container(
height: media.width * 0.5,
padding: const EdgeInsets.symmetric(vertical: 15 , horizontal: 0),
padding:
const EdgeInsets.symmetric(vertical: 15, horizontal: 0),
decoration: BoxDecoration(
color: TColor.white,
borderRadius: BorderRadius.circular(15),
boxShadow: const [
BoxShadow(color: Colors.black12, blurRadius: 3)
]),
child: BarChart(
BarChartData(
child: BarChart(BarChartData(
barTouchData: BarTouchData(
touchTooltipData: BarTouchTooltipData(
tooltipBgColor: Colors.grey,
@ -317,15 +313,11 @@ class _ActivityTrackerViewState extends State<ActivityTrackerView> {
),
barGroups: showingGroups(),
gridData: FlGridData(show: false),
)
),
)),
),
SizedBox(
height: media.width * 0.05,
),
SizedBox(
height: media.width * 0.1,
),
@ -375,22 +367,30 @@ class _ActivityTrackerViewState extends State<ActivityTrackerView> {
child: text,
);
}
List<BarChartGroupData> showingGroups() => List.generate(7, (i) {
switch (i) {
case 0:
return makeGroupData(0, 5, TColor.primaryG , isTouched: i == touchedIndex);
return makeGroupData(0, 5, TColor.primaryG,
isTouched: i == touchedIndex);
case 1:
return makeGroupData(1, 10.5, TColor.secondaryG, isTouched: i == touchedIndex);
return makeGroupData(1, 10.5, TColor.secondaryG,
isTouched: i == touchedIndex);
case 2:
return makeGroupData(2, 5, TColor.primaryG , isTouched: i == touchedIndex);
return makeGroupData(2, 5, TColor.primaryG,
isTouched: i == touchedIndex);
case 3:
return makeGroupData(3, 7.5, TColor.secondaryG, isTouched: i == touchedIndex);
return makeGroupData(3, 7.5, TColor.secondaryG,
isTouched: i == touchedIndex);
case 4:
return makeGroupData(4, 15, TColor.primaryG , isTouched: i == touchedIndex);
return makeGroupData(4, 15, TColor.primaryG,
isTouched: i == touchedIndex);
case 5:
return makeGroupData(5, 5.5, TColor.secondaryG, isTouched: i == touchedIndex);
return makeGroupData(5, 5.5, TColor.secondaryG,
isTouched: i == touchedIndex);
case 6:
return makeGroupData(6, 8.5, TColor.primaryG , isTouched: i == touchedIndex);
return makeGroupData(6, 8.5, TColor.primaryG,
isTouched: i == touchedIndex);
default:
return throw Error();
}
@ -399,20 +399,20 @@ class _ActivityTrackerViewState extends State<ActivityTrackerView> {
BarChartGroupData makeGroupData(
int x,
double y,
List<Color> barColor,
{
List<Color> barColor, {
bool isTouched = false,
double width = 22,
List<int> showTooltips = const [],
}) {
return BarChartGroupData(
x: x,
barRods: [
BarChartRodData(
toY: isTouched ? y + 1 : y,
gradient: LinearGradient(colors: barColor, begin: Alignment.topCenter, end: Alignment.bottomCenter ),
gradient: LinearGradient(
colors: barColor,
begin: Alignment.topCenter,
end: Alignment.bottomCenter),
width: width,
borderSide: isTouched
? const BorderSide(color: Colors.green)
@ -427,5 +427,4 @@ class _ActivityTrackerViewState extends State<ActivityTrackerView> {
showingTooltipIndicators: showTooltips,
);
}
}

@ -8,7 +8,6 @@ import 'package:flutter/material.dart';
import 'package:simple_animation_progress_bar/simple_animation_progress_bar.dart';
import 'package:simple_circular_progress_bar/simple_circular_progress_bar.dart';
import 'package:smartfit_app_mobile/view/home/activity_tracker.dart';
import 'package:smartfit_app_mobile/view/home/blank_view.dart';
import 'package:smartfit_app_mobile/view/home/notification_view.dart';
import '../../common/colo_extension.dart';
//import 'activity_tracker_view.dart';
@ -303,7 +302,8 @@ class _HomeViewState extends State<HomeView> {
child: Text(
"78 BPM",
style: TextStyle(
color: TColor.primaryColor1.withOpacity(0.7),
color:
TColor.primaryColor1.withOpacity(0.7),
fontWeight: FontWeight.w700,
fontSize: 18),
),
@ -878,7 +878,6 @@ class _HomeViewState extends State<HomeView> {
SizedBox(
height: media.width * 0.05,
),
SizedBox(
height: media.width * 0.1,
),
@ -892,7 +891,6 @@ class _HomeViewState extends State<HomeView> {
List<PieChartSectionData> showingSections() {
return List.generate(
2,

@ -2,9 +2,7 @@ import 'package:flutter_svg/svg.dart';
import 'package:smartfit_app_mobile/common/colo_extension.dart';
import 'package:smartfit_app_mobile/common_widget/round_button.dart';
import 'package:smartfit_app_mobile/common_widget/round_text_field.dart';
import 'package:smartfit_app_mobile/view/home/home_view.dart';
//import 'package:smartfit_app_mobile/view/login/complete_profile_view.dart';
import 'package:smartfit_app_mobile/view/login/login_view.dart';
import 'package:flutter/material.dart';
import 'package:smartfit_app_mobile/view/main_tab/main_tab_view.dart';
@ -105,7 +103,6 @@ class _SignUpViewState extends State<SignUpView> {
"En continuant, vous acceptez notre Politique de\nconfidentialité et nos Conditions d'utilisation.",
style: TextStyle(color: TColor.gray, fontSize: 10),
),
)
],
),
@ -162,11 +159,9 @@ class _SignUpViewState extends State<SignUpView> {
),
),
),
SizedBox(
width: media.width * 0.04,
),
GestureDetector(
onTap: () {},
child: Container(

@ -1,16 +1,12 @@
import 'package:smartfit_app_mobile/common/colo_extension.dart';
import 'package:smartfit_app_mobile/common_widget/tab_button.dart';
import 'package:smartfit_app_mobile/view/activity/activity.dart';
import 'package:smartfit_app_mobile/view/home/blank_view.dart';
import 'package:smartfit_app_mobile/view/home/home_view.dart';
import 'package:smartfit_app_mobile/view/main_tab/select_view.dart';
import 'package:flutter/material.dart';
import 'package:smartfit_app_mobile/view/map/my_map.dart';
import 'package:smartfit_app_mobile/view/page_test.dart';
import 'package:smartfit_app_mobile/view/profile/profile_view.dart';
class MainTabView extends StatefulWidget {
const MainTabView({super.key});
@ -50,9 +46,14 @@ class _MainTabViewState extends State<MainTabView> {
boxShadow: const [
BoxShadow(
color: Colors.black12,
blurRadius: 2,)
blurRadius: 2,
)
]),
child: Icon(Icons.search,color: TColor.white, size: 35, ),
child: Icon(
Icons.search,
color: TColor.white,
size: 35,
),
),
),
),
@ -87,8 +88,9 @@ class _MainTabViewState extends State<MainTabView> {
setState(() {});
}
}),
const SizedBox(width: 40,),
const SizedBox(
width: 40,
),
TabButton(
icon: "assets/img/Camera_tab.svg",
selectIcon: "assets/img/Camera_tab_select.svg",
@ -111,8 +113,6 @@ class _MainTabViewState extends State<MainTabView> {
setState(() {});
}
})
],
),
)),

@ -67,7 +67,8 @@ class _TestPage extends State<TestPage> {
print("t");
} else {
List<dynamic> result = await x.readFitFile(y!);
//print(x.getHeartRateWithTime(ActivityOfUser(result)));
print(result);
print(x.getHeartRateWithTime(ActivityOfUser(result)));
//print(x.getDistanceWithTime(ActivityOfUser(result)));
//print(x.getDistance(ActivityOfUser(result)));
print(x.getAltitudeWithTime(ActivityOfUser(result)));

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smartfit_app_mobile/Modele/user.dart';
import 'package:smartfit_app_mobile/View/on_boarding/started_view.dart';
import 'package:smartfit_app_mobile/View/page_test.dart';
import 'package:smartfit_app_mobile/common/colo_extension.dart';
void main() {
@ -36,8 +35,7 @@ class MyApp extends StatelessWidget {
// This works for code too, not just values: Most code changes can be
// tested with just a hot reload.
primaryColor: TColor.primaryColor1,
fontFamily: "Poppins"
),
fontFamily: "Poppins"),
home: const StartedView(),
);
}

@ -1,88 +0,0 @@
# This file controls Flutter-level build steps. It should not be edited.
cmake_minimum_required(VERSION 3.10)
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
# Configuration provided via flutter tool.
include(${EPHEMERAL_DIR}/generated_config.cmake)
# TODO: Move the rest of this into files in ephemeral. See
# https://github.com/flutter/flutter/issues/57146.
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
# which isn't available in 3.10.
function(list_prepend LIST_NAME PREFIX)
set(NEW_LIST "")
foreach(element ${${LIST_NAME}})
list(APPEND NEW_LIST "${PREFIX}${element}")
endforeach(element)
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
endfunction()
# === Flutter Library ===
# System-level dependencies.
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
# Published to parent scope for install step.
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
list(APPEND FLUTTER_LIBRARY_HEADERS
"fl_basic_message_channel.h"
"fl_binary_codec.h"
"fl_binary_messenger.h"
"fl_dart_project.h"
"fl_engine.h"
"fl_json_message_codec.h"
"fl_json_method_codec.h"
"fl_message_codec.h"
"fl_method_call.h"
"fl_method_channel.h"
"fl_method_codec.h"
"fl_method_response.h"
"fl_plugin_registrar.h"
"fl_plugin_registry.h"
"fl_standard_message_codec.h"
"fl_standard_method_codec.h"
"fl_string_codec.h"
"fl_value.h"
"fl_view.h"
"flutter_linux.h"
)
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
add_library(flutter INTERFACE)
target_include_directories(flutter INTERFACE
"${EPHEMERAL_DIR}"
)
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
target_link_libraries(flutter INTERFACE
PkgConfig::GTK
PkgConfig::GLIB
PkgConfig::GIO
)
add_dependencies(flutter flutter_assemble)
# === Flutter tool backend ===
# _phony_ is a non-existent file to force this command to run every time,
# since currently there's no way to get a full input/output list from the
# flutter tool.
add_custom_command(
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/_phony_
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
"${FLUTTER_LIBRARY}"
${FLUTTER_LIBRARY_HEADERS}
)

@ -1,15 +0,0 @@
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
#include <simple_animation_progress_bar/simple_animation_progress_bar_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) simple_animation_progress_bar_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "SimpleAnimationProgressBarPlugin");
simple_animation_progress_bar_plugin_register_with_registrar(simple_animation_progress_bar_registrar);
}

@ -1,24 +0,0 @@
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
simple_animation_progress_bar
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

@ -1,14 +0,0 @@
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
#include <simple_animation_progress_bar/simple_animation_progress_bar_plugin_c_api.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
SimpleAnimationProgressBarPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SimpleAnimationProgressBarPluginCApi"));
}

@ -1,24 +0,0 @@
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
simple_animation_progress_bar
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
Loading…
Cancel
Save