├── README.md ├── api_smc.sh ├── backend-smc-laravel ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .styleci.yml ├── README.md ├── app │ ├── Console │ │ ├── Commands │ │ │ ├── DisparosComando.php │ │ │ └── TesteComando.php │ │ └── Kernel.php │ ├── Exceptions │ │ └── Handler.php │ ├── Http │ │ ├── Controllers │ │ │ ├── Auth │ │ │ │ ├── ForgotPasswordController.php │ │ │ │ ├── LoginController.php │ │ │ │ ├── RegisterController.php │ │ │ │ ├── ResetPasswordController.php │ │ │ │ └── VerificationController.php │ │ │ └── Controller.php │ │ ├── Kernel.php │ │ ├── Library │ │ │ ├── FunctionsLibrary.php │ │ │ └── ManipularDatasLibrary.php │ │ ├── Middleware │ │ │ ├── Authenticate.php │ │ │ ├── CheckForMaintenanceMode.php │ │ │ ├── CorsMiddleware.php │ │ │ ├── EncryptCookies.php │ │ │ ├── RedirectIfAuthenticated.php │ │ │ ├── TrimStrings.php │ │ │ ├── TrustProxies.php │ │ │ └── VerifyCsrfToken.php │ │ └── Service │ │ │ ├── ClienteHttp.php │ │ │ ├── Empresa01Service.php │ │ │ ├── GraphqlQuestionsService.php │ │ │ ├── GraphqlSettingsService.php │ │ │ ├── GraphqlShotsService.php │ │ │ └── GraphqlWhatsappsService.php │ ├── Models │ │ ├── Traits │ │ │ └── Uuid.php │ │ └── User.php │ └── Providers │ │ ├── AppServiceProvider.php │ │ ├── AuthServiceProvider.php │ │ ├── BroadcastServiceProvider.php │ │ ├── EventServiceProvider.php │ │ └── RouteServiceProvider.php ├── artisan ├── bootstrap │ ├── app.php │ └── cache │ │ └── .gitignore ├── composer.json ├── composer.lock ├── config │ ├── app.php │ ├── auth.php │ ├── broadcasting.php │ ├── cache.php │ ├── database.php │ ├── eloquentfilter.php │ ├── filesystems.php │ ├── hashing.php │ ├── logging.php │ ├── mail.php │ ├── queue.php │ ├── services.php │ ├── session.php │ └── view.php ├── database │ ├── .gitignore │ ├── factories │ │ └── UserFactory.php │ ├── migrations │ │ ├── 2014_10_12_000000_create_users_table.php │ │ ├── 2014_10_12_100000_create_password_resets_table.php │ │ └── 2019_08_19_000000_create_failed_jobs_table.php │ └── seeds │ │ └── DatabaseSeeder.php ├── package.json ├── phpunit.xml ├── public │ ├── .htaccess │ ├── favicon.ico │ ├── index.php │ └── vendor │ │ └── telescope │ │ ├── app-dark.css │ │ ├── app.css │ │ ├── app.js │ │ ├── favicon.ico │ │ └── mix-manifest.json ├── resources │ ├── js │ │ ├── app.js │ │ └── bootstrap.js │ ├── lang │ │ └── en │ │ │ ├── auth.php │ │ │ ├── pagination.php │ │ │ ├── passwords.php │ │ │ └── validation.php │ ├── sass │ │ └── app.scss │ └── views │ │ └── welcome.blade.php ├── routes │ ├── api.php │ ├── channels.php │ ├── console.php │ └── web.php ├── server.php ├── storage │ ├── app │ │ ├── .gitignore │ │ └── public │ │ │ └── .gitignore │ ├── framework │ │ ├── .gitignore │ │ ├── cache │ │ │ ├── .gitignore │ │ │ └── data │ │ │ │ └── .gitignore │ │ ├── sessions │ │ │ └── .gitignore │ │ ├── testing │ │ │ └── .gitignore │ │ └── views │ │ │ └── .gitignore │ └── logs │ │ └── .gitignore ├── tests │ ├── Bootstrap.php │ ├── CreatesApplication.php │ ├── Feature │ │ └── ExampleTest.php │ ├── TestCase.php │ └── Unit │ │ ├── CategoryTest.php │ │ └── ExampleTest.php ├── webpack.mix.js └── yarn.lock ├── frontend-smc ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── assets │ ├── dir │ │ └── .env-example │ └── images │ │ ├── bg.png │ │ ├── contact.png │ │ ├── email.png │ │ ├── emawork.png │ │ ├── github.png │ │ ├── google.png │ │ ├── logo.png │ │ ├── logo36.png │ │ ├── profile.png │ │ ├── secret.png │ │ ├── smc.png │ │ └── youtube.png ├── build │ └── web │ │ ├── .last_build_id │ │ ├── assets │ │ ├── AssetManifest.json │ │ ├── FontManifest.json │ │ ├── NOTICES │ │ ├── assets │ │ │ ├── dir │ │ │ │ └── .env.example │ │ │ └── images │ │ │ │ ├── bg.png │ │ │ │ ├── contact.png │ │ │ │ ├── email.png │ │ │ │ ├── emawork.png │ │ │ │ ├── github.png │ │ │ │ ├── google.png │ │ │ │ ├── logo.png │ │ │ │ ├── logo36.png │ │ │ │ ├── profile.png │ │ │ │ ├── secret.png │ │ │ │ ├── smc.png │ │ │ │ └── youtube.png │ │ ├── fonts │ │ │ └── MaterialIcons-Regular.otf │ │ ├── packages │ │ │ ├── awesome_dialog │ │ │ │ └── assets │ │ │ │ │ ├── flare │ │ │ │ │ ├── error.flr │ │ │ │ │ ├── info.flr │ │ │ │ │ ├── info2.flr │ │ │ │ │ ├── info_without_loop.flr │ │ │ │ │ ├── question.flr │ │ │ │ │ ├── succes.flr │ │ │ │ │ ├── succes_without_loop.flr │ │ │ │ │ ├── warning.flr │ │ │ │ │ └── warning_without_loop.flr │ │ │ │ │ └── rive │ │ │ │ │ ├── error.riv │ │ │ │ │ ├── info.riv │ │ │ │ │ ├── info_reverse.riv │ │ │ │ │ ├── question.riv │ │ │ │ │ ├── success.riv │ │ │ │ │ └── warning.riv │ │ │ ├── cupertino_icons │ │ │ │ └── assets │ │ │ │ │ └── CupertinoIcons.ttf │ │ │ ├── font_awesome_flutter │ │ │ │ └── lib │ │ │ │ │ └── fonts │ │ │ │ │ ├── fa-brands-400.ttf │ │ │ │ │ ├── fa-regular-400.ttf │ │ │ │ │ └── fa-solid-900.ttf │ │ │ └── getwidget │ │ │ │ └── icons │ │ │ │ ├── dribble.png │ │ │ │ ├── facebook.png │ │ │ │ ├── google.png │ │ │ │ ├── line.png │ │ │ │ ├── linkedin.png │ │ │ │ ├── pinterest.png │ │ │ │ ├── slack.png │ │ │ │ ├── twitter.png │ │ │ │ ├── wechat.png │ │ │ │ ├── whatsapp.png │ │ │ │ └── youtube.png │ │ └── shaders │ │ │ └── ink_sparkle.frag │ │ ├── canvaskit │ │ ├── canvaskit.js │ │ ├── canvaskit.wasm │ │ └── profiling │ │ │ ├── canvaskit.js │ │ │ └── canvaskit.wasm │ │ ├── favicon.ico │ │ ├── flutter.js │ │ ├── flutter_service_worker.js │ │ ├── icons │ │ ├── Icon-192.png │ │ ├── Icon-512.png │ │ ├── Icon-maskable-192.png │ │ ├── Icon-maskable-512.png │ │ └── ico │ │ │ ├── android-icon-144x144.png │ │ │ ├── android-icon-192x192.png │ │ │ ├── android-icon-36x36.png │ │ │ ├── android-icon-48x48.png │ │ │ ├── android-icon-72x72.png │ │ │ ├── android-icon-96x96.png │ │ │ ├── apple-icon-114x114.png │ │ │ ├── apple-icon-120x120.png │ │ │ ├── apple-icon-144x144.png │ │ │ ├── apple-icon-152x152.png │ │ │ ├── apple-icon-180x180.png │ │ │ ├── apple-icon-57x57.png │ │ │ ├── apple-icon-60x60.png │ │ │ ├── apple-icon-72x72.png │ │ │ ├── apple-icon-76x76.png │ │ │ ├── apple-icon-precomposed.png │ │ │ ├── apple-icon.png │ │ │ ├── browserconfig.xml │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── favicon-96x96.png │ │ │ ├── favicon.ico │ │ │ ├── manifest.json │ │ │ ├── ms-icon-144x144.png │ │ │ ├── ms-icon-150x150.png │ │ │ ├── ms-icon-310x310.png │ │ │ └── ms-icon-70x70.png │ │ ├── index.html │ │ ├── main.dart.js │ │ ├── main.dart.js.map │ │ ├── manifest.json │ │ └── version.json ├── lib │ ├── main.dart │ └── src │ │ ├── commons │ │ ├── commons.dart │ │ └── components │ │ │ ├── bootstrap │ │ │ ├── text_form_field_bootstrap.dart │ │ │ ├── text_form_field_controller_bootstrap.dart │ │ │ ├── text_form_field_id_bootstrap.dart │ │ │ ├── text_form_field_switch_bootstrap.dart │ │ │ └── vazio_bootstrap.dart │ │ │ ├── drop_down_list.dart │ │ │ ├── dropdown_widget.dart │ │ │ ├── dropdrown_cmp.dart │ │ │ ├── switch.dart │ │ │ ├── utils │ │ │ ├── lower_case_text_formatter.dart │ │ │ ├── upper_case_text_formatter.dart │ │ │ └── valida_campo_formulario.dart │ │ │ └── widgets │ │ │ ├── botoes.dart │ │ │ ├── drop_down_list.dart │ │ │ ├── dropdown_widget.dart │ │ │ ├── dropdrown_cmp.dart │ │ │ ├── get_elevate_button.dart │ │ │ ├── switch.dart │ │ │ └── text_field_switch_widget.dart │ │ ├── infra │ │ ├── app_theme.dart │ │ ├── authorities.dart │ │ ├── biblioteca.dart │ │ ├── breakpoints.dart │ │ ├── colors.dart │ │ ├── constantes.dart │ │ ├── hexa_color.dart │ │ ├── locator.dart │ │ ├── paleta_cores.dart │ │ ├── responsive_media_query.dart │ │ ├── rotas.dart │ │ ├── size_config.dart │ │ ├── style.dart │ │ ├── themes.dart │ │ └── versao.dart │ │ ├── library │ │ └── bloc_pattern │ │ │ ├── bloc_pattern.dart │ │ │ └── lib │ │ │ ├── bloc.dart │ │ │ ├── bloc_base.dart │ │ │ ├── bloc_provider.dart │ │ │ ├── bloc_provider_error.dart │ │ │ ├── consumer.dart │ │ │ ├── consumer_module.dart │ │ │ ├── core.dart │ │ │ ├── dependency.dart │ │ │ ├── disposable.dart │ │ │ ├── inject.dart │ │ │ └── module.dart │ │ ├── models │ │ ├── connection_model.dart │ │ ├── filtro.dart │ │ ├── model.dart │ │ ├── question_model.dart │ │ ├── retorno_json_erro.dart │ │ ├── setting_model.dart │ │ ├── shots_model.dart │ │ ├── tenant_model.dart │ │ ├── user_model.dart │ │ └── whatsapp_model.dart │ │ ├── pages │ │ ├── conection │ │ │ ├── conection_module.dart │ │ │ ├── conection_page.dart │ │ │ └── conection_persiste_page.dart │ │ ├── configuration │ │ │ ├── configurations_module.dart │ │ │ └── configurations_page.dart │ │ ├── home │ │ │ ├── appbar │ │ │ │ └── web_app_bar.dart │ │ │ ├── home_page.dart │ │ │ ├── profile │ │ │ │ └── user_profile.dart │ │ │ └── side_menu.dart │ │ ├── login │ │ │ ├── login_page.dart │ │ │ ├── login_page_left_side.dart │ │ │ ├── login_page_right_side.dart │ │ │ └── trocar_senha_page.dart │ │ ├── pages.dart │ │ ├── question │ │ │ ├── question_persiste_page.dart │ │ │ ├── questions_module.dart │ │ │ └── questions_page.dart │ │ └── shots │ │ │ ├── shots_module.dart │ │ │ ├── shots_page.dart │ │ │ └── shots_persiste_page.dart │ │ ├── providers │ │ ├── ProviderPageController.dart │ │ ├── chip_provider.dart │ │ └── theme_provider.dart │ │ ├── services │ │ ├── api │ │ │ ├── conection_service.dart │ │ │ ├── login_service.dart │ │ │ ├── question_service.dart │ │ │ ├── setting_service.dart │ │ │ ├── shots_service.dart │ │ │ └── user_service.dart │ │ ├── http_helper.dart │ │ ├── refresh_token_api.dart │ │ ├── service.dart │ │ ├── service_base.dart │ │ └── url_base.dart │ │ ├── shared │ │ ├── app_text.dart │ │ ├── app_text_field.dart │ │ ├── page │ │ │ ├── erro_page.dart │ │ │ └── web_view_page.dart │ │ ├── qr_code_widget.dart │ │ ├── required_label.dart │ │ ├── responsive_widget.dart │ │ ├── show_dialog.dart │ │ ├── social_page.dart │ │ └── text_rich_widget.dart │ │ ├── streams │ │ ├── question_bloc.dart │ │ ├── setting_bloc.dart │ │ ├── shots_bloc.dart │ │ ├── stream.dart │ │ ├── user_bloc.dart │ │ └── whatsapp_bloc.dart │ │ ├── utils │ │ ├── encrypt_decrypt.dart │ │ ├── funcao_date.dart │ │ ├── image_qr_code_memory.dart │ │ ├── notification_fush.dart │ │ ├── responsive_widget.dart │ │ ├── seta_qtde_conection.dart │ │ └── view_util.dart │ │ └── view_model │ │ ├── conection_view_model.dart │ │ ├── login_view_model.dart │ │ ├── question_view_model.dart │ │ ├── setting_view_model.dart │ │ ├── shots_view_model.dart │ │ ├── user_view_model.dart │ │ └── view_model.dart ├── pubspec.lock ├── pubspec.yaml ├── test │ └── widget_test.dart └── web │ ├── favicon.ico │ ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ ├── Icon-maskable-512.png │ └── ico │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── apple-icon-precomposed.png │ │ ├── apple-icon.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── favicon.ico │ │ ├── manifest.json │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ └── ms-icon-70x70.png │ ├── index.html │ └── manifest.json ├── resources ├── conversas.txt ├── dart.png ├── db.txt ├── donate.png ├── flutter.png ├── laravel.png ├── smc.png ├── tela1.png ├── tela2.png ├── tela3.png └── tela4.png └── server-smc-dart ├── .dockerignore ├── .env.example ├── .gitignore ├── .vscode ├── launch.json └── settings.json ├── CHANGELOG.md ├── Dockerfile ├── README.md ├── analysis_options.yaml ├── bin └── server.dart ├── images └── img.txt ├── lib ├── application │ └── config │ │ └── application_config.dart ├── core │ ├── exceptions │ │ ├── email_already_registered.dart │ │ └── user_notfound_exception.dart │ ├── helpers │ │ ├── cripty_helper.dart │ │ └── jwt_helper.dart │ └── middlewares │ │ ├── cors │ │ └── cors_middleware.dart │ │ ├── default │ │ └── default_content_type_middleware.dart │ │ ├── middlewares.dart │ │ └── security │ │ ├── security_middleware.dart │ │ └── security_skip_url.dart ├── models │ ├── connect_hasura.dart │ ├── question_model.dart │ ├── settings_model.dart │ ├── shots_model.dart │ ├── user_model.dart │ └── whatsapp_model.dart ├── modules │ ├── auth │ │ ├── auth_controller.dart │ │ └── auth_controller.g.dart │ ├── question │ │ ├── question_controller.dart │ │ └── question_controller.g.dart │ ├── setting │ │ ├── setting_controller.dart │ │ └── setting_controller.g.dart │ ├── shot │ │ ├── shots_controller.dart │ │ └── shots_controller.g.dart │ ├── user │ │ ├── user_controller.dart │ │ └── user_controller.g.dart │ ├── webhook │ │ ├── web_hook_controller.dart │ │ └── web_hook_controller.g.dart │ └── whatsapp │ │ ├── whatsapp_controller.dart │ │ └── whatsapp_controller.g.dart ├── repositories │ ├── question_repository.dart │ ├── setting_repository.dart │ ├── shots_repository.dart │ ├── user_repository.dart │ └── whatsapp_repository.dart ├── services │ ├── question_hasura_service.dart │ ├── setting_hasura_service.dart │ ├── shots_hasura_service.dart │ ├── user_hasura_service.dart │ └── whatsapp_hasura_service.dart └── uteis │ ├── constantes.dart │ ├── encrypt_decrypt.dart │ └── funcao_data.dart ├── pubspec.lock ├── pubspec.yaml └── test └── server_test.dart /api_smc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd server-smc-dart 4 | dart --no-sound-null-safety bin/server.dart 1> ../smc.log & 5 | -------------------------------------------------------------------------------- /backend-smc-laravel/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /backend-smc-laravel/.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME="SMC" 2 | APP_ENV=local 3 | APP_KEY=base64:9uzji8QF6X6NfRQLYAsO3o+ye21crdmhArbGSm1W584= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=localhost 11 | DB_PORT=3306 12 | DB_DATABASE=teste 13 | DB_USERNAME=root 14 | DB_PASSWORD="root" 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | QUEUE_CONNECTION=sync 19 | SESSION_DRIVER=file 20 | SESSION_LIFETIME=120 21 | 22 | REDIS_HOST=redis 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_DRIVER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | STORAGE_DRIVER=local 34 | 35 | PUSHER_APP_ID= 36 | PUSHER_APP_KEY= 37 | PUSHER_APP_SECRET= 38 | PUSHER_APP_CLUSTER=mt1 39 | 40 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 41 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 42 | 43 | JWT_SECRET=veqlybDwheW4PXTOLnDGz577DT3GuI2I30N90KyBWM5B3eu2Rgy3vfizyVvK0jvY 44 | JWT_BLACKLIST_GRACE_PERIOD=300 45 | 46 | API_HASURA=http://localhost/v1/graphql 47 | API_HASURA_CREDENCY="senha" 48 | 49 | API_WPP=http://ip:porta/api 50 | 51 | -------------------------------------------------------------------------------- /backend-smc-laravel/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /backend-smc-laravel/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | .env 7 | .env.testing 8 | .env.backup 9 | .phpunit.result.cache 10 | Homestead.json 11 | Homestead.yaml 12 | npm-debug.log 13 | yarn-error.log 14 | .idea/ 15 | .vscode/ 16 | .docker/dbdata/ 17 | _ide_helper.php 18 | _ide_helper_models.php 19 | .phpstorm.meta.php 20 | .firebase-adm.json 21 | *.txt 22 | /documentos 23 | -------------------------------------------------------------------------------- /backend-smc-laravel/.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | disabled: 4 | - unused_use 5 | finder: 6 | not-name: 7 | - index.php 8 | - server.php 9 | js: 10 | finder: 11 | not-name: 12 | - webpack.mix.js 13 | css: true 14 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Console/Commands/TesteComando.php: -------------------------------------------------------------------------------- 1 | 1 minutos 31 | everyFiveMinutes() -> 5 minutos 32 | everyTenMinutes() -> 10 minutos 33 | everyFifTenMinutes() -> 15 minutos 34 | everyThirtyMinutes() -> 30 minutos 35 | hourly() -> 1 hora 36 | * 37 | */ 38 | protected function schedule(Schedule $schedule) 39 | { 40 | 41 | //$schedule->command('teste:comando')->everyMinute(); 42 | $schedule->command('disparos:smc')->everyMinute(); 43 | } 44 | 45 | /** 46 | * Register the commands for the application. 47 | * 48 | * @return void 49 | */ 50 | protected function commands() 51 | { 52 | $this->load(__DIR__.'/Commands'); 53 | 54 | require base_path('routes/console.php'); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Http/Controllers/Auth/VerificationController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 38 | $this->middleware('signed')->only('verify'); 39 | $this->middleware('throttle:6,1')->only('verify', 'resend'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | = $hoje) { return 0;} 23 | 24 | // converte as datas para o formato timestamp 25 | $d1 = strtotime($hoje); 26 | $d2 = strtotime($data); 27 | 28 | // verifica a diferença em segundos entre as duas datas e divide pelo número de segundos que um dia possui 29 | $dataFinal = ($d1 - $d2) /86400; 30 | 31 | // caso a data 2 seja menor que a data 1 32 | $dataFinal < 0 ? $dataFinal : ($dataFinal * -1); 33 | return $dataFinal; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Http/Middleware/CheckForMaintenanceMode.php: -------------------------------------------------------------------------------- 1 | is('api/*')){ 13 | header("Access-Control-Allow-Origin: *"); 14 | header('Access-Control-Allow-Headers: Content-Type,Authorization'); 15 | header('Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE'); 16 | header('Access-Control-Expose-Headers: Authorization'); 17 | } 18 | 19 | return $next($request); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | $url, 16 | CURLOPT_RETURNTRANSFER => true, 17 | CURLOPT_ENCODING => "", 18 | CURLOPT_MAXREDIRS => 10, 19 | CURLOPT_TIMEOUT => 30, 20 | CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, 21 | CURLOPT_CUSTOMREQUEST => "POST", 22 | CURLOPT_POSTFIELDS => "{\"query\":\"query FindAll {\\n smc_questions(order_by: {id: asc}) {\\n id\\n name\\n }\\n}\"}", 23 | CURLOPT_HTTPHEADER => [ 24 | "Content-Type: application/json", 25 | "x-hasura-admin-secret: " . $pass 26 | ], 27 | ]); 28 | $response = curl_exec($curl); 29 | curl_close($curl); 30 | $dados = json_decode($response, true); 31 | return $dados["data"]["smc_questions"]; 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Http/Service/GraphqlSettingsService.php: -------------------------------------------------------------------------------- 1 | $url, 16 | CURLOPT_RETURNTRANSFER => true, 17 | CURLOPT_ENCODING => "", 18 | CURLOPT_MAXREDIRS => 10, 19 | CURLOPT_TIMEOUT => 30, 20 | CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, 21 | CURLOPT_CUSTOMREQUEST => "POST", 22 | CURLOPT_POSTFIELDS => "{\"query\":\"query findBy {\\n smc_settings(order_by: {id: asc}) {\\n id\\n description\\n key\\n value\\n content\\n }\\n}\"}", 23 | CURLOPT_HTTPHEADER => [ 24 | "Content-Type: application/json", 25 | "x-hasura-admin-secret: " . $pass 26 | ], 27 | ]); 28 | $response = curl_exec($curl); 29 | curl_close($curl); 30 | $dados = json_decode($response, true); 31 | return $dados["data"]["smc_settings"]; 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Models/Traits/Uuid.php: -------------------------------------------------------------------------------- 1 | id = RamseyUuid::uuid4(); 13 | }); 14 | } 15 | } -------------------------------------------------------------------------------- /backend-smc-laravel/app/Models/User.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /backend-smc-laravel/app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::middleware('web') 55 | ->namespace($this->namespace) 56 | ->group(base_path('routes/web.php')); 57 | } 58 | 59 | /** 60 | * Define the "api" routes for the application. 61 | * 62 | * These routes are typically stateless. 63 | * 64 | * @return void 65 | */ 66 | protected function mapApiRoutes() 67 | { 68 | Route::prefix('api') 69 | ->middleware('api') 70 | ->namespace($this->namespace) 71 | ->group(base_path('routes/api.php')); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /backend-smc-laravel/bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /backend-smc-laravel/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /backend-smc-laravel/config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /backend-smc-laravel/config/eloquentfilter.php: -------------------------------------------------------------------------------- 1 | 'App\\ModelFilters\\', 15 | 16 | /* 17 | |-------------------------------------------------------------------------- 18 | | Custom generator stub 19 | |-------------------------------------------------------------------------- 20 | | 21 | | If you want to override the default stub this package provides 22 | | you can enter the path to your own at this point 23 | | 24 | */ 25 | // 'generator' => [ 26 | // 'stub' => app_path('stubs/modelfilter.stub') 27 | // ] 28 | 29 | /* 30 | |-------------------------------------------------------------------------- 31 | | Default Paginator Limit For `paginateFilter` and `simplePaginateFilter` 32 | |-------------------------------------------------------------------------- 33 | | 34 | | Set paginate limit 35 | | 36 | */ 37 | 'paginate_limit' => env('PAGINATION_LIMIT_DEFAULT',15) 38 | 39 | ]; 40 | -------------------------------------------------------------------------------- /backend-smc-laravel/config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /backend-smc-laravel/config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /backend-smc-laravel/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /backend-smc-laravel/database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(User::class, function (Faker $faker) { 20 | return [ 21 | 'name' => $faker->name, 22 | 'email' => $faker->unique()->safeEmail, 23 | 'email_verified_at' => now(), 24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | }); 28 | -------------------------------------------------------------------------------- /backend-smc-laravel/database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uid')->unique(); 19 | $table->string('name'); 20 | $table->string('login')->unique(); 21 | $table->string('email')->unique(); 22 | $table->string('celular'); 23 | $table->string('password'); 24 | $table->string('permissao'); 25 | $table->string('modulo'); 26 | $table->boolean('ativo')->default(true); 27 | $table->boolean('receber_notificacao_sms')->default(false); 28 | $table->boolean('receber_notificacao_email')->default(false); 29 | $table->timestamp('email_verified_at')->nullable(); 30 | $table->rememberToken(); 31 | $table->softDeletes(); 32 | $table->timestamps(); 33 | });*/ 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | * 39 | * @return void 40 | */ 41 | public function down() 42 | { 43 | // Schema::dropIfExists('users'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /backend-smc-laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | });*/ 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | // Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /backend-smc-laravel/database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->text('connection'); 19 | $table->text('queue'); 20 | $table->longText('payload'); 21 | $table->longText('exception'); 22 | $table->timestamp('failed_at')->useCurrent(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('failed_jobs'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /backend-smc-laravel/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call([ 15 | // UsersTableSeeder::class 16 | ]); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /backend-smc-laravel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "npm run development -- --watch", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.19", 14 | "cross-env": "^5.1", 15 | "laravel-mix": "^4.0.7", 16 | "lodash": "^4.17.13", 17 | "resolve-url-loader": "^2.3.1", 18 | "sass": "^1.15.2", 19 | "sass-loader": "^7.1.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend-smc-laravel/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Unit 14 | 15 | 16 | 17 | ./tests/Feature 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /backend-smc-laravel/public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /backend-smc-laravel/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/backend-smc-laravel/public/favicon.ico -------------------------------------------------------------------------------- /backend-smc-laravel/public/vendor/telescope/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/backend-smc-laravel/public/vendor/telescope/favicon.ico -------------------------------------------------------------------------------- /backend-smc-laravel/public/vendor/telescope/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/app.js": "/app.js?id=f2e12e6d70f933613e34", 3 | "/app.css": "/app.css?id=326b997a579e007d2102", 4 | "/app-dark.css": "/app-dark.css?id=5ebb5e33b7c425d6317c" 5 | } 6 | -------------------------------------------------------------------------------- /backend-smc-laravel/resources/js/app.js: -------------------------------------------------------------------------------- 1 | require('./bootstrap'); 2 | -------------------------------------------------------------------------------- /backend-smc-laravel/resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | /** 4 | * We'll load the axios HTTP library which allows us to easily issue requests 5 | * to our Laravel back-end. This library automatically handles sending the 6 | * CSRF token as a header based on the value of the "XSRF" token cookie. 7 | */ 8 | 9 | window.axios = require('axios'); 10 | 11 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 12 | 13 | /** 14 | * Echo exposes an expressive API for subscribing to channels and listening 15 | * for events that are broadcast by Laravel. Echo and event broadcasting 16 | * allows your team to easily build robust real-time web applications. 17 | */ 18 | 19 | // import Echo from 'laravel-echo'; 20 | 21 | // window.Pusher = require('pusher-js'); 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: process.env.MIX_PUSHER_APP_KEY, 26 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 27 | // encrypted: true 28 | // }); 29 | -------------------------------------------------------------------------------- /backend-smc-laravel/resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /backend-smc-laravel/resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /backend-smc-laravel/resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have e-mailed your password reset link!', 18 | 'token' => 'This password reset token is invalid.', 19 | 'user' => "We can't find a user with that e-mail address.", 20 | 21 | ]; 22 | -------------------------------------------------------------------------------- /backend-smc-laravel/resources/sass/app.scss: -------------------------------------------------------------------------------- 1 | // 2 | -------------------------------------------------------------------------------- /backend-smc-laravel/routes/api.php: -------------------------------------------------------------------------------- 1 | 'Api', 'as' => 'api.'], function() { 18 | 19 | Route::get('geocoders', 'GeocoderController@nominatim')->name('geocoder.nominatim'); 20 | Route::get('geocoders/traccar/{key}', 'GeocoderController@nominatimTraccar')->name('geocoder.nominatimTraccar'); 21 | 22 | }); 23 | */ 24 | 25 | -------------------------------------------------------------------------------- /backend-smc-laravel/routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /backend-smc-laravel/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /backend-smc-laravel/routes/web.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /backend-smc-laravel/storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /backend-smc-laravel/storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /backend-smc-laravel/storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /backend-smc-laravel/storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /backend-smc-laravel/storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /backend-smc-laravel/storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /backend-smc-laravel/storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /backend-smc-laravel/storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /backend-smc-laravel/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /backend-smc-laravel/tests/Bootstrap.php: -------------------------------------------------------------------------------- 1 | createApplication()->make(Kernel::class); 27 | 28 | $commands = [ 29 | 'config:cache', 30 | 'event:cache', 31 | ]; 32 | 33 | foreach ($commands as $command) { 34 | $console->call($command); 35 | } 36 | } 37 | 38 | public function executeAfterLastTest(): void 39 | { 40 | array_map('unlink', glob('bootstrap/cache/*.phpunit.php')); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /backend-smc-laravel/tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /backend-smc-laravel/tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /backend-smc-laravel/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertEquals($fillable, $category->getFillable()); 22 | } 23 | 24 | public function testDatesAttibute() 25 | { 26 | $dates = ['deleted_at', 'created_at', 'updated_at']; 27 | $category = new Category(); 28 | foreach ($dates as $date) { 29 | $this->assertContains($date, $category->getDates()); 30 | } 31 | $this->assertCount(count($dates), $category->getDates()); 32 | } 33 | 34 | public function testIfUseTraits() 35 | { 36 | $traits = [SoftDeletes::class, Uuid::class]; 37 | $categoryTraits = array_keys(class_uses(Category::class)); 38 | $this->assertEquals($traits, $categoryTraits); 39 | } 40 | 41 | public function testCasts() 42 | { 43 | $casts = ['id' => 'string']; 44 | $category = new Category(); 45 | $this->assertEquals($casts, $category->getCasts()); 46 | } 47 | 48 | public function testIncrementing() 49 | { 50 | $category = new Category(); 51 | $this->assertFalse($category->incrementing); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /backend-smc-laravel/tests/Unit/ExampleTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /backend-smc-laravel/webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/js/app.js', 'public/js') 15 | .sass('resources/sass/app.scss', 'public/css'); 16 | -------------------------------------------------------------------------------- /frontend-smc/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | 34 | # Symbolication related 35 | app.*.symbols 36 | 37 | # Obfuscation related 38 | app.*.map.json 39 | 40 | # Android Studio will place build artifacts here 41 | /android/app/debug 42 | /android/app/profile 43 | /android/app/release 44 | 45 | /assets/dir/.env 46 | 47 | /build/flutter_assets 48 | /build/f81bcead6fd1ffeab1612c2b544f3591 49 | /build/cf81dbb7dee963bedb1148fc66e70128.cache.dill.track.dill 50 | /build/web/assets/assets/dir/.env -------------------------------------------------------------------------------- /frontend-smc/.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. 5 | 6 | version: 7 | revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 17 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 18 | - platform: web 19 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 20 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /frontend-smc/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /frontend-smc/assets/dir/.env-example: -------------------------------------------------------------------------------- 1 | endpointApi = -------------------------------------------------------------------------------- /frontend-smc/assets/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/bg.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/contact.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/email.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/emawork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/emawork.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/github.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/google.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/logo.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/logo36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/logo36.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/profile.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/secret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/secret.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/smc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/smc.png -------------------------------------------------------------------------------- /frontend-smc/assets/images/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/assets/images/youtube.png -------------------------------------------------------------------------------- /frontend-smc/build/web/.last_build_id: -------------------------------------------------------------------------------- 1 | af78e8991315fe6be10e6c01d2cf80bb -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/FontManifest.json: -------------------------------------------------------------------------------- 1 | [{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]},{"family":"packages/cupertino_icons/CupertinoIcons","fonts":[{"asset":"packages/cupertino_icons/assets/CupertinoIcons.ttf"}]},{"family":"packages/font_awesome_flutter/FontAwesomeBrands","fonts":[{"weight":400,"asset":"packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf"}]},{"family":"packages/font_awesome_flutter/FontAwesomeRegular","fonts":[{"weight":400,"asset":"packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf"}]},{"family":"packages/font_awesome_flutter/FontAwesomeSolid","fonts":[{"weight":900,"asset":"packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf"}]}] -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/dir/.env.example: -------------------------------------------------------------------------------- 1 | endpointApi= 2 | -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/bg.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/contact.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/email.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/emawork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/emawork.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/github.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/google.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/logo.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/logo36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/logo36.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/profile.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/secret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/secret.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/smc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/smc.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/assets/images/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/assets/images/youtube.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/fonts/MaterialIcons-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/fonts/MaterialIcons-Regular.otf -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/error.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/error.flr -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/info.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/info.flr -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/info2.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/info2.flr -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/info_without_loop.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/info_without_loop.flr -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/question.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/question.flr -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/succes.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/succes.flr -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/succes_without_loop.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/succes_without_loop.flr -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/warning.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/warning.flr -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/warning_without_loop.flr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/flare/warning_without_loop.flr -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/error.riv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/error.riv -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/info.riv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/info.riv -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/info_reverse.riv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/info_reverse.riv -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/question.riv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/question.riv -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/success.riv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/success.riv -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/warning.riv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/awesome_dialog/assets/rive/warning.riv -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/cupertino_icons/assets/CupertinoIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/cupertino_icons/assets/CupertinoIcons.ttf -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/dribble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/dribble.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/facebook.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/google.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/line.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/linkedin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/linkedin.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/pinterest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/pinterest.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/slack.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/twitter.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/wechat.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/whatsapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/whatsapp.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/packages/getwidget/icons/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/packages/getwidget/icons/youtube.png -------------------------------------------------------------------------------- /frontend-smc/build/web/assets/shaders/ink_sparkle.frag: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/assets/shaders/ink_sparkle.frag -------------------------------------------------------------------------------- /frontend-smc/build/web/canvaskit/canvaskit.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/canvaskit/canvaskit.wasm -------------------------------------------------------------------------------- /frontend-smc/build/web/canvaskit/profiling/canvaskit.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/canvaskit/profiling/canvaskit.wasm -------------------------------------------------------------------------------- /frontend-smc/build/web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/favicon.ico -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/Icon-192.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/Icon-512.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/android-icon-144x144.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/android-icon-192x192.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/android-icon-36x36.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/android-icon-48x48.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/android-icon-72x72.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/android-icon-96x96.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon-114x114.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon-120x120.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon-144x144.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon-152x152.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon-180x180.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon-57x57.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon-60x60.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon-72x72.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon-76x76.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon-precomposed.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/apple-icon.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/favicon-16x16.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/favicon-32x32.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/favicon-96x96.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/favicon.ico -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "\/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "\/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "\/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "\/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "\/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image\/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "\/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image\/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/ms-icon-144x144.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/ms-icon-150x150.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/ms-icon-310x310.png -------------------------------------------------------------------------------- /frontend-smc/build/web/icons/ico/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/build/web/icons/ico/ms-icon-70x70.png -------------------------------------------------------------------------------- /frontend-smc/build/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SMC", 3 | "short_name": "SMC", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "Sistema Maturacao de Chip", 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 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /frontend-smc/build/web/version.json: -------------------------------------------------------------------------------- 1 | {"app_name":"smc","version":"1.0.0","build_number":"1","package_name":"smc"} -------------------------------------------------------------------------------- /frontend-smc/lib/src/commons/commons.dart: -------------------------------------------------------------------------------- 1 | export 'package:smc/src/commons/components/bootstrap/text_form_field_bootstrap.dart'; 2 | export 'package:smc/src/commons/components/bootstrap/text_form_field_controller_bootstrap.dart'; 3 | export 'package:smc/src/commons/components/bootstrap/text_form_field_id_bootstrap.dart'; 4 | export 'package:smc/src/commons/components/bootstrap/text_form_field_switch_bootstrap.dart'; 5 | export 'package:smc/src/commons/components/bootstrap/vazio_bootstrap.dart'; 6 | 7 | //WIDGETS 8 | export 'package:smc/src/commons/components/widgets/text_field_switch_widget.dart'; 9 | export 'package:smc/src/commons/components/widgets/get_elevate_button.dart'; 10 | export 'package:smc/src/commons/components/widgets/dropdown_widget.dart'; 11 | export 'package:smc/src/commons/components/widgets/text_field_switch_widget.dart'; 12 | export 'package:smc/src/commons/components/widgets/botoes.dart'; 13 | export 'package:smc/src/commons/components/widgets/switch.dart'; 14 | 15 | //Utils 16 | export 'package:smc/src/commons/components/utils/lower_case_text_formatter.dart'; 17 | export 'package:smc/src/commons/components/utils/upper_case_text_formatter.dart'; 18 | export 'package:smc/src/commons/components/utils/valida_campo_formulario.dart'; 19 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/commons/components/bootstrap/text_form_field_id_bootstrap.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/infra/biblioteca.dart'; 2 | import 'package:smc/src/utils/view_util.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_bootstrap/flutter_bootstrap.dart'; 5 | 6 | // ignore: non_constant_identifier_names 7 | BootstrapCol TextFormFieldIdBootstrap({ 8 | required BuildContext context, 9 | required String sizes, 10 | required String initialValue, 11 | }) { 12 | return BootstrapCol( 13 | sizes: sizes, 14 | child: Padding( 15 | padding: Biblioteca.distanciaEntreColunasQuebraLinha(context), 16 | child: TextFormField( 17 | maxLength: 14, 18 | maxLines: 1, 19 | readOnly: true, 20 | enabled: false, 21 | textAlign: TextAlign.end, 22 | initialValue: initialValue, 23 | decoration: ViewUtil.getInputDecorationPersistePage( 24 | 'Informe o id', 'ID:', false), 25 | onSaved: (value) {}, 26 | onChanged: (text) {}, 27 | ), 28 | ), 29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/commons/components/bootstrap/text_form_field_switch_bootstrap.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/infra/biblioteca.dart'; 2 | import 'package:smc/src/infra/themes.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_bootstrap/flutter_bootstrap.dart'; 5 | 6 | import '../../commons.dart'; 7 | 8 | // ignore: non_constant_identifier_names 9 | BootstrapCol TextFormFieldSwitchBootstrap({ 10 | required BuildContext context, 11 | required String sizes, 12 | required String texto, 13 | String tooltip = '', 14 | bool isSwitched = false, 15 | required Function(bool) onPressed, 16 | Color activeTrackColor = Colors.lightGreenAccent, 17 | Color activeColor = Colors.green, 18 | Color textColor = Colors.black, 19 | Color textBorder = colorAppBar, 20 | }) { 21 | return BootstrapCol( 22 | sizes: sizes, 23 | child: Padding( 24 | padding: Biblioteca.distanciaEntreColunasQuebraLinha(context), 25 | child: TextFieldSwitchWidget( 26 | texto: texto, 27 | tooltip: tooltip, 28 | isSwitched: isSwitched, 29 | onPressed: onPressed, 30 | activeTrackColor: activeTrackColor, 31 | activeColor: activeColor, 32 | textColor: textColor, 33 | textBorder: textBorder, 34 | ), 35 | ), 36 | ); 37 | } 38 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/commons/components/bootstrap/vazio_bootstrap.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/infra/biblioteca.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_bootstrap/flutter_bootstrap.dart'; 4 | 5 | // ignore: non_constant_identifier_names 6 | BootstrapCol VazioBootstrap({ 7 | required BuildContext context, 8 | String sizes = 'col-1 col-sm-1 col-md-1', 9 | }) { 10 | return BootstrapCol( 11 | sizes: sizes, 12 | child: Padding( 13 | padding: Biblioteca.distanciaEntreColunasQuebraLinha(context), 14 | child: Container(), 15 | ), 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/commons/components/dropdown_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/infra/themes.dart'; 3 | import 'package:smc/src/providers/theme_provider.dart'; 4 | 5 | class DropDownWidget { 6 | /// singleton 7 | factory DropDownWidget() { 8 | _this ??= DropDownWidget._(); 9 | return _this!; 10 | } 11 | 12 | static DropDownWidget? _this; 13 | 14 | DropDownWidget._() : super(); 15 | 16 | /// Retorna um DropdownButton 17 | static AnimatedBuilder getDropDownButton( 18 | String value, Function(String?) onChanged, List items) { 19 | return AnimatedBuilder( 20 | animation: ThemeProvider.instance, 21 | builder: (context, child) { 22 | return DropdownButton( 23 | focusColor: 24 | ThemeProvider.instance.isDarkTheme ? Colors.white : Colors.black, 25 | dropdownColor: 26 | ThemeProvider.instance.isDarkTheme ? bgColor : primaryColor, 27 | isExpanded: true, 28 | value: value, 29 | onChanged: onChanged, 30 | items: items.map>((String value) { 31 | return DropdownMenuItem( 32 | value: value, 33 | child: Text(value), 34 | ); 35 | }).toList(), 36 | ); 37 | }, 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/commons/components/utils/lower_case_text_formatter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | 3 | class LowerCaseTextFormatter extends TextInputFormatter { 4 | @override 5 | TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { 6 | return newValue.copyWith(text: newValue.text.toLowerCase()); 7 | } 8 | } -------------------------------------------------------------------------------- /frontend-smc/lib/src/commons/components/utils/upper_case_text_formatter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | 3 | class UpperCaseTextFormatter extends TextInputFormatter { 4 | @override 5 | TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { 6 | return newValue.copyWith(text: newValue.text.toUpperCase()); 7 | } 8 | } -------------------------------------------------------------------------------- /frontend-smc/lib/src/commons/components/widgets/dropdown_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/infra/themes.dart'; 3 | import 'package:smc/src/providers/theme_provider.dart'; 4 | 5 | class DropDownWidget { 6 | /// singleton 7 | factory DropDownWidget() { 8 | _this ??= DropDownWidget._(); 9 | return _this!; 10 | } 11 | 12 | static DropDownWidget? _this; 13 | 14 | DropDownWidget._() : super(); 15 | 16 | /// Retorna um DropdownButton 17 | static AnimatedBuilder getDropDownButton( 18 | String value, Function(String?) onChanged, List items) { 19 | return AnimatedBuilder( 20 | animation: ThemeProvider.instance, 21 | builder: (context, child) { 22 | return DropdownButton( 23 | focusColor: 24 | ThemeProvider.instance.isDarkTheme ? Colors.white : Colors.black, 25 | dropdownColor: 26 | ThemeProvider.instance.isDarkTheme ? bgColor : primaryColor, 27 | isExpanded: true, 28 | value: value, 29 | onChanged: onChanged, 30 | items: items.map>((String value) { 31 | return DropdownMenuItem( 32 | value: value, 33 | child: Text(value), 34 | ); 35 | }).toList(), 36 | ); 37 | }, 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/commons/components/widgets/get_elevate_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/infra/themes.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | Widget getElevationButtom({ 5 | required String texto, 6 | double xelevation = 20, 7 | Color textColor = Colors.white, 8 | Color buttonColor = Colors.blue, 9 | Color shadow = colorAppBar, 10 | required Function() onPressed, 11 | }) { 12 | return ElevatedButton( 13 | style: ElevatedButton.styleFrom( 14 | backgroundColor: buttonColor, 15 | disabledForegroundColor: Colors.green.withOpacity(0.38), 16 | disabledBackgroundColor: Colors.green.withOpacity(0.12), 17 | elevation: xelevation, 18 | shadowColor: colorAppBar, 19 | ), 20 | onPressed: onPressed, 21 | child: Text( 22 | texto, 23 | style: TextStyle( 24 | color: textColor, 25 | ), 26 | ), 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/commons/components/widgets/text_field_switch_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/infra/themes.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | // ignore: non_constant_identifier_names 5 | Widget TextFieldSwitchWidget( 6 | {required String texto, 7 | String tooltip = '', 8 | bool isSwitched = false, 9 | bool decoration = false, 10 | required Function(bool)? onPressed, 11 | Color activeTrackColor = Colors.lightGreenAccent, 12 | Color activeColor = Colors.green, 13 | Color textColor = Colors.black, 14 | Color textBorder = colorAppBar}) { 15 | return Row( 16 | children: [ 17 | Container( 18 | margin: const EdgeInsets.all(5), 19 | padding: const EdgeInsets.all(2), 20 | alignment: Alignment.center, 21 | decoration: decoration 22 | ? BoxDecoration( 23 | border: Border.all(width: 1.0, color: textBorder), 24 | borderRadius: const BorderRadius.all(Radius.circular(8.0)), 25 | ) 26 | : null, 27 | child: Tooltip( 28 | message: tooltip, 29 | child: Text( 30 | texto, 31 | style: TextStyle(color: textColor, fontWeight: FontWeight.bold), 32 | ), 33 | ), 34 | ), 35 | Center( 36 | child: Switch( 37 | value: isSwitched, 38 | onChanged: onPressed, 39 | activeTrackColor: Colors.lightGreenAccent, 40 | activeColor: Colors.green, 41 | ), 42 | ), 43 | ], 44 | ); 45 | } 46 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/app_theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | // ignore: constant_identifier_names 4 | enum AppTheme{Light, Dark} 5 | 6 | double screenWidth(BuildContext context)=>MediaQuery.of(context).size.width; 7 | double screenHeight(BuildContext context)=>MediaQuery.of(context).size.height; 8 | 9 | final appThemeData = { 10 | AppTheme.Light : ThemeData( 11 | brightness: Brightness.light, 12 | primaryColor: Colors.blue[900], 13 | scaffoldBackgroundColor: Colors.white, 14 | bottomAppBarColor: Colors.grey[100], colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(secondary: Colors.blueAccent) 15 | ), 16 | AppTheme.Dark : ThemeData( 17 | brightness: Brightness.dark, 18 | primaryColor: const Color(0xFF294c60), 19 | scaffoldBackgroundColor: Colors.grey[800], 20 | bottomAppBarColor: Colors.grey[700], colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blueGrey).copyWith(secondary: Colors.lightBlueAccent) 21 | ) 22 | }; 23 | 24 | bool isDark(BuildContext context)=>Theme.of(context).brightness == Brightness.dark; 25 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/authorities.dart: -------------------------------------------------------------------------------- 1 | class Authorities { 2 | /// singleton 3 | factory Authorities() { 4 | _this ??= Authorities._(); 5 | return _this!; 6 | } 7 | static Authorities? _this; 8 | Authorities._() : super(); 9 | 10 | static List? authorities; 11 | 12 | static bool isAuthorities(String cdg) { 13 | return _verifica(authorities, cdg); 14 | } 15 | } 16 | 17 | _verifica(List? authorities, String cdg) { 18 | return authorities == null ? false : authorities.contains("'$cdg'"); 19 | } 20 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/breakpoints.dart: -------------------------------------------------------------------------------- 1 | const mobileBreakpoint = 540; 2 | const tabletBreakpoint = 800; 3 | const desktopBreakpoint = 1200; 4 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppCores { 4 | static const white = Colors.white; 5 | static const secondary = Color(0xffa6a6a6); 6 | static const iconGray = Color(0xff767676); 7 | static const black = Colors.black; 8 | static const primary = Color(0xff262626); 9 | static const primaryBg = Color(0xfff5f5fd); 10 | static const secondaryBg = Color(0xffececf6); 11 | static const barBg = Color(0xffe3e3ee); 12 | } 13 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/hexa_color.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class HexColor extends Color { 4 | static int _getColorFromHex(String hexColor) { 5 | return int.parse(hexColor, radix: 16); 6 | } 7 | 8 | HexColor(final String hexColor) : super(_getColorFromHex(hexColor)); 9 | } 10 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/locator.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/services/service.dart'; 2 | import 'package:smc/src/view_model/view_model.dart'; 3 | 4 | import 'package:get_it/get_it.dart'; 5 | 6 | GetIt locator = GetIt.instance; 7 | 8 | void setupLocator() { 9 | locator.registerLazySingleton(() => LoginService()); 10 | locator.registerFactory(() => LoginViewModel()); 11 | locator.registerLazySingleton(() => UserService()); 12 | locator.registerFactory(() => UserViewModel()); 13 | locator.registerLazySingleton(() => SettingService()); 14 | locator.registerFactory(() => SettingViewModel()); 15 | locator.registerLazySingleton(() => ConectionService()); 16 | locator.registerFactory(() => ConectionViewModel()); 17 | locator.registerLazySingleton(() => QuestionService()); 18 | locator.registerFactory(() => QuestionViewModel()); 19 | locator.registerLazySingleton(() => ShotsService()); 20 | locator.registerFactory(() => ShotsViewModel()); 21 | } 22 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/paleta_cores.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class PaletaCores { 4 | 5 | static const Color corPrimaria = Color(0xff075E54); 6 | static const Color corDestaque = Color(0xff25D366); 7 | static const Color corFundo = Color(0xffD9DBD5); 8 | static const Color corFundoBarra = Color(0xffededed); 9 | static const Color corFundoBarraClaro = Color(0xfff6f6f6); 10 | 11 | } -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/responsive_media_query.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ResponsiveMediaQuery extends StatelessWidget { 4 | final Widget mobile; 5 | final Widget? tablet; 6 | final Widget desktop; 7 | final Widget? smallMobile; 8 | 9 | const ResponsiveMediaQuery( 10 | {Key? key, 11 | required this.mobile, 12 | this.tablet, 13 | required this.desktop, 14 | this.smallMobile}) 15 | : super(key: key); 16 | 17 | // This size work fine on my design, maybe you need some customization depends on your design 18 | 19 | // This isMobile, isTablet, isDesktop helep us later 20 | static bool isMobile(BuildContext context) => 21 | MediaQuery.of(context).size.width < 768; 22 | 23 | static bool isTablet(BuildContext context) => 24 | MediaQuery.of(context).size.width < 1200 && 25 | MediaQuery.of(context).size.width >= 768; 26 | 27 | static bool isDesktop(BuildContext context) => 28 | MediaQuery.of(context).size.width >= 1200; 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | final Size size = MediaQuery.of(context).size; 33 | // If our width is more than 1200 then we consider it a desktop 34 | if (size.width >= 1200) { 35 | return desktop; 36 | } 37 | // If width it less then 1200 and more then 768 we consider it as tablet 38 | else if (size.width >= 768 && tablet != null) { 39 | return tablet!; 40 | } 41 | // Or less then that we called it mobile 42 | // ignore: unnecessary_null_comparison 43 | else if (size.width >= 376 && size.width <= 768 && mobile != null) { 44 | return mobile; 45 | } else { 46 | return smallMobile!; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/rotas.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/infra/themes.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:smc/src/pages/home/home_page.dart'; 4 | import 'package:smc/src/pages/login/login_page.dart'; 5 | 6 | class Rotas { 7 | static Route definirRotas(RouteSettings settings) { 8 | switch (settings.name) { 9 | 10 | // Login 11 | case '/': 12 | return MaterialPageRoute(builder: (_) => const LoginPage()); 13 | // Home 14 | case '/home': 15 | return MaterialPageRoute(builder: (_) => const HomePage()); 16 | 17 | // default 18 | default: 19 | return MaterialPageRoute( 20 | builder: (_) => Scaffold( 21 | appBar: AppBar( 22 | backgroundColor: colorAppBar, 23 | title: const Text('Erro na rota de Navegação'), 24 | actions: const [], 25 | ), 26 | body: Column( 27 | children: [ 28 | const SizedBox( 29 | height: 150, 30 | ), 31 | Center( 32 | child: Text( 33 | 'Nenhuma rota definida para {$settings.name}', 34 | style: const TextStyle( 35 | fontWeight: FontWeight.bold, fontSize: 20), 36 | ), 37 | ), 38 | ], 39 | )), 40 | ); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/size_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SizeConfig { 4 | static MediaQueryData? _mediaQueryData; 5 | static double? screenWidth; 6 | static double? screenHeight; 7 | static double? blockSizeHorizontal; 8 | static double? blockSizeVertical; 9 | 10 | void init(BuildContext context) { 11 | _mediaQueryData = MediaQuery.of(context); 12 | screenWidth = _mediaQueryData!.size.width; 13 | screenHeight = _mediaQueryData!.size.height; 14 | blockSizeHorizontal = screenWidth! / 100; 15 | blockSizeVertical = screenHeight! / 100; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/style.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/infra/colors.dart'; 3 | 4 | class PrimaryText extends StatelessWidget { 5 | final double size; 6 | final FontWeight fontWeight; 7 | final Color color; 8 | final String text; 9 | final double height; 10 | 11 | const PrimaryText({ 12 | super.key, 13 | this.text = "", 14 | this.fontWeight = FontWeight.w400, 15 | this.color = AppCores.primary, 16 | this.size = 20, 17 | this.height = 1.3, 18 | }); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Text( 23 | text, 24 | style: TextStyle( 25 | color: color, 26 | height: height, 27 | fontFamily: 'Poppins', 28 | fontSize: size, 29 | fontWeight: fontWeight, 30 | ), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/infra/versao.dart: -------------------------------------------------------------------------------- 1 | const versao = "1.0.2"; 2 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/library/bloc_pattern/bloc_pattern.dart: -------------------------------------------------------------------------------- 1 | export 'package:smc/src/library/bloc_pattern/lib/dependency.dart'; 2 | export 'package:smc/src/library/bloc_pattern/lib/bloc.dart'; 3 | export 'package:smc/src/library/bloc_pattern/lib/core.dart'; 4 | export 'package:smc/src/library/bloc_pattern/lib/bloc_base.dart'; 5 | export 'package:smc/src/library/bloc_pattern/lib/bloc_provider.dart'; 6 | export 'package:smc/src/library/bloc_pattern/lib/inject.dart'; 7 | export 'package:smc/src/library/bloc_pattern/lib/disposable.dart'; 8 | export 'package:smc/src/library/bloc_pattern/lib/consumer.dart'; 9 | export 'package:smc/src/library/bloc_pattern/lib/module.dart'; 10 | export 'package:smc/src/library/bloc_pattern/lib/bloc_provider_error.dart'; 11 | export 'package:smc/src/library/bloc_pattern/lib/consumer_module.dart'; 12 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/library/bloc_pattern/lib/bloc.dart: -------------------------------------------------------------------------------- 1 | 2 | import '../bloc_pattern.dart'; 3 | 4 | class Bloc { 5 | final T Function(Inject i) inject; 6 | final bool singleton; 7 | 8 | Bloc(this.inject, {this.singleton = true}); 9 | } 10 | 11 | class EmptyBloc extends Bloc { 12 | EmptyBloc() : super((Inject i) {}); 13 | } 14 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/library/bloc_pattern/lib/bloc_base.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | 3 | abstract class BlocBase extends ChangeNotifier {} 4 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/library/bloc_pattern/lib/bloc_provider_error.dart: -------------------------------------------------------------------------------- 1 | class BlocProviderException implements Exception { 2 | String cause; 3 | BlocProviderException(this.cause); 4 | 5 | @override 6 | String toString() { 7 | return "BlocProvider: $cause"; 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /frontend-smc/lib/src/library/bloc_pattern/lib/consumer.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: library_private_types_in_public_api 2 | 3 | import 'package:flutter/material.dart'; 4 | import '../bloc_pattern.dart'; 5 | 6 | class Consumer extends StatefulWidget { 7 | final Widget Function(BuildContext context, T value) builder; 8 | final String tag; 9 | final bool Function(T oldValue, T newValue)? distinct; 10 | 11 | const Consumer({Key? key, required this.builder, this.tag = "global", this.distinct}) : super(key: key); 12 | 13 | @override 14 | _ConsumerState createState() => _ConsumerState(); 15 | } 16 | 17 | class _ConsumerState extends State> { 18 | late T value; 19 | 20 | String tag = "global"; 21 | 22 | void listener() { 23 | T newValue = BlocProvider.tag(widget.tag).getBloc(); 24 | if (widget.distinct == null || widget.distinct?.call(value, newValue) != true) { 25 | setState(() { 26 | value = newValue; 27 | }); 28 | } 29 | } 30 | 31 | @override 32 | void initState() { 33 | value = BlocProvider.tag(widget.tag).getBloc(); 34 | value.addListener(listener); 35 | super.initState(); 36 | } 37 | 38 | @override 39 | void dispose() { 40 | value.removeListener(listener); 41 | super.dispose(); 42 | } 43 | 44 | @override 45 | Widget build(BuildContext context) { 46 | return widget.builder(context, value); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/library/bloc_pattern/lib/consumer_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../bloc_pattern.dart'; 4 | 5 | 6 | class ConsumerModule extends Consumer { 7 | ConsumerModule({Key? key, final bool Function(T oldValue, T newValue)? distinct, required Widget Function(BuildContext context, T value) builder}) 8 | : super(key: key, builder: builder, tag: R.toString(), distinct: distinct); 9 | } 10 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/library/bloc_pattern/lib/dependency.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import '../bloc_pattern.dart'; 4 | 5 | class Dependency { 6 | final T Function(Inject i) inject; 7 | final bool singleton; 8 | 9 | Dependency(this.inject, {this.singleton = true}); 10 | } 11 | 12 | class EmptyDependency extends Dependency { 13 | EmptyDependency() : super((Inject i) {}); 14 | } 15 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/library/bloc_pattern/lib/disposable.dart: -------------------------------------------------------------------------------- 1 | abstract class Disposable { 2 | void dispose(); 3 | } 4 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/library/bloc_pattern/lib/inject.dart: -------------------------------------------------------------------------------- 1 | 2 | // ignore_for_file: avoid_shadowing_type_parameters 3 | 4 | import '../bloc_pattern.dart'; 5 | 6 | class Inject { 7 | Map? params = {}; 8 | final String tag; 9 | 10 | Inject({this.params, this.tag = "global"}); 11 | 12 | factory Inject.of() => Inject(tag: T.toString()); 13 | 14 | ///get injected dependency 15 | T get([Map? params]) { 16 | params ??= {}; 17 | return BlocProvider.getDependency(params, tag); 18 | } 19 | 20 | ///get injected dependency 21 | T getDependency([Map? params]) { 22 | return get(params); 23 | } 24 | 25 | disposeBloc() { 26 | return BlocProvider.disposeBloc(tag); 27 | } 28 | 29 | disposeDependency() { 30 | return BlocProvider.disposeDependency(tag); 31 | } 32 | 33 | ///get injected bloc; 34 | T bloc([Map? params]) { 35 | params ??= {}; 36 | return BlocProvider.getBloc(params, tag); 37 | } 38 | 39 | ///get injected bloc; 40 | T getBloc([Map? params]) { 41 | params ??= {}; 42 | return bloc(params); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/library/bloc_pattern/lib/module.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../bloc_pattern.dart'; 4 | 5 | abstract class ModuleWidget extends StatelessWidget { 6 | const ModuleWidget({Key? key}) : super(key: key); 7 | 8 | List get blocs; 9 | List get dependencies; 10 | Widget get view; 11 | 12 | Inject get inject => BlocProvider.tag(runtimeType.toString()); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return BlocProvider( 17 | tagText: runtimeType.toString(), 18 | blocs: blocs, 19 | dependencies: dependencies, 20 | child: view, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/models/connection_model.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_renaming_method_parameters 2 | 3 | import 'dart:convert'; 4 | 5 | class ConnectionModel { 6 | dynamic id; 7 | dynamic status; 8 | 9 | ConnectionModel({ 10 | this.id, 11 | this.status, 12 | }); 13 | 14 | ConnectionModel copyWith({ 15 | dynamic id, 16 | dynamic status, 17 | }) { 18 | return ConnectionModel( 19 | id: id ?? this.id, 20 | status: status, 21 | ); 22 | } 23 | 24 | Map toMap() { 25 | return { 26 | 'id': id, 27 | 'status': status, 28 | }; 29 | } 30 | 31 | factory ConnectionModel.fromMap(Map map) { 32 | return ConnectionModel( 33 | id: map['id'], 34 | status: map['status'], 35 | ); 36 | } 37 | 38 | @override 39 | String toString() => 'ConnectionModel(id: $id, status: $status)'; 40 | 41 | String toJson() => json.encode(toMap()); 42 | 43 | factory ConnectionModel.fromJson(String source) => 44 | ConnectionModel.fromMap(json.decode(source)); 45 | 46 | static List fromJsonList(List list) { 47 | return list 48 | .map((item) => ConnectionModel.fromMap(item)) 49 | .toList(); 50 | } 51 | 52 | @override 53 | bool operator ==(Object o) { 54 | if (identical(this, o)) return true; 55 | 56 | return o is ConnectionModel && o.id == id && o.status == status; 57 | } 58 | 59 | @override 60 | int get hashCode => id.hashCode ^ status.hashCode; 61 | } 62 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/models/filtro.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class Filtro { 4 | String? page; 5 | String? total; 6 | String? search; 7 | String? all; 8 | String? di; 9 | String? df; 10 | 11 | Filtro({this.search, this.all, this.di, this.df, this.page, this.total}); 12 | 13 | Filtro.fromJson(Map jsonDados) { 14 | page = jsonDados['page']; 15 | total = jsonDados['total']; 16 | search = jsonDados['search']; 17 | all = jsonDados['all']; 18 | di = jsonDados['di']; 19 | df = jsonDados['df']; 20 | } 21 | 22 | Map get toJson { 23 | Map jsonDados = {}; 24 | jsonDados['page'] = page; 25 | jsonDados['total'] = total; 26 | jsonDados['search'] = search; 27 | jsonDados['all'] = all; 28 | jsonDados['di'] = di; 29 | jsonDados['df'] = df; 30 | return jsonDados; 31 | } 32 | } 33 | 34 | String filtroEncodeJson(Filtro filtro) { 35 | final jsonDados = filtro.toJson; 36 | return json.encode(jsonDados); 37 | } 38 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/models/model.dart: -------------------------------------------------------------------------------- 1 | export 'package:smc/src/models/connection_model.dart'; 2 | export 'package:smc/src/models/whatsapp_model.dart'; 3 | export 'package:smc/src/models/user_model.dart'; 4 | export 'package:smc/src/models/setting_model.dart'; 5 | export 'package:smc/src/models/question_model.dart'; 6 | export 'package:smc/src/models/shots_model.dart'; 7 | export 'package:smc/src/models/tenant_model.dart'; 8 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/models/question_model.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_keys 2 | 3 | import 'dart:convert'; 4 | 5 | class QuestionModel { 6 | dynamic id; 7 | dynamic name; 8 | 9 | QuestionModel({ 10 | this.id, 11 | this.name, 12 | }); 13 | 14 | Map toMap() { 15 | return { 16 | 'id': id, 17 | 'name': name, 18 | }; 19 | } 20 | 21 | factory QuestionModel.fromMap(Map map) { 22 | return QuestionModel( 23 | id: map['id']?.toInt() ?? '', 24 | name: map['name'] ?? '', 25 | ); 26 | } 27 | 28 | Map get toJson { 29 | Map jsonDados = {}; 30 | 31 | jsonDados['id'] = id; 32 | jsonDados['name'] = name; 33 | 34 | return jsonDados; 35 | } 36 | 37 | String objetoEncodeJson(QuestionModel objeto) { 38 | final jsonDados = objeto.toJson; 39 | return json.encode(jsonDados); 40 | } 41 | 42 | static List fromJsonList(List list) { 43 | return list 44 | .map((item) => QuestionModel.fromMap(item)) 45 | .toList(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/models/retorno_json_erro.dart: -------------------------------------------------------------------------------- 1 | class RetornoJsonErro { 2 | String? status; 3 | String? error; 4 | String? message; 5 | String? trace; 6 | String? tipo; 7 | 8 | RetornoJsonErro({status, error, message, trace, tipo}); 9 | 10 | RetornoJsonErro.fromJson(Map jsonDados) { 11 | status = jsonDados['status']; 12 | error = jsonDados['error']; 13 | message = jsonDados['message']; 14 | trace = jsonDados['trace']; 15 | } 16 | 17 | Map get toJson { 18 | Map jsonDados = {}; 19 | jsonDados['status'] = status; 20 | jsonDados['error'] = error; 21 | jsonDados['message'] = message; 22 | jsonDados['trace'] = trace; 23 | return jsonDados; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/models/setting_model.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_keys 2 | 3 | import 'dart:convert'; 4 | 5 | class SettingModel { 6 | dynamic id; 7 | dynamic description; 8 | dynamic key; 9 | dynamic value; 10 | dynamic content; 11 | 12 | SettingModel({ 13 | this.id, 14 | this.description, 15 | this.key, 16 | this.value, 17 | this.content, 18 | }); 19 | 20 | Map toMap() { 21 | return { 22 | 'id': id, 23 | 'description': description, 24 | 'key': key, 25 | 'value': value, 26 | 'content': content, 27 | }; 28 | } 29 | 30 | factory SettingModel.fromMap(Map map) { 31 | return SettingModel( 32 | id: map['id']?.toInt() ?? '', 33 | description: map['description'] ?? '', 34 | key: map['key'] ?? '', 35 | value: map['value'] ?? false, 36 | content: map['content'] ?? '', 37 | ); 38 | } 39 | 40 | Map get toJson { 41 | Map jsonDados = {}; 42 | 43 | jsonDados['id'] = id; 44 | jsonDados['description'] = description; 45 | jsonDados['key'] = key; 46 | jsonDados['value'] = value; 47 | jsonDados['content'] = content; 48 | 49 | return jsonDados; 50 | } 51 | 52 | String objetoEncodeJson(SettingModel objeto) { 53 | final jsonDados = objeto.toJson; 54 | return json.encode(jsonDados); 55 | } 56 | 57 | static List fromJsonList(List list) { 58 | return list 59 | .map((item) => SettingModel.fromMap(item)) 60 | .toList(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/models/user_model.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names 2 | 3 | import 'dart:convert'; 4 | 5 | class UserModel { 6 | dynamic id; 7 | dynamic name; 8 | dynamic email; 9 | dynamic password; 10 | 11 | UserModel({ 12 | this.id, 13 | this.name, 14 | this.email, 15 | this.password, 16 | }); 17 | 18 | Map toMap() { 19 | return { 20 | 'id': id, 21 | 'name': name, 22 | 'email': email, 23 | 'password': password, 24 | }; 25 | } 26 | 27 | factory UserModel.fromMap(Map map) { 28 | return UserModel( 29 | id: map['id']?.toInt() ?? '', 30 | name: map['name'] ?? '', 31 | email: map['email'] ?? '', 32 | password: map['password'] ?? '', 33 | ); 34 | } 35 | 36 | Map get toJson { 37 | Map jsonDados = {}; 38 | 39 | jsonDados['id'] = id; 40 | jsonDados['name'] = name; 41 | jsonDados['email'] = email; 42 | jsonDados['password'] = password; 43 | 44 | return jsonDados; 45 | } 46 | 47 | String objetoEncodeJson(UserModel objeto) { 48 | final jsonDados = objeto.toJson; 49 | return json.encode(jsonDados); 50 | } 51 | 52 | static List fromJsonList(List list) { 53 | return list.map((item) => UserModel.fromMap(item)).toList(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/pages/conection/conection_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../library/bloc_pattern/bloc_pattern.dart'; 4 | import '../../streams/stream.dart'; 5 | import '../pages.dart'; 6 | 7 | class ConectionModule extends ModuleWidget { 8 | // 9 | 10 | // ignore: use_key_in_widget_constructors 11 | const ConectionModule(); 12 | 13 | @override 14 | List get blocs => [ 15 | Bloc( 16 | (i) => WhatsappBloc(), 17 | ), 18 | ]; 19 | 20 | @override 21 | List get dependencies => []; 22 | 23 | @override 24 | Widget get view => const ConectionPage(); 25 | static Inject get to => Inject.of(); 26 | } 27 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/pages/configuration/configurations_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/streams/setting_bloc.dart'; 3 | 4 | import '../../library/bloc_pattern/bloc_pattern.dart'; 5 | import '../pages.dart'; 6 | 7 | class ConfigurationsModule extends ModuleWidget { 8 | // 9 | 10 | // ignore: use_key_in_widget_constructors 11 | const ConfigurationsModule(); 12 | 13 | @override 14 | List get blocs => [ 15 | Bloc( 16 | (i) => SettingBloc(), 17 | ), 18 | ]; 19 | 20 | @override 21 | List get dependencies => []; 22 | 23 | @override 24 | Widget get view => const ConfigurationsPage(); 25 | static Inject get to => Inject.of(); 26 | } 27 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/pages/login/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/pages/login/login_page_left_side.dart'; 3 | import 'package:smc/src/pages/login/login_page_right_side.dart'; 4 | import 'package:smc/src/providers/theme_provider.dart'; 5 | 6 | class LoginPage extends StatelessWidget { 7 | const LoginPage({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return AnimatedBuilder( 12 | animation: ThemeProvider.instance, 13 | builder: (context, child) { 14 | return Scaffold( 15 | backgroundColor: Colors.white, 16 | body: Center( 17 | child: SingleChildScrollView( 18 | child: Container( 19 | height: MediaQuery.of(context).size.height, 20 | width: MediaQuery.of(context).size.width, 21 | margin: const EdgeInsets.symmetric(horizontal: 0), 22 | clipBehavior: Clip.antiAliasWithSaveLayer, 23 | decoration: BoxDecoration( 24 | borderRadius: BorderRadius.circular(4), 25 | gradient: LinearGradient( 26 | begin: Alignment.centerLeft, 27 | end: Alignment.centerRight, 28 | colors: [Colors.blue, Colors.blue[800]!]), 29 | ), 30 | child: Row( 31 | children: [ 32 | if (MediaQuery.of(context).size.width > 900) 33 | const LoginPageRightSide(), 34 | const LoginPageLeftSide(), 35 | ], 36 | ), 37 | ), 38 | ), 39 | ), 40 | ); 41 | }, 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/pages/pages.dart: -------------------------------------------------------------------------------- 1 | export 'package:smc/src/pages/conection/conection_page.dart'; 2 | export 'package:smc/src/pages/conection/conection_persiste_page.dart'; 3 | export 'package:smc/src/pages/home/side_menu.dart'; 4 | export 'package:smc/src/pages/home/appbar/web_app_bar.dart'; 5 | export 'package:smc/src/pages/home/home_page.dart'; 6 | export 'package:smc/src/pages/login/login_page.dart'; 7 | export 'package:smc/src/pages/question/questions_page.dart'; 8 | export 'package:smc/src/pages/shots/shots_page.dart'; 9 | export 'package:smc/src/pages/shots/shots_persiste_page.dart'; 10 | export 'package:smc/src/pages/configuration/configurations_page.dart'; 11 | export 'package:smc/src/pages/question/questions_page.dart'; 12 | export 'package:smc/src/pages/question/question_persiste_page.dart'; 13 | 14 | export 'package:smc/src/pages/conection/conection_module.dart'; 15 | export 'package:smc/src/pages/question/questions_module.dart'; 16 | export 'package:smc/src/pages/configuration/configurations_module.dart'; 17 | export 'package:smc/src/pages/shots/shots_module.dart'; 18 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/pages/question/questions_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../library/bloc_pattern/bloc_pattern.dart'; 4 | import '../../streams/stream.dart'; 5 | import '../pages.dart'; 6 | 7 | class QuestionsModule extends ModuleWidget { 8 | // 9 | 10 | // ignore: use_key_in_widget_constructors 11 | const QuestionsModule(); 12 | 13 | @override 14 | List get blocs => [ 15 | Bloc( 16 | (i) => QuestionBloc(), 17 | ), 18 | ]; 19 | 20 | @override 21 | List get dependencies => []; 22 | 23 | @override 24 | Widget get view => const QuestionsPage(); 25 | static Inject get to => Inject.of(); 26 | } 27 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/pages/shots/shots_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../library/bloc_pattern/bloc_pattern.dart'; 4 | import '../../streams/stream.dart'; 5 | import '../pages.dart'; 6 | 7 | class ShotsModule extends ModuleWidget { 8 | // 9 | 10 | // ignore: use_key_in_widget_constructors 11 | const ShotsModule(); 12 | 13 | @override 14 | List get blocs => [ 15 | Bloc( 16 | (i) => ShotsBloc(), 17 | ), 18 | Bloc( 19 | (i) => WhatsappBloc(), 20 | ), 21 | ]; 22 | 23 | @override 24 | List get dependencies => []; 25 | 26 | @override 27 | Widget get view => const ShotsPage(); 28 | static Inject get to => Inject.of(); 29 | } 30 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/providers/ProviderPageController.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: file_names 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class ProviderPageController extends InheritedWidget { 6 | 7 | final PageController controller; 8 | // ignore: annotate_overrides, overridden_fields 9 | final Widget child; 10 | 11 | // ignore: use_key_in_widget_constructors 12 | const ProviderPageController({required this.controller, required this.child}):super(child: child); 13 | 14 | static ProviderPageController? of(BuildContext context){ 15 | return context.dependOnInheritedWidgetOfExactType(); 16 | } 17 | 18 | 19 | void toPage(int page){ 20 | controller.animateToPage(page, 21 | duration: const Duration(milliseconds: 300), 22 | curve: Curves.easeInOut); 23 | } 24 | 25 | 26 | @override 27 | bool updateShouldNotify(InheritedWidget oldWidget) { 28 | return oldWidget != this; 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /frontend-smc/lib/src/providers/chip_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ChipProvider extends ChangeNotifier { 4 | static ChipProvider instance = ChipProvider(); 5 | bool isvalue = true; 6 | 7 | changeChip() { 8 | isvalue = !isvalue; 9 | notifyListeners(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/providers/theme_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ThemeProvider extends ChangeNotifier { 4 | static ThemeProvider instance = ThemeProvider(); 5 | bool isDarkTheme = false; 6 | bool isMenu = false; 7 | int whatsDesconect = 0; 8 | String rota = 'conections'; 9 | 10 | changeTheme() { 11 | isDarkTheme = !isDarkTheme; 12 | notifyListeners(); 13 | } 14 | 15 | changeMenu() { 16 | isMenu = !isMenu; 17 | notifyListeners(); 18 | } 19 | 20 | setaRota(String value) { 21 | rota = value; 22 | notifyListeners(); 23 | } 24 | 25 | setaWhatsDesconect(int value) { 26 | whatsDesconect = value; 27 | notifyListeners(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/services/refresh_token_api.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: library_prefixes, avoid_print 2 | 3 | import 'dart:convert'; 4 | import 'package:smc/src/utils/view_util.dart'; 5 | import 'package:http/http.dart' as http; 6 | import 'package:smc/src/services/url_base.dart' as urlBase; 7 | 8 | class RefreshTokenApi { 9 | var url = urlBase.endpointApi; 10 | 11 | Future refresh(String token) async { 12 | try { 13 | var url = this.url + 'refresh'; 14 | 15 | Map headers = { 16 | "Accept": "application/json", 17 | "Authorization": "Bearer $token" 18 | }; 19 | 20 | var response = await http.post(Uri.parse(url), headers: headers); 21 | 22 | Map mapResponse = json.decode(response.body); 23 | 24 | if (response.statusCode == 200) { 25 | ViewUtil.tokenJWT = mapResponse["token"]; 26 | return true; 27 | } else { 28 | return false; 29 | } 30 | } catch (error, exception) { 31 | print("Erro no login $error > $exception"); 32 | 33 | return false; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/services/service.dart: -------------------------------------------------------------------------------- 1 | export 'package:smc/src/services/api/login_service.dart'; 2 | export 'package:smc/src/services/api/user_service.dart'; 3 | export 'package:smc/src/services/api/setting_service.dart'; 4 | export 'package:smc/src/services/api/conection_service.dart'; 5 | export 'package:smc/src/services/api/question_service.dart'; 6 | export 'package:smc/src/services/api/shots_service.dart'; 7 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/services/service_base.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/utils/view_util.dart'; 2 | 3 | class ServiceBase { 4 | static const String linguagemServidor = 'dart'; 5 | 6 | /// define o cabeçalho enviado em todas as requisições que segue com o Token JWT 7 | static Map cabecalhoRequisicao = linguagemServidor == 'dart' 8 | ? { 9 | "Content-type": "application/json", 10 | "Authentication": "Bearer ${ViewUtil.tokenJWT}" 11 | } 12 | : { 13 | "Content-type": "application/json", 14 | "Authorization": "Bearer ${ViewUtil.tokenJWT}" 15 | }; 16 | 17 | // ignore: prefer_final_fields 18 | static var _url = ''; 19 | get url => _url; 20 | } 21 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/services/url_base.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/utils/view_util.dart'; 2 | 3 | var _endpointApi = ViewUtil.apiHost; 4 | get endpointApi => _endpointApi; 5 | 6 | var _endpointHasura = ViewUtil.apiHasura; 7 | get endpointHasura => _endpointHasura; 8 | 9 | var _passwordHasura = ViewUtil.hasuraSecret; 10 | get passwordHasura => _passwordHasura; 11 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/shared/app_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppText extends StatelessWidget { 4 | final String text; 5 | final double fontSize; 6 | final Color color; 7 | final bool bold; 8 | 9 | // ignore: use_key_in_widget_constructors 10 | const AppText( 11 | this.text, { 12 | this.fontSize = 16, 13 | this.color = Colors.black, 14 | this.bold = false, 15 | }); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Text( 20 | text, 21 | style: TextStyle( 22 | fontSize: fontSize, 23 | color: color, 24 | fontWeight: bold ? FontWeight.bold : FontWeight.normal, 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/shared/page/web_view_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | //ignore: avoid_web_libraries_in_flutter 3 | import 'dart:html'; 4 | import 'dart:ui' as ui; 5 | 6 | class WebViewPage extends StatelessWidget { 7 | final String url; 8 | const WebViewPage({Key? key, required this.url}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | double height = MediaQuery.of(context).size.height; 13 | // ignore: undefined_prefixed_name 14 | ui.platformViewRegistry.registerViewFactory( 15 | 'hello-world-html', 16 | (int viewId) => IFrameElement() 17 | ..width = '640' 18 | ..height = '360' 19 | ..src = url 20 | ..style.border = 'none'); 21 | return Directionality( 22 | textDirection: TextDirection.ltr, 23 | child: SizedBox( 24 | width: 640, 25 | height: height, 26 | child: const HtmlElementView(viewType: 'hello-world-html'), 27 | ), 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/shared/qr_code_widget.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: must_be_immutable 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:smc/src/infra/themes.dart'; 5 | import 'package:smc/src/providers/theme_provider.dart'; 6 | import 'package:smc/src/utils/image_qr_code_memory.dart'; 7 | 8 | class QrCodeWidget extends StatelessWidget { 9 | String qrcode; 10 | QrCodeWidget({required this.qrcode, Key? key}) : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return AnimatedBuilder( 15 | animation: ThemeProvider.instance, 16 | builder: (context, child) { 17 | return Container( 18 | color: ThemeProvider.instance.isDarkTheme ? bgColor : Colors.white, 19 | height: 400, 20 | child: Card( 21 | elevation: 0, 22 | shadowColor: primaryColor, 23 | margin: const EdgeInsets.all(20), 24 | shape: OutlineInputBorder( 25 | borderRadius: BorderRadius.circular(10), 26 | borderSide: BorderSide( 27 | color: ThemeProvider.instance.isDarkTheme 28 | ? bgColor 29 | : Colors.white), 30 | ), 31 | child: Padding( 32 | padding: const EdgeInsets.all(8.0), 33 | child: Column( 34 | children: [ 35 | ImageQrCodeMemory(image: qrcode), 36 | ], 37 | ), 38 | ), 39 | ), 40 | ); 41 | }, 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/shared/required_label.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/shared/app_text.dart'; 3 | 4 | // ignore: must_be_immutable 5 | class RequiredLabel extends StatelessWidget { 6 | final String label; 7 | final bool required; 8 | Color color; 9 | 10 | // ignore: use_key_in_widget_constructors 11 | RequiredLabel(this.label, this.required, this.color); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Row( 16 | children: [ 17 | AppText( 18 | label, 19 | bold: true, 20 | color: color, 21 | ), 22 | required 23 | ? Row( 24 | children: const [ 25 | SizedBox(width: 6), 26 | AppText("*", color: Colors.red), 27 | ], 28 | ) 29 | : Container(), 30 | ], 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/shared/responsive_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ResponsiveWidget extends StatelessWidget { 4 | final Widget largeScreen; 5 | final Widget? mediumScreen; 6 | final Widget? smallScreen; 7 | 8 | const ResponsiveWidget( 9 | {Key? key, 10 | required this.largeScreen, 11 | this.mediumScreen, 12 | this.smallScreen}) 13 | : super(key: key); 14 | 15 | static bool isSmallScreen(BuildContext context) { 16 | return MediaQuery.of(context).size.width < 800; 17 | } 18 | 19 | static bool isLargeScreen(BuildContext context) { 20 | return MediaQuery.of(context).size.width > 800; 21 | } 22 | 23 | static bool isMediumScreen(BuildContext context) { 24 | return MediaQuery.of(context).size.width > 800 && 25 | MediaQuery.of(context).size.width < 1200; 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return LayoutBuilder( 31 | builder: (context, constraints) { 32 | if (constraints.maxWidth > 800) { 33 | return largeScreen; 34 | } else if (constraints.maxWidth < 1200 && constraints.maxWidth > 800) { 35 | return mediumScreen ?? largeScreen; 36 | } else { 37 | return smallScreen ?? largeScreen; 38 | } 39 | }, 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/shared/text_rich_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | // ignore: must_be_immutable 4 | class TextRichWidget extends StatelessWidget { 5 | final String title1; 6 | final String title2; 7 | final Color colorTitle1; 8 | final Color colorTitle2; 9 | final double fontsizeTitle; 10 | 11 | const TextRichWidget( 12 | {Key? key, 13 | required this.title1, 14 | required this.title2, 15 | this.colorTitle1 = Colors.white, 16 | this.colorTitle2 = Colors.white30, 17 | this.fontsizeTitle = 30}) 18 | : super(key: key); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Text.rich( 23 | TextSpan( 24 | style: TextStyle( 25 | fontSize: fontsizeTitle, 26 | ), 27 | children: [ 28 | TextSpan( 29 | text: title1, 30 | style: TextStyle( 31 | color: colorTitle1, 32 | ), 33 | ), 34 | TextSpan( 35 | text: title2, 36 | style: TextStyle( 37 | color: colorTitle2, 38 | ), 39 | ), 40 | ], 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/streams/question_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:hasura_connect/hasura_connect.dart'; 2 | import 'package:rxdart/rxdart.dart'; 3 | import 'package:smc/src/services/url_base.dart'; 4 | 5 | import '../library/bloc_pattern/bloc_pattern.dart'; 6 | import '../models/model.dart'; 7 | 8 | class QuestionBloc extends BlocBase { 9 | HasuraConnect hasuraConnect = HasuraConnect(endpointHasura, 10 | headers: {'x-hasura-admin-secret': passwordHasura}); 11 | var questionController = BehaviorSubject>(); 12 | 13 | Stream> get outl => questionController.stream; 14 | 15 | String query = ""; 16 | 17 | QuestionBloc() { 18 | getQuestionStream(); 19 | } 20 | 21 | getQuestionStream() async { 22 | query = """ 23 | subscription Question { 24 | smc_questions(order_by: {id: asc}) { 25 | id 26 | name 27 | } 28 | } 29 | """; 30 | 31 | // ignore: close_sinks 32 | Snapshot snapshot = await hasuraConnect.subscription(query); 33 | snapshot.listen((data) { 34 | questionController 35 | .add(QuestionModel.fromJsonList(data["data"]["smc_questions"])); 36 | //print('>>>>> Questions ${data["data"]["smc_questions"]}'); 37 | }).onError((err) { 38 | // ignore: avoid_print 39 | print(err); 40 | }); 41 | } 42 | 43 | @override 44 | void dispose() async { 45 | await questionController.drain(); 46 | questionController.close(); 47 | super.dispose(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/streams/setting_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:hasura_connect/hasura_connect.dart'; 2 | import 'package:rxdart/rxdart.dart'; 3 | import 'package:smc/src/services/url_base.dart'; 4 | 5 | import '../library/bloc_pattern/bloc_pattern.dart'; 6 | import '../models/model.dart'; 7 | 8 | class SettingBloc extends BlocBase { 9 | HasuraConnect hasuraConnect = HasuraConnect(endpointHasura, 10 | headers: {'x-hasura-admin-secret': passwordHasura}); 11 | var settingController = BehaviorSubject>(); 12 | 13 | Stream> get outl => settingController.stream; 14 | 15 | String query = ""; 16 | 17 | SettingBloc() { 18 | getSettingStream(); 19 | } 20 | 21 | getSettingStream() async { 22 | query = """ 23 | subscription Setting { 24 | smc_settings(order_by: {id: asc}, where: {key: {_neq: "userApiToken"}}) { 25 | id 26 | description 27 | key 28 | value 29 | content 30 | } 31 | } 32 | """; 33 | 34 | // ignore: close_sinks 35 | Snapshot snapshot = await hasuraConnect.subscription(query); 36 | snapshot.listen((data) { 37 | settingController 38 | .add(SettingModel.fromJsonList(data["data"]["smc_settings"])); 39 | //print('>>>>> Queues ${data["data"]["smc_settings"]}'); 40 | }).onError((err) { 41 | // ignore: avoid_print 42 | print(err); 43 | }); 44 | } 45 | 46 | @override 47 | void dispose() async { 48 | await settingController.drain(); 49 | settingController.close(); 50 | super.dispose(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/streams/shots_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:hasura_connect/hasura_connect.dart'; 2 | import 'package:rxdart/rxdart.dart'; 3 | import 'package:smc/src/services/url_base.dart'; 4 | 5 | import '../library/bloc_pattern/bloc_pattern.dart'; 6 | import '../models/model.dart'; 7 | 8 | class ShotsBloc extends BlocBase { 9 | HasuraConnect hasuraConnect = HasuraConnect(endpointHasura, 10 | headers: {'x-hasura-admin-secret': passwordHasura}); 11 | var shotController = BehaviorSubject>(); 12 | 13 | Stream> get outl => shotController.stream; 14 | 15 | String query = ""; 16 | 17 | ShotsBloc() { 18 | getShotStream(); 19 | } 20 | 21 | getShotStream() async { 22 | query = """ 23 | subscription Shot { 24 | smc_shots(order_by: {id: asc}) { 25 | id 26 | name 27 | datestart 28 | datefinalize 29 | start 30 | finished 31 | control 32 | alvo 33 | client 34 | } 35 | } 36 | """; 37 | 38 | // ignore: close_sinks 39 | Snapshot snapshot = await hasuraConnect.subscription(query); 40 | snapshot.listen((data) { 41 | shotController.add(ShotsModel.fromJsonList(data["data"]["smc_shots"])); 42 | //print(data["data"]["smc_shots"]); 43 | }).onError((err) { 44 | // ignore: avoid_print 45 | print(err); 46 | }); 47 | } 48 | 49 | @override 50 | void dispose() async { 51 | await shotController.drain(); 52 | shotController.close(); 53 | super.dispose(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/streams/stream.dart: -------------------------------------------------------------------------------- 1 | export 'package:smc/src/streams/whatsapp_bloc.dart'; 2 | export 'package:smc/src/streams/user_bloc.dart'; 3 | export 'package:smc/src/streams/setting_bloc.dart'; 4 | export 'package:smc/src/streams/question_bloc.dart'; 5 | export 'package:smc/src/streams/shots_bloc.dart'; 6 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/streams/user_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:hasura_connect/hasura_connect.dart'; 2 | import 'package:rxdart/rxdart.dart'; 3 | import 'package:smc/src/services/url_base.dart'; 4 | 5 | import '../library/bloc_pattern/bloc_pattern.dart'; 6 | import '../models/model.dart'; 7 | 8 | class UserBloc extends BlocBase { 9 | HasuraConnect hasuraConnect = HasuraConnect(endpointHasura, 10 | headers: {'x-hasura-admin-secret': passwordHasura}); 11 | var userController = BehaviorSubject>(); 12 | 13 | Stream> get outl => userController.stream; 14 | 15 | String query = ""; 16 | 17 | UserBloc() { 18 | getUserStream(); 19 | } 20 | 21 | getUserStream() async { 22 | query = """ 23 | subscription User { 24 | smc_users(order_by: {id: asc}) { 25 | id 26 | whatsappId 27 | name 28 | email 29 | profile 30 | device_token 31 | startwork 32 | endwork 33 | status 34 | tokenVersion 35 | web_token 36 | } 37 | } 38 | """; 39 | 40 | // ignore: close_sinks 41 | Snapshot snapshot = await hasuraConnect.subscription(query); 42 | snapshot.listen((data) { 43 | userController.add(UserModel.fromJsonList(data["data"]["smc_users"])); 44 | //print(data["data"]["smc_users"]); 45 | }).onError((err) { 46 | // ignore: avoid_print 47 | print(err); 48 | }); 49 | } 50 | 51 | @override 52 | void dispose() async { 53 | await userController.drain(); 54 | userController.close(); 55 | super.dispose(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/utils/encrypt_decrypt.dart: -------------------------------------------------------------------------------- 1 | import 'package:encrypt/encrypt.dart'; 2 | 3 | class EncryptDecrypt { 4 | final key = Key.fromUtf8('put32charactershereeeeeeeeeeeee!'); //32 chars 5 | final iv = IV.fromUtf8('put16characters!'); //16 chars 6 | 7 | //encrypt 8 | String encryptData(String text) { 9 | final e = Encrypter(AES(key, mode: AESMode.cbc)); 10 | final encryptedData = e.encrypt(text, iv: iv); 11 | return encryptedData.base64; 12 | } 13 | 14 | //dycrypt 15 | String decryptData(String text) { 16 | final e = Encrypter(AES(key, mode: AESMode.cbc)); 17 | final decryptedData = e.decrypt(Encrypted.fromBase64(text), iv: iv); 18 | return decryptedData; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/utils/funcao_date.dart: -------------------------------------------------------------------------------- 1 | import 'package:date_format/date_format.dart'; 2 | 3 | class FuncaoData { 4 | int get hojeTimeStamp { 5 | int timestamp = DateTime.now().millisecondsSinceEpoch; 6 | return timestamp; 7 | } 8 | 9 | String getHora(String data) { 10 | var dt = DateTime.parse(data); 11 | return formatDate(dt, [HH, ':', mm]); 12 | } 13 | 14 | String getData(String data) { 15 | var dt = DateTime.parse(data); 16 | return formatDate(dt, [dd, '/', mm, '/', yyyy, ' ', HH, ':', nn]); 17 | } 18 | 19 | String formataDataDDMMAAAA(data) { 20 | if (data == null) { 21 | return ""; 22 | } 23 | 24 | var datef = data.toString().split("-"); 25 | return "${datef[2]}/${datef[1]}/${datef[0]}"; 26 | } 27 | 28 | DateTime getSomaDia(DateTime data, int qtde) { 29 | var prevAno = 30 | DateTime(data.year, DateTime.now().month, DateTime.now().day + qtde); 31 | return prevAno; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/utils/image_qr_code_memory.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:convert'; 3 | import 'dart:typed_data'; 4 | 5 | // ignore: must_be_immutable 6 | class ImageQrCodeMemory extends StatelessWidget { 7 | String image; 8 | ImageQrCodeMemory({required this.image, Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | //var img = image.substring(22, image.length); 13 | return getImagenBase64(image); 14 | } 15 | 16 | getImagenBase64(String imagen) { 17 | var imageBase64 = imagen; 18 | const Base64Codec base64 = Base64Codec(); 19 | if (imageBase64.isEmpty) return Container(); 20 | Uint8List bytes = base64.decode(imageBase64); 21 | return Image.memory( 22 | bytes, 23 | width: 228, 24 | height: 228, 25 | fit: BoxFit.fitWidth, 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/utils/notification_fush.dart: -------------------------------------------------------------------------------- 1 | import 'package:another_flushbar/flushbar.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | 5 | class NotificationFush { 6 | BuildContext context; 7 | String message; 8 | String title; 9 | FlushbarPosition flushbarPosition; 10 | Duration duration; 11 | IconData icon; 12 | double sizeIcon; 13 | Color indicatorColor; 14 | LinearGradient gradient; 15 | Color backgroundColor; 16 | Color colorShadow; 17 | 18 | NotificationFush( 19 | {required this.context, 20 | required this.message, 21 | this.title = "smc", 22 | this.flushbarPosition = FlushbarPosition.TOP, 23 | this.duration = const Duration(seconds: 6), 24 | this.icon = FontAwesomeIcons.info, 25 | this.sizeIcon = 28, 26 | this.indicatorColor = Colors.white, 27 | this.gradient = 28 | const LinearGradient(colors: [Colors.green, Colors.greenAccent]), 29 | this.backgroundColor = Colors.green, 30 | this.colorShadow = const Color.fromARGB(255, 46, 125, 50)}); 31 | 32 | bar() { 33 | return Flushbar( 34 | flushbarPosition: flushbarPosition, 35 | reverseAnimationCurve: Curves.decelerate, 36 | leftBarIndicatorColor: indicatorColor, 37 | title: title, 38 | message: message, 39 | icon: Icon( 40 | icon, 41 | size: sizeIcon, 42 | color: Colors.white, 43 | ), 44 | duration: duration, 45 | backgroundGradient: gradient, 46 | backgroundColor: backgroundColor, 47 | boxShadows: [ 48 | BoxShadow( 49 | color: colorShadow, 50 | offset: const Offset(0.0, 2.0), 51 | blurRadius: 3.0, 52 | ) 53 | ], 54 | )..show(context); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/utils/responsive_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ResponsiveWidget extends StatelessWidget { 4 | final Widget largeScreen; 5 | final Widget? mediumScreen; 6 | final Widget? smallScreen; 7 | 8 | const ResponsiveWidget( 9 | {Key? key, 10 | required this.largeScreen, 11 | this.mediumScreen, 12 | this.smallScreen}) 13 | : super(key: key); 14 | 15 | static bool isSmallScreen(BuildContext context) { 16 | return MediaQuery.of(context).size.width < 800; 17 | } 18 | 19 | static bool isLargeScreen(BuildContext context) { 20 | return MediaQuery.of(context).size.width > 800; 21 | } 22 | 23 | static bool isMediumScreen(BuildContext context) { 24 | return MediaQuery.of(context).size.width > 800 && 25 | MediaQuery.of(context).size.width < 1200; 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return LayoutBuilder( 31 | builder: (context, constraints) { 32 | if (constraints.maxWidth > 800) { 33 | return largeScreen; 34 | } else if (constraints.maxWidth < 1200 && constraints.maxWidth > 800) { 35 | return mediumScreen ?? largeScreen; 36 | } else { 37 | return smallScreen ?? largeScreen; 38 | } 39 | }, 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/utils/seta_qtde_conection.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/providers/theme_provider.dart'; 2 | 3 | class SetaQtdeConection { 4 | setar(int qtde) { 5 | ThemeProvider.instance.setaWhatsDesconect(qtde); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/view_model/conection_view_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/infra/locator.dart'; 3 | 4 | import '../models/model.dart'; 5 | import '../services/service.dart'; 6 | 7 | class ConectionViewModel extends ChangeNotifier { 8 | final ConectionService _conectionService = locator(); 9 | 10 | ConectionViewModel(); 11 | 12 | Future inserir(WhatsappModel obj) async { 13 | var result = await _conectionService.inserir(obj); 14 | 15 | notifyListeners(); 16 | return result; 17 | } 18 | 19 | Future alterar(WhatsappModel obj) async { 20 | var result = await _conectionService.alterar(obj); 21 | 22 | notifyListeners(); 23 | return result; 24 | } 25 | 26 | Future excluir(int id) async { 27 | var result = await _conectionService.excluir(id); 28 | if (result == false) { 29 | notifyListeners(); 30 | } 31 | return result; 32 | } 33 | 34 | start(String session, bool padrao) async { 35 | await _conectionService.start(session, padrao); 36 | } 37 | 38 | close(String session, bool padrao) async { 39 | await _conectionService.close(session, padrao); 40 | } 41 | 42 | logout(String session, bool padrao) async { 43 | await _conectionService.logout(session, padrao); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/view_model/login_view_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:smc/src/infra/locator.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:smc/src/services/api/login_service.dart'; 4 | 5 | class LoginViewModel extends ChangeNotifier { 6 | final LoginService _loginService = locator(); 7 | 8 | Future autenticar(String login, String senha) async { 9 | var result = await _loginService.autenticar(login, senha); 10 | 11 | notifyListeners(); 12 | return result; 13 | } 14 | 15 | Future updatePassword(String email, String codigo) async { 16 | bool ret = false; 17 | var result = await _loginService.updatePassword(email, codigo); 18 | 19 | if (result == "true") { 20 | ret = true; 21 | } 22 | 23 | notifyListeners(); 24 | return ret; 25 | } 26 | 27 | Future urlHost() async { 28 | await _loginService.urlHost(); 29 | 30 | notifyListeners(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/view_model/question_view_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/infra/locator.dart'; 3 | 4 | import '../models/model.dart'; 5 | import '../services/service.dart'; 6 | 7 | class QuestionViewModel extends ChangeNotifier { 8 | final QuestionService _questionService = locator(); 9 | 10 | QuestionViewModel(); 11 | 12 | Future inserir(QuestionModel obj) async { 13 | var result = await _questionService.inserir(obj); 14 | 15 | notifyListeners(); 16 | return result; 17 | } 18 | 19 | Future alterar(QuestionModel obj) async { 20 | var result = await _questionService.alterar(obj); 21 | 22 | notifyListeners(); 23 | return result; 24 | } 25 | 26 | Future excluir(int id) async { 27 | var result = await _questionService.excluir(id); 28 | if (result == false) { 29 | notifyListeners(); 30 | } 31 | return result; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/view_model/setting_view_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/infra/locator.dart'; 3 | 4 | import '../models/model.dart'; 5 | import '../services/service.dart'; 6 | 7 | class SettingViewModel extends ChangeNotifier { 8 | final SettingService _settingService = locator(); 9 | 10 | SettingViewModel(); 11 | 12 | Future inserir(SettingModel obj) async { 13 | var result = await _settingService.inserir(obj); 14 | 15 | notifyListeners(); 16 | return result; 17 | } 18 | 19 | Future alterar(SettingModel obj) async { 20 | var result = await _settingService.alterar(obj); 21 | 22 | notifyListeners(); 23 | return result; 24 | } 25 | 26 | Future excluir(int id) async { 27 | var result = await _settingService.excluir(id); 28 | if (result == false) { 29 | notifyListeners(); 30 | } 31 | return result; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/view_model/shots_view_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/infra/locator.dart'; 3 | 4 | import '../models/model.dart'; 5 | import '../services/service.dart'; 6 | 7 | class ShotsViewModel extends ChangeNotifier { 8 | final ShotsService _userService = locator(); 9 | 10 | ShotsViewModel(); 11 | 12 | Future inserir(ShotsModel obj) async { 13 | var result = await _userService.inserir(obj); 14 | 15 | notifyListeners(); 16 | return result; 17 | } 18 | 19 | Future alterar(ShotsModel obj) async { 20 | var result = await _userService.alterar(obj); 21 | 22 | notifyListeners(); 23 | return result; 24 | } 25 | 26 | Future start(int id) async { 27 | var result = await _userService.start(id); 28 | if (result == false) { 29 | notifyListeners(); 30 | } 31 | return result; 32 | } 33 | 34 | Future pause(int id) async { 35 | var result = await _userService.pause(id); 36 | if (result == false) { 37 | notifyListeners(); 38 | } 39 | return result; 40 | } 41 | 42 | Future excluir(int id) async { 43 | var result = await _userService.excluir(id); 44 | if (result == false) { 45 | notifyListeners(); 46 | } 47 | return result; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/view_model/user_view_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smc/src/infra/locator.dart'; 3 | 4 | import '../models/model.dart'; 5 | import '../services/service.dart'; 6 | 7 | class UserViewModel extends ChangeNotifier { 8 | final UserService _userService = locator(); 9 | 10 | UserViewModel(); 11 | 12 | Future inserir(UserModel obj) async { 13 | var result = await _userService.inserir(obj); 14 | 15 | notifyListeners(); 16 | return result; 17 | } 18 | 19 | Future alterar(UserModel obj) async { 20 | var result = await _userService.alterar(obj); 21 | 22 | notifyListeners(); 23 | return result; 24 | } 25 | 26 | Future excluir(int id) async { 27 | var result = await _userService.excluir(id); 28 | if (result == false) { 29 | notifyListeners(); 30 | } 31 | return result; 32 | } 33 | 34 | Future updatePassword(String email, String codigo) async { 35 | bool ret = false; 36 | var result = await _userService.updatePassword(email, codigo); 37 | 38 | if (result == "true") { 39 | ret = true; 40 | } 41 | 42 | notifyListeners(); 43 | return ret; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /frontend-smc/lib/src/view_model/view_model.dart: -------------------------------------------------------------------------------- 1 | export 'package:smc/src/view_model/login_view_model.dart'; 2 | export 'package:smc/src/view_model/user_view_model.dart'; 3 | export 'package:smc/src/view_model/setting_view_model.dart'; 4 | export 'package:smc/src/view_model/conection_view_model.dart'; 5 | export 'package:smc/src/view_model/question_view_model.dart'; 6 | export 'package:smc/src/view_model/shots_view_model.dart'; 7 | -------------------------------------------------------------------------------- /frontend-smc/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 in the flutter_test package. 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:smc/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(const 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 | -------------------------------------------------------------------------------- /frontend-smc/web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/favicon.ico -------------------------------------------------------------------------------- /frontend-smc/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/Icon-192.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/Icon-512.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/android-icon-144x144.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/android-icon-192x192.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/android-icon-36x36.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/android-icon-48x48.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/android-icon-72x72.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/android-icon-96x96.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon-114x114.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon-120x120.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon-144x144.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon-152x152.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon-180x180.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon-57x57.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon-60x60.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon-72x72.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon-76x76.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon-precomposed.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/apple-icon.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/favicon-16x16.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/favicon-32x32.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/favicon-96x96.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/favicon.ico -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "\/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "\/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "\/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "\/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "\/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image\/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "\/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image\/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/ms-icon-144x144.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/ms-icon-150x150.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/ms-icon-310x310.png -------------------------------------------------------------------------------- /frontend-smc/web/icons/ico/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/frontend-smc/web/icons/ico/ms-icon-70x70.png -------------------------------------------------------------------------------- /frontend-smc/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SMC", 3 | "short_name": "SMC", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "Sistema Maturacao de Chip", 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 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /resources/dart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/resources/dart.png -------------------------------------------------------------------------------- /resources/donate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/resources/donate.png -------------------------------------------------------------------------------- /resources/flutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/resources/flutter.png -------------------------------------------------------------------------------- /resources/laravel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/resources/laravel.png -------------------------------------------------------------------------------- /resources/smc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/resources/smc.png -------------------------------------------------------------------------------- /resources/tela1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/resources/tela1.png -------------------------------------------------------------------------------- /resources/tela2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/resources/tela2.png -------------------------------------------------------------------------------- /resources/tela3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/resources/tela3.png -------------------------------------------------------------------------------- /resources/tela4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emaworkdev/projeto-smc/d77de73a703217df35b116f0f2f39fe675cc865a/resources/tela4.png -------------------------------------------------------------------------------- /server-smc-dart/.dockerignore: -------------------------------------------------------------------------------- 1 | .dockerignore 2 | Dockerfile 3 | build/ 4 | .dart_tool/ 5 | .git/ 6 | .github/ 7 | .gitignore 8 | .idea/ 9 | .packages 10 | -------------------------------------------------------------------------------- /server-smc-dart/.env.example: -------------------------------------------------------------------------------- 1 | port=8080 2 | 3 | secretKey = "secret" # secret key do arquivo config.json do wpp-connect-serve 4 | wppConnectHost="http://ip:porta/api" 5 | urlWebhookAlvo="http://ip:porta/webhooks/" 6 | urlWebhookClient="http://ip:porta/webhooks/secunds" 7 | 8 | hasuraHost="http://ip:porta/v1/graphql" 9 | hasuraPassword="senha" 10 | 11 | 12 | urlFrontEnd=" ou * para local" 13 | 14 | jwt_secret=S49GxqJ2iYVGyxNwsYo04sftxTuPH8QDPcDFStE47G3zTzU0Bc 15 | -------------------------------------------------------------------------------- /server-smc-dart/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub. 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build output. 6 | build/ 7 | 8 | certificates/ 9 | 10 | .env 11 | 12 | info.txt 13 | 14 | -------------------------------------------------------------------------------- /server-smc-dart/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use o IntelliSense para saber mais sobre os atributos possíveis. 3 | // Focalizar para exibir as descrições dos atributos existentes. 4 | // Para obter mais informações, acesse: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "server_geocode", 9 | "request": "launch", 10 | "type": "dart", 11 | "program": "${workspaceFolder}/bin/server.dart" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /server-smc-dart/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "dart.sdkPath": "C:/Users/datasae/fvm/default/bin/cache/dart-sdk" 3 | } -------------------------------------------------------------------------------- /server-smc-dart/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version. 4 | -------------------------------------------------------------------------------- /server-smc-dart/Dockerfile: -------------------------------------------------------------------------------- 1 | # Use latest stable channel SDK. 2 | FROM dart:stable AS build 3 | 4 | # Resolve app dependencies. 5 | WORKDIR /app 6 | COPY pubspec.* ./ 7 | RUN dart pub get 8 | 9 | # Copy app source code (except anything in .dockerignore) and AOT compile app. 10 | COPY . . 11 | RUN dart compile exe bin/server.dart -o bin/server 12 | 13 | # Build minimal serving image from AOT-compiled `/server` 14 | # and the pre-built AOT-runtime in the `/runtime/` directory of the base image. 15 | FROM scratch 16 | COPY --from=build /runtime/ / 17 | COPY --from=build /app/bin/server /app/bin/ 18 | 19 | # Start server. 20 | EXPOSE 8080 21 | CMD ["/app/bin/server"] 22 | -------------------------------------------------------------------------------- /server-smc-dart/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the static analysis results for your project (errors, 2 | # warnings, and lints). 3 | # 4 | # This enables the 'recommended' set of lints from `package:lints`. 5 | # This set helps identify many issues that may lead to problems when running 6 | # or consuming Dart code, and enforces writing Dart using a single, idiomatic 7 | # style and format. 8 | # 9 | # If you want a smaller set of lints you can change this to specify 10 | # 'package:lints/core.yaml'. These are just the most critical lints 11 | # (the recommended set includes the core lints). 12 | # The core lints are also what is used by pub.dev for scoring packages. 13 | 14 | include: package:lints/recommended.yaml 15 | 16 | # Uncomment the following section to specify additional rules. 17 | 18 | # linter: 19 | # rules: 20 | # - camel_case_types 21 | 22 | # analyzer: 23 | # exclude: 24 | # - path/to/excluded/files/** 25 | 26 | # For more information about the core and recommended set of lints, see 27 | # https://dart.dev/go/core-lints 28 | 29 | # For additional information about configuring this file, see 30 | # https://dart.dev/guides/language/analysis-options 31 | -------------------------------------------------------------------------------- /server-smc-dart/images/img.txt: -------------------------------------------------------------------------------- 1 | -- 2 | -------------------------------------------------------------------------------- /server-smc-dart/lib/application/config/application_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:dotenv/dotenv.dart' show load; 2 | 3 | class ApplicationConfig { 4 | Future loadConfigApplication() async { 5 | await _loadEnv(); 6 | } 7 | 8 | Future _loadEnv() async => load(); 9 | } 10 | -------------------------------------------------------------------------------- /server-smc-dart/lib/core/exceptions/email_already_registered.dart: -------------------------------------------------------------------------------- 1 | class EmailAlreadyRegistered implements Exception { 2 | 3 | } -------------------------------------------------------------------------------- /server-smc-dart/lib/core/exceptions/user_notfound_exception.dart: -------------------------------------------------------------------------------- 1 | class UserNotfoundException implements Exception { 2 | 3 | } -------------------------------------------------------------------------------- /server-smc-dart/lib/core/helpers/cripty_helper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | // ignore: depend_on_referenced_packages 3 | import 'package:crypto/crypto.dart'; 4 | 5 | class CriptyHelper { 6 | CriptyHelper._(); 7 | 8 | static String generatedSha256Hash(String password) { 9 | final bytes = utf8.encode(password); 10 | return sha256.convert(bytes).toString(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /server-smc-dart/lib/core/helpers/jwt_helper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | // ignore: depend_on_referenced_packages 3 | import 'package:crypto/crypto.dart'; 4 | import 'package:jaguar_jwt/jaguar_jwt.dart'; 5 | import 'package:dotenv/dotenv.dart'; 6 | 7 | class JwtHelper { 8 | static final String _jwtPrivateKey = env['jwt_secret']!; 9 | 10 | JwtHelper._(); 11 | 12 | static String generateJWT(int usuarioId, dynamic supplierId, String? name) { 13 | var sign = supplierId ?? '0'; 14 | 15 | final claimSet = JwtClaim( 16 | issuer: "smc", 17 | subject: usuarioId.toString(), 18 | expiry: DateTime.now().add(const Duration(days: 1)), 19 | notBefore: DateTime.now(), 20 | issuedAt: DateTime.now(), 21 | otherClaims: {'supplierId': sign, 'name': name}, 22 | maxAge: const Duration(days: 1), 23 | ); 24 | 25 | final token = issueJwtHS256(claimSet, _jwtPrivateKey); 26 | 27 | return token; 28 | } 29 | 30 | static String refreshToken(String accessToken) { 31 | final claimSet = JwtClaim( 32 | issuer: accessToken, 33 | subject: 'RefreshToken', 34 | expiry: DateTime.now().add(const Duration(days: 365)), 35 | notBefore: DateTime.now().subtract(const Duration(days: 1)), 36 | issuedAt: DateTime.now(), 37 | otherClaims: {}, 38 | ); 39 | 40 | final token = issueJwtHS256(claimSet, _jwtPrivateKey); 41 | 42 | return token; 43 | } 44 | 45 | static String generateSHA256Hash(String pass) { 46 | final bytes = utf8.encode(pass); 47 | final password = sha256.convert(bytes).toString(); 48 | return password; 49 | } 50 | 51 | static JwtClaim getClaims(String token) { 52 | return verifyJwtHS256Signature(token, _jwtPrivateKey); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /server-smc-dart/lib/core/middlewares/cors/cors_middleware.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:server_smc/core/middlewares/middlewares.dart'; 4 | import 'package:shelf/shelf.dart'; 5 | import 'package:dotenv/dotenv.dart'; 6 | 7 | class CorsMiddleware extends Middewares { 8 | final Map headers = { 9 | 'Access-Control-Allow-Origin': '${getOrigins()}', 10 | 'Access-Control-Allow-Methods': 'GET, POST, PUT, PATCH, DELETE, OPTIONS', 11 | 'Access-Control-Allow-Headers': 12 | '${HttpHeaders.contentTypeHeader}, ${HttpHeaders.authorizationHeader}' 13 | }; 14 | 15 | @override 16 | Future execute(Request request) async { 17 | if (request.method == 'OPTIONS') { 18 | return Response(HttpStatus.ok, headers: headers); 19 | } 20 | final response = await innerHandler(request); 21 | 22 | return response.change(headers: headers); 23 | } 24 | } 25 | 26 | getOrigins() { 27 | return env['urlFrontEnd']!; 28 | } 29 | -------------------------------------------------------------------------------- /server-smc-dart/lib/core/middlewares/default/default_content_type_middleware.dart: -------------------------------------------------------------------------------- 1 | import 'package:server_smc/core/middlewares/middlewares.dart'; 2 | import 'package:shelf/shelf.dart'; 3 | 4 | class DefaultContentTypeMiddleware extends Middewares { 5 | final String contentType; 6 | 7 | DefaultContentTypeMiddleware(this.contentType); 8 | 9 | @override 10 | Future execute(Request request) async { 11 | final response = await innerHandler(request); 12 | return response.change(headers: {'content-type': contentType}); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /server-smc-dart/lib/core/middlewares/middlewares.dart: -------------------------------------------------------------------------------- 1 | import 'package:shelf/shelf.dart'; 2 | 3 | abstract class Middewares { 4 | late Handler innerHandler; 5 | 6 | Handler handler(Handler innerHanler) { 7 | innerHandler = innerHanler; 8 | return execute; 9 | } 10 | 11 | Future execute(Request request); 12 | } 13 | -------------------------------------------------------------------------------- /server-smc-dart/lib/core/middlewares/security/security_skip_url.dart: -------------------------------------------------------------------------------- 1 | class SecuritySkipUrl { 2 | String url; 3 | String method; 4 | 5 | SecuritySkipUrl({ 6 | required this.url, 7 | required this.method, 8 | }); 9 | 10 | @override 11 | bool operator ==(Object other) { 12 | if (identical(this, other)) return true; 13 | 14 | return other is SecuritySkipUrl && 15 | other.url == url && 16 | other.method == method; 17 | } 18 | 19 | @override 20 | int get hashCode => url.hashCode ^ method.hashCode; 21 | } 22 | -------------------------------------------------------------------------------- /server-smc-dart/lib/models/question_model.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_renaming_method_parameters, non_constant_identifier_names 2 | 3 | import 'dart:convert'; 4 | 5 | class QuestionModel { 6 | dynamic id; 7 | dynamic name; 8 | 9 | QuestionModel({ 10 | this.id, 11 | this.name, 12 | }); 13 | 14 | QuestionModel copyWith({ 15 | dynamic id, 16 | dynamic tenantId, 17 | dynamic name, 18 | }) { 19 | return QuestionModel( 20 | id: id ?? this.id, 21 | name: name, 22 | ); 23 | } 24 | 25 | Map toMap() { 26 | return { 27 | 'id': id, 28 | 'name': name, 29 | }; 30 | } 31 | 32 | factory QuestionModel.fromMap(Map map) { 33 | return QuestionModel( 34 | id: map['id'], 35 | name: map['name'], 36 | ); 37 | } 38 | 39 | @override 40 | String toString() => 'QuestionModel(id: $id, ame: $name)'; 41 | 42 | String toJson() => json.encode(toMap()); 43 | 44 | factory QuestionModel.fromJson(String source) => 45 | QuestionModel.fromMap(json.decode(source)); 46 | 47 | static List fromJsonList(List list) { 48 | return list 49 | .map((item) => QuestionModel.fromMap(item)) 50 | .toList(); 51 | } 52 | 53 | @override 54 | bool operator ==(Object o) { 55 | if (identical(this, o)) return true; 56 | 57 | return o is QuestionModel && o.id == id && o.name == name; 58 | } 59 | 60 | @override 61 | int get hashCode => id.hashCode ^ name.hashCode; 62 | } 63 | -------------------------------------------------------------------------------- /server-smc-dart/lib/modules/auth/auth_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'auth_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // ShelfRouterGenerator 7 | // ************************************************************************** 8 | 9 | Router _$AuthControllerRouter(AuthController service) { 10 | final router = Router(); 11 | router.add( 12 | 'POST', 13 | r'/', 14 | service.login, 15 | ); 16 | router.add( 17 | 'POST', 18 | r'/register', 19 | service.register, 20 | ); 21 | router.add( 22 | 'POST', 23 | r'/update/password', 24 | service.updatePassword, 25 | ); 26 | router.add( 27 | 'POST', 28 | r'/url', 29 | service.url, 30 | ); 31 | return router; 32 | } 33 | -------------------------------------------------------------------------------- /server-smc-dart/lib/modules/question/question_controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:server_smc/models/question_model.dart'; 4 | import 'package:server_smc/repositories/question_repository.dart'; 5 | import 'package:shelf/shelf.dart'; 6 | import 'package:shelf_router/shelf_router.dart'; 7 | 8 | part 'question_controller.g.dart'; 9 | 10 | class QuestionController { 11 | final _questionRepository = QuestionRepository(); 12 | 13 | @Route.post('/') 14 | Future created(Request request) async { 15 | try { 16 | String id = '0'; 17 | final obj = QuestionModel.fromJson(await request.readAsString()); 18 | 19 | id = await _questionRepository.save(obj); 20 | 21 | return Response(200, 22 | body: jsonEncode( 23 | {'id': id, 'result': 'success'}, 24 | ), 25 | headers: { 26 | 'content-type': 'application/json', 27 | }); 28 | } catch (e, s) { 29 | print(e); 30 | print(s); 31 | return Response.internalServerError( 32 | body: {'result': 'erro interno no servidor'}, 33 | ); 34 | } 35 | } 36 | 37 | @Route.delete('/') 38 | Future delete(Request request) async { 39 | try { 40 | final jsonRQ = jsonDecode(await request.readAsString()); 41 | 42 | await _questionRepository.delete(jsonRQ['id']); 43 | 44 | return Response(204, headers: { 45 | 'content-type': 'application/json', 46 | }); 47 | } catch (e, s) { 48 | print(e); 49 | print(s); 50 | return Response.internalServerError( 51 | body: {'result': 'erro interno no servidor'}, 52 | ); 53 | } 54 | } 55 | 56 | Router get router => _$QuestionControllerRouter(this); 57 | } 58 | -------------------------------------------------------------------------------- /server-smc-dart/lib/modules/question/question_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'question_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // ShelfRouterGenerator 7 | // ************************************************************************** 8 | 9 | Router _$QuestionControllerRouter(QuestionController service) { 10 | final router = Router(); 11 | router.add( 12 | 'POST', 13 | r'/', 14 | service.created, 15 | ); 16 | router.add( 17 | 'DELETE', 18 | r'/', 19 | service.delete, 20 | ); 21 | return router; 22 | } 23 | -------------------------------------------------------------------------------- /server-smc-dart/lib/modules/setting/setting_controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:server_smc/models/settings_model.dart'; 4 | import 'package:server_smc/repositories/setting_repository.dart'; 5 | import 'package:shelf/shelf.dart'; 6 | import 'package:shelf_router/shelf_router.dart'; 7 | 8 | part 'setting_controller.g.dart'; 9 | 10 | class SettingController { 11 | final _settingRepository = SettingRepository(); 12 | 13 | @Route.post('/') 14 | Future created(Request request) async { 15 | try { 16 | String id = '0'; 17 | final obj = SettingsModel.fromJson(await request.readAsString()); 18 | 19 | id = await _settingRepository.save(obj); 20 | 21 | return Response(200, 22 | body: jsonEncode( 23 | {'id': id, 'result': 'success'}, 24 | ), 25 | headers: { 26 | 'content-type': 'application/json', 27 | }); 28 | } catch (e, s) { 29 | print(e); 30 | print(s); 31 | return Response.internalServerError( 32 | body: {'result': 'erro interno no servidor'}, 33 | ); 34 | } 35 | } 36 | 37 | @Route.delete('/') 38 | Future delete(Request request) async { 39 | try { 40 | final jsonRQ = jsonDecode(await request.readAsString()); 41 | 42 | await _settingRepository.delete(jsonRQ['id']); 43 | 44 | return Response(204, headers: { 45 | 'content-type': 'application/json', 46 | }); 47 | } catch (e, s) { 48 | print(e); 49 | print(s); 50 | return Response.internalServerError( 51 | body: {'result': 'erro interno no servidor'}, 52 | ); 53 | } 54 | } 55 | 56 | Router get router => _$SettingControllerRouter(this); 57 | } 58 | -------------------------------------------------------------------------------- /server-smc-dart/lib/modules/setting/setting_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'setting_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // ShelfRouterGenerator 7 | // ************************************************************************** 8 | 9 | Router _$SettingControllerRouter(SettingController service) { 10 | final router = Router(); 11 | router.add( 12 | 'POST', 13 | r'/', 14 | service.created, 15 | ); 16 | router.add( 17 | 'DELETE', 18 | r'/', 19 | service.delete, 20 | ); 21 | return router; 22 | } 23 | -------------------------------------------------------------------------------- /server-smc-dart/lib/modules/shot/shots_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'shots_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // ShelfRouterGenerator 7 | // ************************************************************************** 8 | 9 | Router _$ShotsControllerRouter(ShotsController service) { 10 | final router = Router(); 11 | router.add( 12 | 'POST', 13 | r'/', 14 | service.created, 15 | ); 16 | router.add( 17 | 'POST', 18 | r'/start', 19 | service.start, 20 | ); 21 | router.add( 22 | 'POST', 23 | r'/pause', 24 | service.pause, 25 | ); 26 | router.add( 27 | 'DELETE', 28 | r'/', 29 | service.delete, 30 | ); 31 | return router; 32 | } 33 | -------------------------------------------------------------------------------- /server-smc-dart/lib/modules/user/user_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'user_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // ShelfRouterGenerator 7 | // ************************************************************************** 8 | 9 | Router _$UserControllerRouter(UserController service) { 10 | final router = Router(); 11 | router.add( 12 | 'POST', 13 | r'/', 14 | service.created, 15 | ); 16 | router.add( 17 | 'DELETE', 18 | r'/', 19 | service.delete, 20 | ); 21 | return router; 22 | } 23 | -------------------------------------------------------------------------------- /server-smc-dart/lib/modules/webhook/web_hook_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'web_hook_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // ShelfRouterGenerator 7 | // ************************************************************************** 8 | 9 | Router _$WebHookControllerRouter(WebHookController service) { 10 | final router = Router(); 11 | router.add( 12 | 'POST', 13 | r'/', 14 | service.webkook, 15 | ); 16 | router.add( 17 | 'POST', 18 | r'/secunds', 19 | service.webkookBayleys, 20 | ); 21 | return router; 22 | } 23 | -------------------------------------------------------------------------------- /server-smc-dart/lib/modules/whatsapp/whatsapp_controller.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'whatsapp_controller.dart'; 4 | 5 | // ************************************************************************** 6 | // ShelfRouterGenerator 7 | // ************************************************************************** 8 | 9 | Router _$WhatsappControllerRouter(WhatsappController service) { 10 | final router = Router(); 11 | router.add( 12 | 'POST', 13 | r'/', 14 | service.created, 15 | ); 16 | router.add( 17 | 'DELETE', 18 | r'/', 19 | service.delete, 20 | ); 21 | router.add( 22 | 'POST', 23 | r'/start', 24 | service.start, 25 | ); 26 | router.add( 27 | 'POST', 28 | r'/close', 29 | service.close, 30 | ); 31 | router.add( 32 | 'POST', 33 | r'/logout', 34 | service.logout, 35 | ); 36 | return router; 37 | } 38 | -------------------------------------------------------------------------------- /server-smc-dart/lib/repositories/question_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:server_smc/models/question_model.dart'; 2 | import 'package:server_smc/services/question_hasura_service.dart'; 3 | 4 | class QuestionRepository { 5 | var hasuraUser = QuestionHasuraService(); 6 | 7 | Future save(QuestionModel obj) async { 8 | var ret = '0'; 9 | try { 10 | if (obj.id != 0) { 11 | ret = await hasuraUser.update(obj); 12 | } else { 13 | ret = await hasuraUser.create(obj); 14 | } 15 | } catch (e, s) { 16 | print(e); 17 | print(s); 18 | } 19 | return ret; 20 | } 21 | 22 | delete(int id) async { 23 | try { 24 | await hasuraUser.delete(id); 25 | } catch (e, s) { 26 | print(e); 27 | print(s); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server-smc-dart/lib/repositories/setting_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:server_smc/models/settings_model.dart'; 2 | import 'package:server_smc/services/setting_hasura_service.dart'; 3 | 4 | class SettingRepository { 5 | var hasuraUser = SettingHasuraService(); 6 | 7 | Future save(SettingsModel obj) async { 8 | var ret = '0'; 9 | try { 10 | if (obj.id != 0) { 11 | ret = await hasuraUser.update(obj); 12 | } else { 13 | ret = await hasuraUser.create(obj); 14 | } 15 | } catch (e, s) { 16 | print(e); 17 | print(s); 18 | } 19 | return ret; 20 | } 21 | 22 | delete(int id) async { 23 | try { 24 | await hasuraUser.delete(id); 25 | } catch (e, s) { 26 | print(e); 27 | print(s); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server-smc-dart/lib/repositories/shots_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:server_smc/models/shots_model.dart'; 2 | import 'package:server_smc/services/shots_hasura_service.dart'; 3 | 4 | class ShotsRepository { 5 | var hasura = ShotsHasuraService(); 6 | 7 | Future save(ShotsModel obj) async { 8 | var ret = '0'; 9 | try { 10 | if (obj.id != 0) { 11 | ret = await hasura.update(obj); 12 | } else { 13 | ret = await hasura.create(obj); 14 | } 15 | } catch (e, s) { 16 | print(e); 17 | print(s); 18 | } 19 | return ret; 20 | } 21 | 22 | start(int id) async { 23 | try { 24 | await hasura.start(id); 25 | } catch (e, s) { 26 | print(e); 27 | print(s); 28 | } 29 | } 30 | 31 | pause(int id) async { 32 | try { 33 | await hasura.pause(id); 34 | } catch (e, s) { 35 | print(e); 36 | print(s); 37 | } 38 | } 39 | 40 | delete(int id) async { 41 | try { 42 | await hasura.delete(id); 43 | } catch (e, s) { 44 | print(e); 45 | print(s); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /server-smc-dart/lib/repositories/user_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:server_smc/core/helpers/cripty_helper.dart'; 2 | import 'package:server_smc/models/user_model.dart'; 3 | import 'package:server_smc/services/user_hasura_service.dart'; 4 | 5 | class UserRepository { 6 | var hasuraUser = UserHasuraService(); 7 | Future login(String email, String password) async { 8 | UserModel user = UserModel(); 9 | try { 10 | var reth = await hasuraUser.existe(email); 11 | if (reth) { 12 | user = await hasuraUser.login(email, password); 13 | } 14 | } catch (e, s) { 15 | print(e); 16 | print(s); 17 | } 18 | return user; 19 | } 20 | 21 | Future save(UserModel obj) async { 22 | var ret = '0'; 23 | try { 24 | var reth = await hasuraUser.existe(obj.email!); 25 | if (reth) { 26 | ret = await hasuraUser.update(obj); 27 | } else { 28 | ret = await hasuraUser.create(obj); 29 | } 30 | } catch (e, s) { 31 | print(e); 32 | print(s); 33 | } 34 | return ret; 35 | } 36 | 37 | delete(int id) async { 38 | try { 39 | await hasuraUser.delete(id); 40 | } catch (e, s) { 41 | print(e); 42 | print(s); 43 | } 44 | } 45 | 46 | register(UserModel obj) async { 47 | try { 48 | await hasuraUser.create(obj); 49 | } catch (e, s) { 50 | print(e); 51 | print(s); 52 | } 53 | } 54 | 55 | Future updatePassword(String email, String password) async { 56 | var ret = false; 57 | try { 58 | var pass = CriptyHelper.generatedSha256Hash(password); 59 | var rt = await hasuraUser.updatePassword(email, pass); 60 | if (rt != '0') { 61 | ret = true; 62 | } 63 | } catch (e, s) { 64 | print(e); 65 | print(s); 66 | } 67 | return ret; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /server-smc-dart/lib/uteis/constantes.dart: -------------------------------------------------------------------------------- 1 | class Constantes { 2 | /// singleton 3 | factory Constantes() { 4 | _this ??= Constantes._(); 5 | return _this!; 6 | } 7 | static Constantes? _this; 8 | Constantes._() : super(); 9 | 10 | static String apiToken = ''; 11 | static String apiTokenClient = ''; 12 | } 13 | -------------------------------------------------------------------------------- /server-smc-dart/lib/uteis/encrypt_decrypt.dart: -------------------------------------------------------------------------------- 1 | import 'package:encrypt/encrypt.dart'; 2 | 3 | class EncryptDecrypt { 4 | final key = Key.fromUtf8('put32charactershereeeeeeeeeeeee!'); //32 chars 5 | final iv = IV.fromUtf8('put16characters!'); //16 chars 6 | 7 | //encrypt 8 | String encryptData(String text) { 9 | final e = Encrypter(AES(key, mode: AESMode.cbc)); 10 | final encryptedData = e.encrypt(text, iv: iv); 11 | return encryptedData.base64; 12 | } 13 | 14 | //dycrypt 15 | String decryptData(String text) { 16 | final e = Encrypter(AES(key, mode: AESMode.cbc)); 17 | final decryptedData = e.decrypt(Encrypted.fromBase64(text), iv: iv); 18 | return decryptedData; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /server-smc-dart/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: server_smc 2 | description: Servidor SMC. 3 | version: 1.0.0 4 | # homepage: https://www.localhost.com 5 | 6 | environment: 7 | sdk: '>=2.17.0 <3.0.0' 8 | 9 | dependencies: 10 | args: ^2.0.0 11 | shelf: ^1.1.0 12 | shelf_router: ^1.0.0 13 | dotenv: ^3.0.0 14 | shelf_static: ^1.1.0 15 | intl: ^0.17.0 16 | date_format: ^2.0.7 17 | jaguar_jwt: ^3.0.0 18 | get_it: ^7.2.0 19 | injectable: ^1.5.3 20 | mailer: ^5.2.0 21 | hasura_connect: ^4.0.0+4 22 | http: ^0.13.4 23 | encrypt: ^5.0.1 24 | 25 | dev_dependencies: 26 | lints: ^2.0.0 27 | test: ^1.15.0 28 | build_runner: ^2.1.4 29 | shelf_router_generator: ^1.0.1 30 | injectable_generator: ^1.5.4 31 | -------------------------------------------------------------------------------- /server-smc-dart/test/server_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:http/http.dart'; 4 | import 'package:test/test.dart'; 5 | 6 | void main() { 7 | final port = '8080'; 8 | final host = 'http://0.0.0.0:$port'; 9 | late Process p; 10 | 11 | setUp(() async { 12 | p = await Process.start( 13 | 'dart', 14 | ['run', 'bin/server.dart'], 15 | environment: {'PORT': port}, 16 | ); 17 | // Wait for server to start and print to stdout. 18 | await p.stdout.first; 19 | }); 20 | 21 | tearDown(() => p.kill()); 22 | 23 | test('Root', () async { 24 | final response = await get(Uri.parse('$host/')); 25 | expect(response.statusCode, 200); 26 | expect(response.body, 'Hello, World!\n'); 27 | }); 28 | 29 | test('Echo', () async { 30 | final response = await get(Uri.parse('$host/echo/hello')); 31 | expect(response.statusCode, 200); 32 | expect(response.body, 'hello\n'); 33 | }); 34 | 35 | test('404', () async { 36 | final response = await get(Uri.parse('$host/foobar')); 37 | expect(response.statusCode, 404); 38 | }); 39 | } 40 | --------------------------------------------------------------------------------