save before flutter upgrade
43
.gitignore
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# Miscellaneous
|
||||
*.class
|
||||
*.log
|
||||
*.pyc
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
migrate_working_dir/
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# The .vscode folder contains launch configuration and tasks you configure in
|
||||
# VS Code which you may wish to be included in version control, so this line
|
||||
# is commented out by default.
|
||||
#.vscode/
|
||||
|
||||
# Flutter/Dart/Pub related
|
||||
**/doc/api/
|
||||
**/ios/Flutter/.last_build_id
|
||||
.dart_tool/
|
||||
.flutter-plugins
|
||||
.flutter-plugins-dependencies
|
||||
.pub-cache/
|
||||
.pub/
|
||||
/build/
|
||||
|
||||
# Symbolication related
|
||||
app.*.symbols
|
||||
|
||||
# Obfuscation related
|
||||
app.*.map.json
|
||||
|
||||
# Android Studio will place build artifacts here
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
45
.metadata
Normal file
@@ -0,0 +1,45 @@
|
||||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: "abb292a07e20d696c4568099f918f6c5f330e6b0"
|
||||
channel: "stable"
|
||||
|
||||
project_type: app
|
||||
|
||||
# Tracks metadata for the flutter migrate command
|
||||
migration:
|
||||
platforms:
|
||||
- platform: root
|
||||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
- platform: android
|
||||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
- platform: ios
|
||||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
- platform: linux
|
||||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
- platform: macos
|
||||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
- platform: web
|
||||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
- platform: windows
|
||||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
|
||||
|
||||
# User provided section
|
||||
|
||||
# List of Local paths (relative to this file) that should be
|
||||
# ignored by the migrate tool.
|
||||
#
|
||||
# Files that are not part of the templates will be ignored by default.
|
||||
unmanaged_files:
|
||||
- 'lib/main.dart'
|
||||
- 'ios/Runner.xcodeproj/project.pbxproj'
|
||||
16
README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# nethive_neo
|
||||
|
||||
A new Flutter project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
This project is a starting point for a Flutter application.
|
||||
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
|
||||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
28
analysis_options.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
# This file configures the analyzer, which statically analyzes Dart code to
|
||||
# check for errors, warnings, and lints.
|
||||
#
|
||||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||
# invoked from the command line by running `flutter analyze`.
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
# The lint rules applied to this project can be customized in the
|
||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||
# included above or to enable additional rules. A list of all available lints
|
||||
# and their documentation is published at https://dart.dev/lints.
|
||||
#
|
||||
# Instead of disabling a lint rule for the entire project in the
|
||||
# section below, it can also be suppressed for a single line of code
|
||||
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||
# producing the lint.
|
||||
rules:
|
||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
13
android/.gitignore
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
gradle-wrapper.jar
|
||||
/.gradle
|
||||
/captures/
|
||||
/gradlew
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
67
android/app/build.gradle
Normal file
@@ -0,0 +1,67 @@
|
||||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "com.example.nethive_neo"
|
||||
compileSdk flutter.compileSdkVersion
|
||||
ndkVersion flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.example.nethive_neo"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {}
|
||||
7
android/app/src/debug/AndroidManifest.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
44
android/app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application
|
||||
android:label="nethive_neo"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility?hl=en and
|
||||
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||
<data android:mimeType="text/plain"/>
|
||||
</intent>
|
||||
</queries>
|
||||
</manifest>
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.nethive_neo
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity: FlutterActivity()
|
||||
12
android/app/src/main/res/drawable-v21/launch_background.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="?android:colorBackground" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
||||
12
android/app/src/main/res/drawable/launch_background.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@android:color/white" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
||||
BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 544 B |
BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 442 B |
BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 721 B |
BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
18
android/app/src/main/res/values-night/styles.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
18
android/app/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
7
android/app/src/profile/AndroidManifest.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
18
android/build.gradle
Normal file
@@ -0,0 +1,18 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
3
android/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
org.gradle.jvmargs=-Xmx4G
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
5
android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
|
||||
26
android/settings.gradle
Normal file
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
def flutterSdkPath = {
|
||||
def properties = new Properties()
|
||||
file("local.properties").withInputStream { properties.load(it) }
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
return flutterSdkPath
|
||||
}
|
||||
settings.ext.flutterSdkPath = flutterSdkPath()
|
||||
|
||||
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version "7.3.0" apply false
|
||||
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
|
||||
}
|
||||
|
||||
include ":app"
|
||||
193
assets/referenciamain.txt
Normal file
@@ -0,0 +1,193 @@
|
||||
import 'package:cbluna_crm_lu/providers/book_details_provider.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_strategy/url_strategy.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
import 'package:flutter_portal/flutter_portal.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
|
||||
import 'package:cbluna_crm_lu/helpers/constants.dart';
|
||||
import 'package:cbluna_crm_lu/helpers/globals.dart';
|
||||
import 'package:cbluna_crm_lu/helpers/scroll_behavior.dart';
|
||||
import 'package:cbluna_crm_lu/internationalization/internationalization.dart';
|
||||
import 'package:cbluna_crm_lu/models/sales/suggestions_api.dart';
|
||||
import 'package:cbluna_crm_lu/models/sales/suggestions_repository_impl.dart';
|
||||
import 'package:cbluna_crm_lu/providers/cart_provider.dart';
|
||||
import 'package:cbluna_crm_lu/providers/content_manager_provider.dart';
|
||||
import 'package:cbluna_crm_lu/providers/content_manager_lu_provider.dart';
|
||||
import 'package:cbluna_crm_lu/providers/purchase_order_provider.dart';
|
||||
import 'package:cbluna_crm_lu/providers/step1_form_provider.dart';
|
||||
import 'package:cbluna_crm_lu/providers/providers.dart';
|
||||
import 'package:cbluna_crm_lu/providers/sales_form_view_provider.dart';
|
||||
import 'package:cbluna_crm_lu/providers/step2_form_provider.dart';
|
||||
import 'package:cbluna_crm_lu/providers/step3_form_provider.dart';
|
||||
import 'package:cbluna_crm_lu/providers/step4_form_provider.dart';
|
||||
import 'package:cbluna_crm_lu/providers/support_provider.dart';
|
||||
import 'package:cbluna_crm_lu/router/router.dart';
|
||||
import 'package:cbluna_crm_lu/theme/theme.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
setPathUrlStrategy();
|
||||
await Supabase.initialize(
|
||||
url: supabaseUrl,
|
||||
anonKey: anonKey,
|
||||
realtimeClientOptions: const RealtimeClientOptions(
|
||||
eventsPerSecond: 2,
|
||||
),
|
||||
);
|
||||
|
||||
supabaseLU = SupabaseClient(supabaseUrl, anonKey, schema: 'lectores_urb');
|
||||
|
||||
await initGlobals();
|
||||
|
||||
GoRouter.optionURLReflectsImperativeAPIs = true;
|
||||
|
||||
runApp(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => UserState(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => VisualStateProvider(context),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => CustomersProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => UsersProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => OrdersProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => InventoryProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => PurchaseOrderProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => ServiceOrderProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => VideosProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => BooksProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => BillingProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => CartProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(create: (_) => SupportProvider()),
|
||||
ChangeNotifierProvider<SalesFormViewProvider>(
|
||||
create: (_) => SalesFormViewProvider(),
|
||||
),
|
||||
ChangeNotifierProvider<Step1FormProvider>(
|
||||
create: (_) => Step1FormProvider(),
|
||||
),
|
||||
ChangeNotifierProvider<Step2FormProvider>(
|
||||
create: (_) => Step2FormProvider(
|
||||
SuggestionsRepositoryImpl(
|
||||
SuggestionsAPI(Dio()),
|
||||
),
|
||||
UniqueKey(),
|
||||
notify: true),
|
||||
),
|
||||
ChangeNotifierProvider<Step3FormProvider>(
|
||||
create: (_) => Step3FormProvider(),
|
||||
),
|
||||
ChangeNotifierProvider<Step4FormProvider>(
|
||||
create: (_) => Step4FormProvider(
|
||||
SuggestionsRepositoryImpl(
|
||||
SuggestionsAPI(Dio()),
|
||||
),
|
||||
UniqueKey(),
|
||||
notify: true),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => ContentManagerProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => CRMProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => ContentManagerLUProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => QRCodeProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => BookDetailsProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => CouponsProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => BibliotecaVideosProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => BibliotecaProvider(),
|
||||
),
|
||||
],
|
||||
child: const MyApp(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
|
||||
static _MyAppState of(BuildContext context) =>
|
||||
context.findAncestorStateOfType<_MyAppState>()!;
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
Locale _locale = const Locale('es');
|
||||
ThemeMode _themeMode = AppTheme.themeMode;
|
||||
|
||||
void setLocale(Locale value) => setState(() => _locale = value);
|
||||
void setThemeMode(ThemeMode mode) => setState(() {
|
||||
_themeMode = mode;
|
||||
AppTheme.saveThemeMode(mode);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Portal(
|
||||
child: MaterialApp.router(
|
||||
title: 'CRM LU',
|
||||
debugShowCheckedModeBanner: false,
|
||||
locale: _locale,
|
||||
localizationsDelegates: const [
|
||||
AppLocalizationsDelegate(),
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: const [Locale('en', 'US')],
|
||||
theme: ThemeData(
|
||||
brightness: Brightness.light,
|
||||
dividerColor: Colors.grey,
|
||||
),
|
||||
darkTheme: ThemeData(
|
||||
brightness: Brightness.dark,
|
||||
dividerColor: Colors.grey,
|
||||
),
|
||||
themeMode: _themeMode,
|
||||
routerConfig: router,
|
||||
scrollBehavior: MyCustomScrollBehavior(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
34
ios/.gitignore
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
**/dgph
|
||||
*.mode1v3
|
||||
*.mode2v3
|
||||
*.moved-aside
|
||||
*.pbxuser
|
||||
*.perspectivev3
|
||||
**/*sync/
|
||||
.sconsign.dblite
|
||||
.tags*
|
||||
**/.vagrant/
|
||||
**/DerivedData/
|
||||
Icon?
|
||||
**/Pods/
|
||||
**/.symlinks/
|
||||
profile
|
||||
xcuserdata
|
||||
**/.generated/
|
||||
Flutter/App.framework
|
||||
Flutter/Flutter.framework
|
||||
Flutter/Flutter.podspec
|
||||
Flutter/Generated.xcconfig
|
||||
Flutter/ephemeral/
|
||||
Flutter/app.flx
|
||||
Flutter/app.zip
|
||||
Flutter/flutter_assets/
|
||||
Flutter/flutter_export_environment.sh
|
||||
ServiceDefinitions.json
|
||||
Runner/GeneratedPluginRegistrant.*
|
||||
|
||||
# Exceptions to above rules.
|
||||
!default.mode1v3
|
||||
!default.mode2v3
|
||||
!default.pbxuser
|
||||
!default.perspectivev3
|
||||
26
ios/Flutter/AppFrameworkInfo.plist
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>App</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>io.flutter.flutter.app</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>App</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>12.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
1
ios/Flutter/Debug.xcconfig
Normal file
@@ -0,0 +1 @@
|
||||
#include "Generated.xcconfig"
|
||||
1
ios/Flutter/Release.xcconfig
Normal file
@@ -0,0 +1 @@
|
||||
#include "Generated.xcconfig"
|
||||
616
ios/Runner.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,616 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
|
||||
remoteInfo = Runner;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
331C807B294A618700263BE5 /* RunnerTests.swift */,
|
||||
);
|
||||
path = RunnerTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||
);
|
||||
name = Flutter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146E51CF9000F007C117D = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9740EEB11CF90186004384FC /* Flutter */,
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
331C8082294A63A400263BE5 /* RunnerTests */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146EF1CF9000F007C117D /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
97C146EE1CF9000F007C117D /* Runner.app */,
|
||||
331C8081294A63A400263BE5 /* RunnerTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146F01CF9000F007C117D /* Runner */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
|
||||
97C147021CF9000F007C117D /* Info.plist */,
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
|
||||
);
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
331C8080294A63A400263BE5 /* RunnerTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||
buildPhases = (
|
||||
331C807D294A63A400263BE5 /* Sources */,
|
||||
331C807F294A63A400263BE5 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
331C8086294A63A400263BE5 /* PBXTargetDependency */,
|
||||
);
|
||||
name = RunnerTests;
|
||||
productName = RunnerTests;
|
||||
productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
97C146ED1CF9000F007C117D /* Runner */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Runner;
|
||||
productName = Runner;
|
||||
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1510;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
331C8080294A63A400263BE5 = {
|
||||
CreatedOnToolsVersion = 14.0;
|
||||
TestTargetID = 97C146ED1CF9000F007C117D;
|
||||
};
|
||||
97C146ED1CF9000F007C117D = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
LastSwiftMigration = 1100;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 97C146E51CF9000F007C117D;
|
||||
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
97C146ED1CF9000F007C117D /* Runner */,
|
||||
331C8080294A63A400263BE5 /* RunnerTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
331C807F294A63A400263BE5 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
97C146EC1CF9000F007C117D /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
|
||||
);
|
||||
name = "Thin Binary";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Run Script";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
331C807D294A63A400263BE5 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
97C146EA1CF9000F007C117D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 97C146ED1CF9000F007C117D /* Runner */;
|
||||
targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
97C146FB1CF9000F007C117D /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
97C147001CF9000F007C117D /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
249021D4217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.nethiveNeo;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
331C8088294A63A400263BE5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.nethiveNeo.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
331C8089294A63A400263BE5 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.nethiveNeo.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
331C808A294A63A400263BE5 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.nethiveNeo.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
97C147031CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
97C147041CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
97C147061CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.nethiveNeo;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
97C147071CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.nethiveNeo;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
331C8088294A63A400263BE5 /* Debug */,
|
||||
331C8089294A63A400263BE5 /* Release */,
|
||||
331C808A294A63A400263BE5 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
97C147031CF9000F007C117D /* Debug */,
|
||||
97C147041CF9000F007C117D /* Release */,
|
||||
249021D3217E4FDB00AE95B9 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
97C147061CF9000F007C117D /* Debug */,
|
||||
97C147071CF9000F007C117D /* Release */,
|
||||
249021D4217E4FDB00AE95B9 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||
}
|
||||
7
ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
98
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
Normal file
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1510"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO"
|
||||
parallelizable = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "331C8080294A63A400263BE5"
|
||||
BuildableName = "RunnerTests.xctest"
|
||||
BlueprintName = "RunnerTests"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Profile"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
7
ios/Runner.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
13
ios/Runner/AppDelegate.swift
Normal file
@@ -0,0 +1,13 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
|
||||
@UIApplicationMain
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
}
|
||||
122
ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon-App-1024x1024@1x.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 450 B |
|
After Width: | Height: | Size: 282 B |
|
After Width: | Height: | Size: 462 B |
|
After Width: | Height: | Size: 704 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 586 B |
|
After Width: | Height: | Size: 862 B |
|
After Width: | Height: | Size: 862 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 762 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
23
ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
BIN
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
vendored
Normal file
|
After Width: | Height: | Size: 68 B |
BIN
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 68 B |
BIN
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 68 B |
5
ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Launch Screen Assets
|
||||
|
||||
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
|
||||
|
||||
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
|
||||
37
ios/Runner/Base.lproj/LaunchScreen.storyboard
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="LaunchImage" width="168" height="185"/>
|
||||
</resources>
|
||||
</document>
|
||||
26
ios/Runner/Base.lproj/Main.storyboard
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Flutter View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
49
ios/Runner/Info.plist
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Nethive Neo</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>nethive_neo</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
1
ios/Runner/Runner-Bridging-Header.h
Normal file
@@ -0,0 +1 @@
|
||||
#import "GeneratedPluginRegistrant.h"
|
||||
12
ios/RunnerTests/RunnerTests.swift
Normal file
@@ -0,0 +1,12 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
import XCTest
|
||||
|
||||
class RunnerTests: XCTestCase {
|
||||
|
||||
func testExample() {
|
||||
// If you add code to the Runner application, consider adding tests here.
|
||||
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
|
||||
}
|
||||
|
||||
}
|
||||
12
lib/functions/check_password.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
String? checkPassword(String password) {
|
||||
if (password.length < 8) {
|
||||
return 'La contraseña debe tener al menos 8 caracteres';
|
||||
}
|
||||
final RegExp regex =
|
||||
RegExp(r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$');
|
||||
final RegExpMatch? match = regex.firstMatch(password);
|
||||
if (match == null) {
|
||||
return 'La contraseña debe tener al menos un número, una letra mayúscula, una letra minúscula, un caracter especial y no debe tener números ni letras consecutivas';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
104
lib/functions/date_format.dart
Normal file
@@ -0,0 +1,104 @@
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
String dateFormat(
|
||||
dynamic x, // Acepta DateTime o String
|
||||
[
|
||||
bool includeTime = false,
|
||||
bool includeDayName = true,
|
||||
bool includeTimeAgo = false,
|
||||
String language = 'es_MX',
|
||||
]) {
|
||||
DateTime? date;
|
||||
|
||||
// Verifica si es una cadena de fecha y conviértela a DateTime
|
||||
if (x is String) {
|
||||
date = DateTime.tryParse(x);
|
||||
} else if (x is DateTime) {
|
||||
date = x;
|
||||
}
|
||||
|
||||
if (date == null) return '-';
|
||||
|
||||
// Convierte a hora local
|
||||
date = date.toLocal();
|
||||
|
||||
String formattedDate;
|
||||
|
||||
// Formatea la fecha
|
||||
if (!includeTime) {
|
||||
if (includeDayName) {
|
||||
|
||||
formattedDate = DateFormat('EEE. dd/MMM/yyyy', language).format(date);
|
||||
}
|
||||
else{
|
||||
formattedDate = DateFormat('dd/MMM/yyyy', language).format(date);
|
||||
}
|
||||
} else {
|
||||
formattedDate = DateFormat('EEE. dd/MMM/yyyy HH:mm', language).format(date);
|
||||
}
|
||||
|
||||
// Capitaliza la primera letra del día
|
||||
List<String> parts = formattedDate.split(' ');
|
||||
|
||||
if (parts.isNotEmpty) {
|
||||
parts[0] = parts[0][0].toUpperCase() + parts[0].substring(1).toLowerCase();
|
||||
}
|
||||
|
||||
// Capitaliza la primera letra del mes
|
||||
if (parts.length >= 2) {
|
||||
String datePart = parts[1]; // "dd/MMM/yyyy" o "dd/MMM/yyyy HH:mm"
|
||||
List<String> dateComponents = datePart.split('/');
|
||||
|
||||
if (dateComponents.length >= 2) {
|
||||
// Capitaliza el mes
|
||||
dateComponents[1] = dateComponents[1][0].toUpperCase() +
|
||||
dateComponents[1].substring(1).toLowerCase();
|
||||
parts[1] = dateComponents.join('/');
|
||||
}
|
||||
}
|
||||
|
||||
formattedDate = parts.join(' ');
|
||||
|
||||
// Manejo de includeTimeAgo
|
||||
if (includeTimeAgo) {
|
||||
final Duration difference = DateTime.now().difference(date);
|
||||
String timeAgo = '';
|
||||
|
||||
if (difference.isNegative) {
|
||||
timeAgo = '\n(hace 0 segundos)';
|
||||
} else {
|
||||
if (difference.inSeconds < 60) {
|
||||
timeAgo = '\n(hace ${difference.inSeconds} segundos)';
|
||||
} else if (difference.inMinutes < 60) {
|
||||
timeAgo = '\n(hace ${difference.inMinutes} minutos)';
|
||||
} else if (difference.inHours < 48) {
|
||||
timeAgo = '\n(hace ${difference.inHours} horas)';
|
||||
} else if (difference.inDays <= 30) {
|
||||
timeAgo = '\n(hace ${difference.inDays} días)';
|
||||
} else if (difference.inDays > 30) {
|
||||
timeAgo = '\n(hace ${difference.inDays ~/ 30} meses)';
|
||||
}
|
||||
}
|
||||
|
||||
formattedDate = '$formattedDate $timeAgo';
|
||||
}
|
||||
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
// Definir una lista de nombres de los días de la semana
|
||||
List<String> daysOfWeek = [
|
||||
'Lunes',
|
||||
'Martes',
|
||||
'Miércoles',
|
||||
'Jueves',
|
||||
'Viernes',
|
||||
'Sábado',
|
||||
'Domingo'
|
||||
];
|
||||
|
||||
// Obtener el nombre del día de la semana
|
||||
String getDayName(DateTime now) {
|
||||
String dayName = daysOfWeek[now.weekday - 1];
|
||||
return dayName;
|
||||
}
|
||||
9
lib/functions/date_time_format.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
String dateTimeFormat(DateTime? date) {
|
||||
if (date == null) {
|
||||
return '-';
|
||||
}
|
||||
final formato = DateFormat('MM-dd-yyyy HH:mm:ss');
|
||||
return formato.format(date);
|
||||
}
|
||||
11
lib/functions/day_month_format.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
String dayMothFormat(DateTime fecha) {
|
||||
String dia = DateFormat('d').format(fecha);
|
||||
|
||||
String mes = DateFormat('MMM', 'es').format(fecha);
|
||||
mes = mes[0].toUpperCase() + mes.substring(1);
|
||||
mes = mes.replaceAll('.', '');
|
||||
|
||||
return '$dia $mes';
|
||||
}
|
||||
8
lib/functions/double_extensions.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
import 'dart:math';
|
||||
|
||||
extension Precision on double {
|
||||
double toPrecision(int fractionDigits) {
|
||||
var mod = pow(10, fractionDigits.toDouble()).toDouble();
|
||||
return ((this * mod).round().toDouble() / mod);
|
||||
}
|
||||
}
|
||||
13
lib/functions/extract_number_from_text.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
int? extractNumberFromText(String text) {
|
||||
// Expresión regular para encontrar el primer número en el texto
|
||||
RegExp regExp = RegExp(r'\d+');
|
||||
Match? match = regExp.firstMatch(text);
|
||||
|
||||
// Si se encuentra un número, devolverlo como un entero
|
||||
if (match != null) {
|
||||
return int.tryParse(match.group(0) ?? '');
|
||||
}
|
||||
|
||||
// Si no se encuentra ningún número, devolver null
|
||||
return null;
|
||||
}
|
||||
4
lib/functions/form_textfield_width.dart
Normal file
@@ -0,0 +1,4 @@
|
||||
double formTextFieldWidth(double anchoPantalla, double anchoMin, double anchoMax, double valorMin, double valorMax) {
|
||||
// Fórmula de interpolación lineal para calcular tamaños adaptativos.
|
||||
return valorMin + (valorMax - valorMin) * ((anchoPantalla - anchoMin) / (anchoMax - anchoMin));
|
||||
}
|
||||
12
lib/functions/money_format.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
String moneyFormat(double x) {
|
||||
List<String> parts = x.toString().split('.');
|
||||
RegExp re = RegExp(r'\B(?=(\d{3})+(?!\d))');
|
||||
|
||||
parts[0] = parts[0].replaceAll(re, ',');
|
||||
if (parts.length == 1) {
|
||||
parts.add('00');
|
||||
} else {
|
||||
parts[1] = parts[1].padRight(2, '0').substring(0, 2);
|
||||
}
|
||||
return parts.join('.');
|
||||
}
|
||||
12
lib/functions/money_format_3_decimals.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
String moneyFormat3Decimals(double x) {
|
||||
List<String> parts = x.toString().split('.');
|
||||
RegExp re = RegExp(r'\B(?=(\d{3})+(?!\d))');
|
||||
|
||||
parts[0] = parts[0].replaceAll(re, ',');
|
||||
if (parts.length == 1) {
|
||||
parts.add('00');
|
||||
} else {
|
||||
parts[1] = parts[1].padRight(3, '0').substring(0, 3);
|
||||
}
|
||||
return parts.join('.');
|
||||
}
|
||||
11
lib/functions/month_name.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
String monthName(int mes) {
|
||||
DateTime dateTime = DateTime(DateTime.now().year, mes);
|
||||
|
||||
String value = DateFormat('MMMM', 'es').format(dateTime);
|
||||
|
||||
value = value[0].toUpperCase() + value.substring(1);
|
||||
|
||||
return value;
|
||||
}
|
||||
15
lib/functions/no_transition_route.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
GoRoute noTransitionRoute(String path, String name, Widget Function(BuildContext, GoRouterState) builder, {List<GoRoute>? subroutes}) {
|
||||
return GoRoute(
|
||||
path: path,
|
||||
name: name,
|
||||
pageBuilder: (context, state) {
|
||||
return NoTransitionPage(
|
||||
child: builder(context, state),
|
||||
);
|
||||
},
|
||||
routes: subroutes ?? [],
|
||||
);
|
||||
}
|
||||
4
lib/functions/phone_format.dart
Normal file
@@ -0,0 +1,4 @@
|
||||
String formatPhone(String phone) {
|
||||
if (phone.length != 10) return phone;
|
||||
return '(${phone.substring(0, 3)}) ${phone.substring(3, 6)} ${phone.substring(6, 8)} ${phone.substring(8, 10)}';
|
||||
}
|
||||
20
lib/functions/tokens.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart';
|
||||
import 'package:nethive_neo/models/models.dart';
|
||||
|
||||
Token? parseToken(String token) {
|
||||
try {
|
||||
// Verify a token
|
||||
final jwt = JWT.verify(token, SecretKey('secret'));
|
||||
return Token.fromJson(json.encode(jwt.payload), token);
|
||||
} on JWTExpiredException {
|
||||
log('JWT expirada');
|
||||
} on JWTException catch (ex) {
|
||||
log('Error en checkToken - $ex');
|
||||
} on Exception {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
34
lib/helpers/color_extension.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'dart:ui';
|
||||
|
||||
extension ColorExtension on Color {
|
||||
/// Convert the color to a darken color based on the [percent]
|
||||
Color darken([int percent = 40]) {
|
||||
assert(1 <= percent && percent <= 100);
|
||||
final value = 1 - percent / 100;
|
||||
return Color.fromARGB(
|
||||
alpha,
|
||||
(red * value).round(),
|
||||
(green * value).round(),
|
||||
(blue * value).round(),
|
||||
);
|
||||
}
|
||||
|
||||
Color lighten([int percent = 40]) {
|
||||
assert(1 <= percent && percent <= 100);
|
||||
final value = percent / 100;
|
||||
return Color.fromARGB(
|
||||
alpha,
|
||||
(red + ((255 - red) * value)).round(),
|
||||
(green + ((255 - green) * value)).round(),
|
||||
(blue + ((255 - blue) * value)).round(),
|
||||
);
|
||||
}
|
||||
|
||||
Color avg(Color other) {
|
||||
final red = (this.red + other.red) ~/ 2;
|
||||
final green = (this.green + other.green) ~/ 2;
|
||||
final blue = (this.blue + other.blue) ~/ 2;
|
||||
final alpha = (this.alpha + other.alpha) ~/ 2;
|
||||
return Color.fromARGB(alpha, red, green, blue);
|
||||
}
|
||||
}
|
||||
30
lib/helpers/constants.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
//////// DEV CBLUNA ////////
|
||||
const String supabaseUrl = 'https://cbl-supabase.virtalus.cbluna-dev.com';
|
||||
const String anonKey =
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogImFub24iLAogICJpc3MiOiAic3VwYWJhc2UiLAogICJpYXQiOiAxNzE1MjM4MDAwLAogICJleHAiOiAxODczMDA0NDAwCn0.qKqYn2vjtHqKqyt1FAghuIjvNsyr9b1ElpVfvJg6zJ4';
|
||||
const String storageBooksCover =
|
||||
'https://cbl-supabase.virtalus.cbluna-dev.com/storage/v1/object/public/lectores_urb/books_cover/';
|
||||
const String storageBooks = 'lectores_urb/books';
|
||||
|
||||
const redirectUrl = '$supabaseUrl/change-pass/change-password/token';
|
||||
|
||||
const String apiGatewayUrl = 'https://cbl.virtalus.cbluna-dev.com/uapi/lu/api';
|
||||
const String n8nUrl = 'https://u-n8n.virtalus.cbluna-dev.com/webhook';
|
||||
const bearerApiGateway = "Basic YWlyZmxvdzpjYiF1bmEyMDIz";
|
||||
|
||||
const int organizationId = 10;
|
||||
const String lectoresUrl = 'https://lectoresurbanos.com/';
|
||||
|
||||
const themeId = String.fromEnvironment('themeId', defaultValue: '2');
|
||||
const int mobileSize = 800;
|
||||
|
||||
//GoogleMaps
|
||||
const apiKey = '-plDP_dR7XAGxBSiHgTFyxkxNdjFFHqjQK9ge8b92CE';
|
||||
|
||||
//Stripe
|
||||
const stripeKey =
|
||||
'sk_test_51QB3lZRxye2e7dlWyeWcHWmgsJ9kEbIz4lrgJtUIKuC7WEB0HM0njk6Mcgq1q1H9GTs7fByRZdvxHaSAGhzcBqYF00fLxZU9E9';
|
||||
const authorizationKey = 'Bearer $stripeKey';
|
||||
|
||||
const urlStripe = 'https://api.stripe.com';
|
||||
const idPricePlanRentaQR = 'price_1QPaDnRxye2e7dlWORf4GoHS';
|
||||
325
lib/helpers/globals.dart
Normal file
@@ -0,0 +1,325 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:pluto_grid/pluto_grid.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart' hide User;
|
||||
|
||||
import 'package:nethive_neo/helpers/supabase/queries.dart';
|
||||
import 'package:nethive_neo/models/models.dart';
|
||||
import 'package:nethive_neo/theme/theme.dart';
|
||||
|
||||
final GlobalKey<ScaffoldMessengerState> snackbarKey =
|
||||
GlobalKey<ScaffoldMessengerState>();
|
||||
|
||||
const storage = FlutterSecureStorage();
|
||||
|
||||
final supabase = Supabase.instance.client;
|
||||
late SupabaseClient supabaseLU;
|
||||
|
||||
late final SharedPreferences prefs;
|
||||
late Configuration? theme;
|
||||
|
||||
User? currentUser;
|
||||
|
||||
Future<void> initGlobals() async {
|
||||
prefs = await SharedPreferences.getInstance();
|
||||
currentUser = await SupabaseQueries.getCurrentUserData();
|
||||
/* //Temas de la aplicacion
|
||||
if (currentUser == null) {
|
||||
Configuration? conf = await SupabaseQueries.getDefaultTheme();
|
||||
AppTheme.initConfiguration(conf);
|
||||
} else {
|
||||
theme = await SupabaseQueries.getUserTheme();
|
||||
AppTheme.initConfiguration(theme);
|
||||
}
|
||||
*/
|
||||
if (currentUser == null) return;
|
||||
}
|
||||
|
||||
PlutoGridScrollbarConfig plutoGridScrollbarConfig(BuildContext context) {
|
||||
return PlutoGridScrollbarConfig(
|
||||
isAlwaysShown: true,
|
||||
scrollbarThickness: 5,
|
||||
hoverWidth: 20,
|
||||
scrollBarColor: AppTheme.of(context).primaryColor,
|
||||
);
|
||||
}
|
||||
|
||||
PlutoGridStyleConfig plutoGridStyleConfig(BuildContext context,
|
||||
{double rowHeight = 50}) {
|
||||
return AppTheme.themeMode == ThemeMode.light
|
||||
? PlutoGridStyleConfig(
|
||||
menuBackgroundColor: AppTheme.of(context).secondaryColor,
|
||||
gridPopupBorderRadius: BorderRadius.circular(16),
|
||||
enableColumnBorderVertical: false,
|
||||
enableColumnBorderHorizontal: false,
|
||||
enableCellBorderVertical: false,
|
||||
enableCellBorderHorizontal: true,
|
||||
columnTextStyle: AppTheme.of(context).bodyText3.override(
|
||||
fontFamily: AppTheme.of(context).bodyText3Family,
|
||||
color: AppTheme.of(context).primaryColor,
|
||||
),
|
||||
cellTextStyle: AppTheme.of(context).bodyText3,
|
||||
iconColor: AppTheme.of(context).tertiaryColor,
|
||||
rowColor: Colors.transparent,
|
||||
borderColor: const Color(0xFFF1F4FA),
|
||||
rowHeight: rowHeight,
|
||||
checkedColor: AppTheme.themeMode == ThemeMode.light
|
||||
? AppTheme.of(context).secondaryColor
|
||||
: const Color(0XFF4B4B4B),
|
||||
enableRowColorAnimation: true,
|
||||
gridBackgroundColor: Colors.transparent,
|
||||
gridBorderColor: Colors.transparent,
|
||||
activatedColor: AppTheme.of(context).primaryBackground,
|
||||
activatedBorderColor: AppTheme.of(context).tertiaryColor,
|
||||
)
|
||||
: PlutoGridStyleConfig.dark(
|
||||
menuBackgroundColor: AppTheme.of(context).secondaryColor,
|
||||
gridPopupBorderRadius: BorderRadius.circular(16),
|
||||
enableColumnBorderVertical: false,
|
||||
enableColumnBorderHorizontal: false,
|
||||
enableCellBorderVertical: false,
|
||||
enableCellBorderHorizontal: true,
|
||||
columnTextStyle: AppTheme.of(context).bodyText3.override(
|
||||
fontFamily: 'Quicksand',
|
||||
color: AppTheme.of(context).alternate,
|
||||
),
|
||||
cellTextStyle: AppTheme.of(context).bodyText3,
|
||||
iconColor: AppTheme.of(context).tertiaryColor,
|
||||
rowColor: Colors.transparent,
|
||||
borderColor: const Color(0xFFF1F4FA),
|
||||
rowHeight: rowHeight,
|
||||
checkedColor: AppTheme.themeMode == ThemeMode.light
|
||||
? AppTheme.of(context).secondaryColor
|
||||
: const Color(0XFF4B4B4B),
|
||||
enableRowColorAnimation: true,
|
||||
gridBackgroundColor: Colors.transparent,
|
||||
gridBorderColor: Colors.transparent,
|
||||
activatedColor: AppTheme.of(context).primaryBackground,
|
||||
activatedBorderColor: AppTheme.of(context).tertiaryColor,
|
||||
);
|
||||
}
|
||||
|
||||
PlutoGridStyleConfig plutoGridBigStyleConfig(BuildContext context) {
|
||||
return AppTheme.themeMode == ThemeMode.light
|
||||
? PlutoGridStyleConfig(
|
||||
menuBackgroundColor: AppTheme.of(context).secondaryColor,
|
||||
gridPopupBorderRadius: BorderRadius.circular(16),
|
||||
enableColumnBorderVertical: false,
|
||||
enableColumnBorderHorizontal: false,
|
||||
enableCellBorderVertical: false,
|
||||
enableCellBorderHorizontal: true,
|
||||
columnTextStyle: AppTheme.of(context).bodyText3.override(
|
||||
fontFamily: 'Quicksand',
|
||||
color: AppTheme.of(context).hintText,
|
||||
),
|
||||
cellTextStyle: AppTheme.of(context).bodyText3,
|
||||
iconColor: AppTheme.of(context).tertiaryColor,
|
||||
rowColor: Colors.transparent,
|
||||
borderColor: Colors.transparent,
|
||||
rowHeight: 50,
|
||||
checkedColor: AppTheme.themeMode == ThemeMode.light
|
||||
? AppTheme.of(context).secondaryColor
|
||||
: const Color(0XFF4B4B4B),
|
||||
enableRowColorAnimation: true,
|
||||
gridBackgroundColor: Colors.transparent,
|
||||
gridBorderColor: Colors.transparent,
|
||||
activatedColor: AppTheme.of(context).primaryBackground,
|
||||
activatedBorderColor: AppTheme.of(context).tertiaryColor,
|
||||
columnHeight: 100,
|
||||
gridBorderRadius: BorderRadius.circular(16),
|
||||
)
|
||||
: PlutoGridStyleConfig.dark(
|
||||
menuBackgroundColor: AppTheme.of(context).secondaryColor,
|
||||
gridPopupBorderRadius: BorderRadius.circular(16),
|
||||
enableColumnBorderVertical: false,
|
||||
enableColumnBorderHorizontal: false,
|
||||
enableCellBorderVertical: false,
|
||||
enableCellBorderHorizontal: true,
|
||||
columnTextStyle: AppTheme.of(context).bodyText3.override(
|
||||
fontFamily: 'Quicksand',
|
||||
color: AppTheme.of(context).alternate,
|
||||
),
|
||||
cellTextStyle: AppTheme.of(context).bodyText3,
|
||||
iconColor: AppTheme.of(context).tertiaryColor,
|
||||
rowColor: Colors.transparent,
|
||||
borderColor: const Color(0xFFF1F4FA),
|
||||
rowHeight: 50,
|
||||
checkedColor: AppTheme.themeMode == ThemeMode.light
|
||||
? AppTheme.of(context).secondaryColor
|
||||
: const Color(0XFF4B4B4B),
|
||||
enableRowColorAnimation: true,
|
||||
gridBackgroundColor: Colors.transparent,
|
||||
gridBorderColor: Colors.transparent,
|
||||
activatedColor: AppTheme.of(context).primaryBackground,
|
||||
activatedBorderColor: AppTheme.of(context).tertiaryColor,
|
||||
columnHeight: 100,
|
||||
gridBorderRadius: BorderRadius.circular(16),
|
||||
);
|
||||
}
|
||||
|
||||
PlutoGridStyleConfig plutoGridDashboardStyleConfig(BuildContext context) {
|
||||
return AppTheme.themeMode == ThemeMode.light
|
||||
? PlutoGridStyleConfig(
|
||||
menuBackgroundColor: AppTheme.of(context).secondaryColor,
|
||||
gridPopupBorderRadius: BorderRadius.circular(16),
|
||||
enableColumnBorderVertical: false,
|
||||
enableColumnBorderHorizontal: false,
|
||||
enableCellBorderVertical: false,
|
||||
enableCellBorderHorizontal: true,
|
||||
columnTextStyle: AppTheme.of(context).bodyText3.override(
|
||||
fontFamily: 'Quicksand',
|
||||
color: AppTheme.of(context).hintText,
|
||||
),
|
||||
cellTextStyle: AppTheme.of(context).bodyText3,
|
||||
iconColor: AppTheme.of(context).tertiaryColor,
|
||||
rowColor: Colors.transparent,
|
||||
borderColor: const Color(0xFFF1F4FA),
|
||||
rowHeight: 50,
|
||||
checkedColor: AppTheme.themeMode == ThemeMode.light
|
||||
? AppTheme.of(context).secondaryColor
|
||||
: const Color(0XFF4B4B4B),
|
||||
enableRowColorAnimation: true,
|
||||
gridBackgroundColor: Colors.transparent,
|
||||
gridBorderColor: Colors.transparent,
|
||||
activatedColor: AppTheme.of(context).primaryBackground,
|
||||
activatedBorderColor: AppTheme.of(context).tertiaryColor,
|
||||
)
|
||||
: PlutoGridStyleConfig.dark(
|
||||
menuBackgroundColor: AppTheme.of(context).secondaryColor,
|
||||
gridPopupBorderRadius: BorderRadius.circular(16),
|
||||
enableColumnBorderVertical: false,
|
||||
enableColumnBorderHorizontal: false,
|
||||
enableCellBorderVertical: false,
|
||||
enableCellBorderHorizontal: true,
|
||||
columnTextStyle: AppTheme.of(context).bodyText3.override(
|
||||
fontFamily: 'Quicksand',
|
||||
color: AppTheme.of(context).alternate,
|
||||
),
|
||||
cellTextStyle: AppTheme.of(context).bodyText3,
|
||||
iconColor: AppTheme.of(context).tertiaryColor,
|
||||
rowColor: Colors.transparent,
|
||||
borderColor: const Color(0xFFF1F4FA),
|
||||
rowHeight: 50,
|
||||
checkedColor: AppTheme.themeMode == ThemeMode.light
|
||||
? AppTheme.of(context).secondaryColor
|
||||
: const Color(0XFF4B4B4B),
|
||||
enableRowColorAnimation: true,
|
||||
gridBackgroundColor: Colors.transparent,
|
||||
gridBorderColor: Colors.transparent,
|
||||
activatedColor: AppTheme.of(context).primaryBackground,
|
||||
activatedBorderColor: AppTheme.of(context).tertiaryColor,
|
||||
);
|
||||
}
|
||||
|
||||
double rowHeight = 60;
|
||||
|
||||
PlutoGridStyleConfig plutoGridPopUpStyleConfig(BuildContext context) {
|
||||
return AppTheme.themeMode == ThemeMode.light
|
||||
? PlutoGridStyleConfig(
|
||||
menuBackgroundColor: AppTheme.of(context).secondaryBackground,
|
||||
gridPopupBorderRadius: BorderRadius.circular(16),
|
||||
//
|
||||
enableColumnBorderVertical: false,
|
||||
columnTextStyle: AppTheme.of(context).bodyText3,
|
||||
iconColor: AppTheme.of(context).tertiaryColor,
|
||||
borderColor: Colors.transparent,
|
||||
//
|
||||
rowHeight: 40,
|
||||
rowColor: Colors.transparent,
|
||||
cellTextStyle: AppTheme.of(context).bodyText3.override(
|
||||
fontFamily: AppTheme.of(context).bodyText3Family,
|
||||
color: AppTheme.of(context).primaryText,
|
||||
),
|
||||
enableColumnBorderHorizontal: false,
|
||||
enableCellBorderVertical: false,
|
||||
enableCellBorderHorizontal: false,
|
||||
checkedColor: Colors.transparent,
|
||||
enableRowColorAnimation: false,
|
||||
gridBackgroundColor: Colors.transparent,
|
||||
gridBorderColor: Colors.transparent,
|
||||
//
|
||||
activatedColor: AppTheme.of(context).primaryBackground,
|
||||
activatedBorderColor: AppTheme.of(context).tertiaryColor,
|
||||
)
|
||||
: PlutoGridStyleConfig.dark(
|
||||
menuBackgroundColor: Colors.transparent,
|
||||
//
|
||||
enableColumnBorderVertical: false,
|
||||
columnTextStyle: AppTheme.of(context).copyRightText,
|
||||
iconColor: AppTheme.of(context).tertiaryColor,
|
||||
borderColor: Colors.transparent,
|
||||
//
|
||||
rowHeight: 40,
|
||||
rowColor: Colors.transparent,
|
||||
cellTextStyle: AppTheme.of(context).copyRightText,
|
||||
enableColumnBorderHorizontal: false,
|
||||
enableCellBorderVertical: false,
|
||||
enableCellBorderHorizontal: false,
|
||||
checkedColor: Colors.transparent,
|
||||
enableRowColorAnimation: false,
|
||||
gridBackgroundColor: Colors.transparent,
|
||||
gridBorderColor: Colors.transparent,
|
||||
//
|
||||
activatedColor: AppTheme.of(context).primaryBackground,
|
||||
activatedBorderColor: AppTheme.of(context).tertiaryColor,
|
||||
);
|
||||
}
|
||||
|
||||
PlutoGridStyleConfig plutoGridStyleConfigContentManager(BuildContext context,
|
||||
{double rowHeight = 50}) {
|
||||
return AppTheme.themeMode == ThemeMode.light
|
||||
? PlutoGridStyleConfig(
|
||||
menuBackgroundColor: AppTheme.of(context).secondaryColor,
|
||||
gridPopupBorderRadius: BorderRadius.circular(16),
|
||||
enableColumnBorderVertical: true,
|
||||
enableColumnBorderHorizontal: true,
|
||||
enableCellBorderVertical: true,
|
||||
enableCellBorderHorizontal: true,
|
||||
columnHeight: 100,
|
||||
columnTextStyle: AppTheme.of(context).bodyText3.override(
|
||||
fontFamily: AppTheme.of(context).bodyText3Family,
|
||||
color: AppTheme.of(context).primaryColor,
|
||||
),
|
||||
cellTextStyle: AppTheme.of(context).bodyText3,
|
||||
iconColor: AppTheme.of(context).tertiaryColor,
|
||||
rowColor: Colors.transparent,
|
||||
borderColor: const Color(0xFFF1F4FA),
|
||||
rowHeight: rowHeight,
|
||||
checkedColor: AppTheme.themeMode == ThemeMode.light
|
||||
? AppTheme.of(context).secondaryColor
|
||||
: const Color(0XFF4B4B4B),
|
||||
enableRowColorAnimation: true,
|
||||
gridBackgroundColor: Colors.transparent,
|
||||
gridBorderColor: Colors.transparent,
|
||||
activatedColor: AppTheme.of(context).primaryBackground,
|
||||
activatedBorderColor: AppTheme.of(context).tertiaryColor,
|
||||
gridBorderRadius: BorderRadius.circular(16),
|
||||
)
|
||||
: PlutoGridStyleConfig.dark(
|
||||
menuBackgroundColor: AppTheme.of(context).secondaryColor,
|
||||
gridPopupBorderRadius: BorderRadius.circular(16),
|
||||
enableColumnBorderVertical: true,
|
||||
enableColumnBorderHorizontal: true,
|
||||
enableCellBorderVertical: true,
|
||||
enableCellBorderHorizontal: true,
|
||||
columnHeight: 100,
|
||||
columnTextStyle: AppTheme.of(context).bodyText3.override(
|
||||
fontFamily: 'Quicksand',
|
||||
color: AppTheme.of(context).alternate,
|
||||
),
|
||||
cellTextStyle: AppTheme.of(context).bodyText3,
|
||||
iconColor: AppTheme.of(context).tertiaryColor,
|
||||
rowColor: Colors.transparent,
|
||||
borderColor: const Color(0xFFF1F4FA),
|
||||
rowHeight: rowHeight,
|
||||
checkedColor: AppTheme.themeMode == ThemeMode.light
|
||||
? AppTheme.of(context).secondaryColor
|
||||
: const Color(0XFF4B4B4B),
|
||||
enableRowColorAnimation: true,
|
||||
gridBackgroundColor: Colors.transparent,
|
||||
gridBorderColor: Colors.transparent,
|
||||
activatedColor: AppTheme.of(context).primaryBackground,
|
||||
activatedBorderColor: AppTheme.of(context).tertiaryColor,
|
||||
);
|
||||
}
|
||||
12
lib/helpers/scroll_behavior.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
// Create Custom Scroll Class for web Drap Behaviour:
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyCustomScrollBehavior extends MaterialScrollBehavior {
|
||||
// Override behavior methods and getters like dragDevices
|
||||
@override
|
||||
Set<PointerDeviceKind> get dragDevices => {
|
||||
PointerDeviceKind.touch,
|
||||
PointerDeviceKind.mouse,
|
||||
};
|
||||
}
|
||||
87
lib/helpers/supabase/queries.dart
Normal file
@@ -0,0 +1,87 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:supabase_flutter/supabase_flutter.dart' hide User;
|
||||
import 'package:nethive_neo/helpers/globals.dart';
|
||||
import 'package:nethive_neo/models/models.dart';
|
||||
|
||||
class SupabaseQueries {
|
||||
static Future<User?> getCurrentUserData() async {
|
||||
try {
|
||||
final user = supabase.auth.currentUser;
|
||||
if (user == null) return null;
|
||||
|
||||
final PostgrestFilterBuilder query =
|
||||
supabase.from('users').select().eq('user_profile_id', user.id);
|
||||
|
||||
final res = await query;
|
||||
|
||||
final userProfile = res[0];
|
||||
userProfile['id'] = user.id;
|
||||
userProfile['email'] = user.email!;
|
||||
|
||||
final usuario = User.fromMap(userProfile);
|
||||
|
||||
return usuario;
|
||||
} catch (e) {
|
||||
log('Error en getCurrentUserData() - $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Configuration?> getDefaultTheme() async {
|
||||
try {
|
||||
final res = await supabase.from('theme').select().eq('id', 1);
|
||||
return Configuration.fromJson(jsonEncode(res[0]));
|
||||
} catch (e) {
|
||||
log('Error en getDefaultTheme() - $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Configuration?> getUserTheme() async {
|
||||
try {
|
||||
if (currentUser == null) return null;
|
||||
final res = await supabase.from('users').select('config').eq(
|
||||
'sequential_id',
|
||||
currentUser!
|
||||
.sequentialId); //final res = await supabase.from('theme').select().eq('id', 2);
|
||||
return Configuration.fromJson(jsonEncode(res[0]));
|
||||
} catch (e) {
|
||||
log('Error en getUserTheme() - $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static Future<bool> tokenChangePassword(String id, String newPassword) async {
|
||||
try {
|
||||
final res = await supabase.rpc('token_change_password', params: {
|
||||
'user_id': id,
|
||||
'new_password': newPassword,
|
||||
});
|
||||
|
||||
if (res['data'] == true) {
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
log('Error en tokenChangePassword() - $e');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static Future<bool> saveToken(
|
||||
String userId,
|
||||
String tokenType,
|
||||
String token,
|
||||
) async {
|
||||
try {
|
||||
await supabase
|
||||
.from('token')
|
||||
.upsert({'user_id': userId, tokenType: token});
|
||||
return true;
|
||||
} catch (e) {
|
||||
log('Error en saveToken() - $e');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
44
lib/internationalization/internationalization.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class AppLocalizations {
|
||||
AppLocalizations(this.locale);
|
||||
|
||||
final Locale locale;
|
||||
|
||||
static AppLocalizations of(BuildContext context) =>
|
||||
Localizations.of<AppLocalizations>(context, AppLocalizations)!;
|
||||
|
||||
static List<String> languages() => ['en'];
|
||||
|
||||
String get languageCode => locale.languageCode;
|
||||
int get languageIndex => languages().contains(languageCode)
|
||||
? languages().indexOf(languageCode)
|
||||
: 0;
|
||||
|
||||
String getText(String key) =>
|
||||
(kTranslationsMap[key] ?? {})[locale.languageCode] ?? '';
|
||||
|
||||
String getVariableText({
|
||||
String enText = '',
|
||||
}) =>
|
||||
[enText][languageIndex];
|
||||
}
|
||||
|
||||
class AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
|
||||
const AppLocalizationsDelegate();
|
||||
|
||||
@override
|
||||
bool isSupported(Locale locale) =>
|
||||
AppLocalizations.languages().contains(locale.languageCode);
|
||||
|
||||
@override
|
||||
Future<AppLocalizations> load(Locale locale) =>
|
||||
SynchronousFuture<AppLocalizations>(AppLocalizations(locale));
|
||||
|
||||
@override
|
||||
bool shouldReload(AppLocalizationsDelegate old) => false;
|
||||
}
|
||||
|
||||
final kTranslationsMap =
|
||||
<Map<String, Map<String, String>>>[].reduce((a, b) => a..addAll(b));
|
||||
131
lib/main.dart
Normal file
@@ -0,0 +1,131 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:nethive_neo/helpers/scroll_behavior.dart';
|
||||
import 'package:nethive_neo/internationalization/internationalization.dart';
|
||||
import 'package:nethive_neo/router/router.dart';
|
||||
import 'package:nethive_neo/theme/theme.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
import 'package:nethive_neo/providers/user_provider.dart';
|
||||
import 'package:nethive_neo/providers/visual_state_provider.dart';
|
||||
import 'package:nethive_neo/providers/users_provider.dart';
|
||||
import 'package:nethive_neo/helpers/globals.dart';
|
||||
import 'package:url_strategy/url_strategy.dart';
|
||||
|
||||
import 'package:nethive_neo/helpers/constants.dart';
|
||||
import 'package:flutter_portal/flutter_portal.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
setPathUrlStrategy();
|
||||
await Supabase.initialize(
|
||||
url: supabaseUrl,
|
||||
anonKey: anonKey,
|
||||
realtimeClientOptions: const RealtimeClientOptions(
|
||||
eventsPerSecond: 2,
|
||||
),
|
||||
);
|
||||
|
||||
supabaseLU = SupabaseClient(supabaseUrl, anonKey, schema: 'nethive');
|
||||
|
||||
await initGlobals();
|
||||
|
||||
GoRouter.optionURLReflectsImperativeAPIs = true;
|
||||
|
||||
runApp(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(create: (_) => UserState()),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => VisualStateProvider(context)),
|
||||
ChangeNotifierProvider(create: (_) => UsersProvider()),
|
||||
],
|
||||
child: const MyApp(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
|
||||
static _MyAppState of(BuildContext context) =>
|
||||
context.findAncestorStateOfType<_MyAppState>()!;
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
Locale _locale = const Locale('es');
|
||||
ThemeMode _themeMode = ThemeMode.light;
|
||||
|
||||
void setLocale(Locale value) => setState(() => _locale = value);
|
||||
void setThemeMode(ThemeMode mode) => setState(() => _themeMode = mode);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Nethive Neo',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
),
|
||||
darkTheme: ThemeData.dark(),
|
||||
themeMode: _themeMode,
|
||||
locale: _locale,
|
||||
home: const Placeholder(), // Cambia esto por tu pantalla inicial
|
||||
);
|
||||
}
|
||||
}
|
||||
/* class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
|
||||
static _MyAppState of(BuildContext context) =>
|
||||
context.findAncestorStateOfType<_MyAppState>()!;
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
Locale _locale = const Locale('es');
|
||||
ThemeMode _themeMode = AppTheme.themeMode;
|
||||
|
||||
void setLocale(Locale value) => setState(() => _locale = value);
|
||||
void setThemeMode(ThemeMode mode) => setState(() {
|
||||
_themeMode = mode;
|
||||
AppTheme.saveThemeMode(mode);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Portal(
|
||||
child: MaterialApp.router(
|
||||
title: 'NETHIVE',
|
||||
debugShowCheckedModeBanner: false,
|
||||
locale: _locale,
|
||||
localizationsDelegates: const [
|
||||
AppLocalizationsDelegate(),
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: const [Locale('en', 'US')],
|
||||
theme: ThemeData(
|
||||
brightness: Brightness.light,
|
||||
dividerColor: Colors.grey,
|
||||
),
|
||||
darkTheme: ThemeData(
|
||||
brightness: Brightness.dark,
|
||||
dividerColor: Colors.grey,
|
||||
),
|
||||
themeMode: _themeMode,
|
||||
routerConfig: router,
|
||||
scrollBehavior: MyCustomScrollBehavior(),
|
||||
),
|
||||
);
|
||||
}
|
||||
} */
|
||||
34
lib/models/billing/billing_process.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class BillingProcess {
|
||||
BillingProcess({
|
||||
required this.billingProcessId,
|
||||
required this.createdAt,
|
||||
required this.createdBy,
|
||||
required this.status,
|
||||
required this.customersBilled,
|
||||
required this.totalBilled,
|
||||
});
|
||||
|
||||
int billingProcessId;
|
||||
DateTime createdAt;
|
||||
String createdBy;
|
||||
String status;
|
||||
int customersBilled;
|
||||
num totalBilled;
|
||||
|
||||
factory BillingProcess.fromJson(String str) => BillingProcess.fromMap(json.decode(str));
|
||||
|
||||
factory BillingProcess.fromMap(Map<String, dynamic> json) {
|
||||
BillingProcess billingProcess = BillingProcess(
|
||||
billingProcessId: json["billing_process_id"],
|
||||
createdAt: DateTime.parse(json['created_at']),
|
||||
createdBy: json['created_by'],
|
||||
status: json['status'],
|
||||
customersBilled: json['customers_billed'],
|
||||
totalBilled: json['total_billed'],
|
||||
);
|
||||
|
||||
return billingProcess;
|
||||
}
|
||||
}
|
||||
133
lib/models/configuration.dart
Normal file
@@ -0,0 +1,133 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class Configuration {
|
||||
Config? config;
|
||||
|
||||
Configuration({
|
||||
this.config,
|
||||
});
|
||||
|
||||
factory Configuration.fromJson(String str) => Configuration.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory Configuration.fromMap(Map<String, dynamic> json) => Configuration(
|
||||
config: json["config"] == null ? null : Config.fromMap(json["config"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"config": config?.toMap(),
|
||||
};
|
||||
}
|
||||
|
||||
class Config {
|
||||
Mode? dark;
|
||||
Mode? light;
|
||||
Logos? logos;
|
||||
|
||||
Config({
|
||||
this.dark,
|
||||
this.light,
|
||||
this.logos,
|
||||
});
|
||||
|
||||
factory Config.fromJson(String str) => Config.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory Config.fromMap(Map<String, dynamic> json) => Config(
|
||||
dark: json["dark"] == null ? null : Mode.fromMap(json["dark"]),
|
||||
light: json["light"] == null ? null : Mode.fromMap(json["light"]),
|
||||
logos: json["logos"] == null ? null : Logos.fromMap(json["logos"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"dark": dark?.toMap(),
|
||||
"light": light?.toMap(),
|
||||
"logos": logos?.toMap(),
|
||||
};
|
||||
}
|
||||
|
||||
class Mode {
|
||||
String? hintText;
|
||||
String? alternate;
|
||||
String? primaryText;
|
||||
String? primaryColor;
|
||||
String? tertiaryText;
|
||||
String? secondaryText;
|
||||
String? tertiaryColor;
|
||||
String? secondaryColor;
|
||||
String? primaryBackground;
|
||||
String? tertiaryBackground;
|
||||
String? secondaryBackground;
|
||||
|
||||
Mode({
|
||||
this.hintText,
|
||||
this.alternate,
|
||||
this.primaryText,
|
||||
this.primaryColor,
|
||||
this.tertiaryText,
|
||||
this.secondaryText,
|
||||
this.tertiaryColor,
|
||||
this.secondaryColor,
|
||||
this.primaryBackground,
|
||||
this.tertiaryBackground,
|
||||
this.secondaryBackground,
|
||||
});
|
||||
|
||||
factory Mode.fromJson(String str) => Mode.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory Mode.fromMap(Map<String, dynamic> json) => Mode(
|
||||
hintText: json["hintText"],
|
||||
alternate: json["alternate"],
|
||||
primaryText: json["primaryText"],
|
||||
primaryColor: json["primaryColor"],
|
||||
tertiaryText: json["tertiaryText"],
|
||||
secondaryText: json["secondaryText"],
|
||||
tertiaryColor: json["tertiaryColor"],
|
||||
secondaryColor: json["secondaryColor"],
|
||||
primaryBackground: json["primaryBackground"],
|
||||
tertiaryBackground: json["tertiaryBackground"],
|
||||
secondaryBackground: json["secondaryBackground"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"hintText": hintText,
|
||||
"alternate": alternate,
|
||||
"primaryText": primaryText,
|
||||
"primaryColor": primaryColor,
|
||||
"tertiaryText": tertiaryText,
|
||||
"secondaryText": secondaryText,
|
||||
"tertiaryColor": tertiaryColor,
|
||||
"secondaryColor": secondaryColor,
|
||||
"primaryBackground": primaryBackground,
|
||||
"tertiaryBackground": tertiaryBackground,
|
||||
"secondaryBackground": secondaryBackground,
|
||||
};
|
||||
}
|
||||
|
||||
class Logos {
|
||||
String? logoColor;
|
||||
String? logoBlanco;
|
||||
|
||||
Logos({
|
||||
this.logoColor,
|
||||
this.logoBlanco,
|
||||
});
|
||||
|
||||
factory Logos.fromJson(String str) => Logos.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory Logos.fromMap(Map<String, dynamic> json) => Logos(
|
||||
logoColor: json["logoColor"],
|
||||
logoBlanco: json["logoBlanco"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"logoColor": logoColor,
|
||||
"logoBlanco": logoBlanco,
|
||||
};
|
||||
}
|
||||
130
lib/models/content_manager/ad_by_genre.dart
Normal file
@@ -0,0 +1,130 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class AdsByGenre {
|
||||
String genreName;
|
||||
int videoCount;
|
||||
int rowNumber;
|
||||
List<Video> videos;
|
||||
int genreId;
|
||||
dynamic genrePoster;
|
||||
String? storageCategoryImageFileName;
|
||||
bool isExpanded = false;
|
||||
AdsByGenre({
|
||||
required this.genreName,
|
||||
required this.videoCount,
|
||||
required this.rowNumber,
|
||||
required this.videos,
|
||||
required this.genreId,
|
||||
required this.genrePoster,
|
||||
required this.storageCategoryImageFileName,
|
||||
});
|
||||
|
||||
factory AdsByGenre.fromJson(String str) =>
|
||||
AdsByGenre.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory AdsByGenre.fromMap(Map<String, dynamic> json) => AdsByGenre(
|
||||
genreName: json["genre_name"],
|
||||
videoCount: json["video_count"],
|
||||
rowNumber: json["row_number"],
|
||||
videos: List<Video>.from(json["videos"].map((x) => Video.fromMap(x))),
|
||||
genreId: json["genre_id"],
|
||||
genrePoster: json["genre_poster"],
|
||||
storageCategoryImageFileName: json["poster_image_file"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"genre_name": genreName,
|
||||
"video_count": videoCount,
|
||||
"row_number": rowNumber,
|
||||
"videos": List<dynamic>.from(videos.map((x) => x.toMap())),
|
||||
"genre_id": genreId,
|
||||
"genre_poster": genrePoster,
|
||||
"poster_image_file": storageCategoryImageFileName,
|
||||
};
|
||||
}
|
||||
|
||||
class Video {
|
||||
String title;
|
||||
int points;
|
||||
dynamic status;
|
||||
dynamic urlAd;
|
||||
dynamic partner;
|
||||
int duration;
|
||||
String overview;
|
||||
int priority;
|
||||
int videoId;
|
||||
String videoUrl;
|
||||
List<String> categories;
|
||||
DateTime createdAt;
|
||||
String posterPath;
|
||||
bool videoStatus;
|
||||
dynamic expirationDate;
|
||||
String videoFileName;
|
||||
String posterFileName;
|
||||
|
||||
Video({
|
||||
required this.title,
|
||||
required this.points,
|
||||
required this.status,
|
||||
required this.urlAd,
|
||||
required this.partner,
|
||||
required this.duration,
|
||||
required this.overview,
|
||||
required this.priority,
|
||||
required this.videoId,
|
||||
required this.videoUrl,
|
||||
required this.categories,
|
||||
required this.createdAt,
|
||||
required this.posterPath,
|
||||
required this.videoStatus,
|
||||
required this.expirationDate,
|
||||
required this.videoFileName,
|
||||
required this.posterFileName,
|
||||
});
|
||||
|
||||
factory Video.fromJson(String str) => Video.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory Video.fromMap(Map<String, dynamic> json) => Video(
|
||||
title: json["title"],
|
||||
points: json["points"],
|
||||
status: json["status"],
|
||||
urlAd: json["url_ad"],
|
||||
partner: json["partner"],
|
||||
duration: json["duration"],
|
||||
overview: json["overview"],
|
||||
priority: json["priority"],
|
||||
videoId: json["video_id"],
|
||||
videoUrl: json["video_url"],
|
||||
categories: List<String>.from(json["categories"].map((x) => x)),
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
posterPath: json["poster_path"],
|
||||
videoStatus: json["video_status"],
|
||||
expirationDate: json["expiration_date"],
|
||||
videoFileName: json["video_file_name"],
|
||||
posterFileName: json["poster_file_name"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"title": title,
|
||||
"points": points,
|
||||
"status": status,
|
||||
"url_ad": urlAd,
|
||||
"partner": partner,
|
||||
"duration": duration,
|
||||
"overview": overview,
|
||||
"priority": priority,
|
||||
"video_id": videoId,
|
||||
"video_url": videoUrl,
|
||||
"categories": List<dynamic>.from(categories.map((x) => x)),
|
||||
"created_at": createdAt.toIso8601String(),
|
||||
"poster_path": posterPath,
|
||||
"video_status": videoStatus,
|
||||
"expiration_date": expirationDate,
|
||||
"video_file_name": videoFileName,
|
||||
"poster_file_name": posterFileName,
|
||||
};
|
||||
}
|
||||
125
lib/models/content_manager/all_ads_one_table_model.dart
Normal file
@@ -0,0 +1,125 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class AllAdsOneTableModel {
|
||||
final int id;
|
||||
final int? rowNumber; // Opcional, para el campo row_number
|
||||
final DateTime createdAt;
|
||||
final DateTime updatedAt;
|
||||
final String overview;
|
||||
final String posterPath;
|
||||
final String title;
|
||||
final String video; // Corresponde a video_url
|
||||
final int durationVideo;
|
||||
final dynamic urlAd; // Añadido para url_ad
|
||||
final int priority;
|
||||
final bool videoStatus; // Cambiado de status text a videoStatus boolean
|
||||
final dynamic expirationDate;
|
||||
final int points;
|
||||
final String? videoFileName;
|
||||
final dynamic partner;
|
||||
final String posterFileName;
|
||||
final List<dynamic> categories;
|
||||
final List<Map<String, dynamic>>
|
||||
qrCodes; // Puede ser List<dynamic> o Map<String, dynamic>
|
||||
final int warningCount;
|
||||
|
||||
AllAdsOneTableModel({
|
||||
required this.id,
|
||||
this.rowNumber,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
required this.overview,
|
||||
required this.posterPath,
|
||||
required this.title,
|
||||
required this.video,
|
||||
required this.durationVideo,
|
||||
this.urlAd, // Añadido
|
||||
required this.priority,
|
||||
required this.videoStatus, // Requerido y de tipo bool
|
||||
this.expirationDate,
|
||||
required this.points,
|
||||
this.videoFileName,
|
||||
this.partner,
|
||||
required this.posterFileName,
|
||||
required this.categories,
|
||||
required this.qrCodes,
|
||||
required this.warningCount,
|
||||
});
|
||||
|
||||
factory AllAdsOneTableModel.fromJson(String str) =>
|
||||
AllAdsOneTableModel.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory AllAdsOneTableModel.fromMap(Map<String, dynamic> json) {
|
||||
// Procesamiento de qrCodes similar al de CouponsModel
|
||||
final rawQrCodes = json["qr_codes"];
|
||||
|
||||
final parsedQrCodes = rawQrCodes is List
|
||||
? rawQrCodes
|
||||
.map((e) {
|
||||
if (e is String) {
|
||||
try {
|
||||
return Map<String, dynamic>.from(jsonDecode(e));
|
||||
} catch (e) {
|
||||
return {};
|
||||
}
|
||||
} else if (e is Map) {
|
||||
return Map<String, dynamic>.from(e);
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
})
|
||||
.toList()
|
||||
.cast<Map<String, dynamic>>() // 🔥 necesario sí o sí
|
||||
: [];
|
||||
|
||||
return AllAdsOneTableModel(
|
||||
id: json["video_id"] ?? json["id"],
|
||||
rowNumber: json["row_number"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updatedAt: DateTime.parse(json["updated_at"]),
|
||||
overview: json["overview"],
|
||||
posterPath: json["poster_path"],
|
||||
title: json["title"],
|
||||
video: json["video_url"],
|
||||
durationVideo: json["duration_video"],
|
||||
urlAd: json["url_ad"], // Mapeo para url_ad
|
||||
priority: json["priority"],
|
||||
videoStatus: json["video_status"], // Mapeo para video_status
|
||||
expirationDate: json["expiration_date"],
|
||||
points: json["points"],
|
||||
videoFileName: json["video_file_name"],
|
||||
partner: json["partner"],
|
||||
posterFileName: json["poster_file_name"],
|
||||
categories: json["categories"] == null
|
||||
? []
|
||||
: List<dynamic>.from(json["categories"].map((x) => x)),
|
||||
qrCodes: parsedQrCodes.cast<Map<String, dynamic>>(),
|
||||
warningCount: json["warning_count"],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"video_id": id,
|
||||
"row_number": rowNumber,
|
||||
"created_at": createdAt.toIso8601String(),
|
||||
"updated_at": updatedAt.toIso8601String(),
|
||||
"overview": overview,
|
||||
"poster_path": posterPath,
|
||||
"title": title,
|
||||
"video_url": video,
|
||||
"duration_video": durationVideo,
|
||||
"url_ad": urlAd, // Añadido
|
||||
"priority": priority,
|
||||
"video_status": videoStatus,
|
||||
"expiration_date": expirationDate,
|
||||
"points": points,
|
||||
"video_file_name": videoFileName,
|
||||
"partner": partner,
|
||||
"poster_file_name": posterFileName,
|
||||
"categories": List<dynamic>.from(categories.map((x) => x)),
|
||||
"qr_codes": qrCodes,
|
||||
"warning_count": warningCount,
|
||||
};
|
||||
}
|
||||
83
lib/models/content_manager/all_books_one_table_model.dart
Normal file
@@ -0,0 +1,83 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class AllBooksOneTableModel {
|
||||
int rowNumber;
|
||||
int bookId;
|
||||
DateTime createdAt;
|
||||
String bookDescription;
|
||||
String title;
|
||||
String book;
|
||||
String size;
|
||||
String year;
|
||||
String? bookCover;
|
||||
int autorFk;
|
||||
int statusFk;
|
||||
String bookStatus;
|
||||
String autorFirstName;
|
||||
String autorLastName;
|
||||
String? autorFullName;
|
||||
List<String?> categories;
|
||||
|
||||
AllBooksOneTableModel({
|
||||
required this.rowNumber,
|
||||
required this.bookId,
|
||||
required this.createdAt,
|
||||
required this.bookDescription,
|
||||
required this.title,
|
||||
required this.book,
|
||||
required this.size,
|
||||
required this.year,
|
||||
required this.bookCover,
|
||||
required this.autorFk,
|
||||
required this.statusFk,
|
||||
required this.bookStatus,
|
||||
required this.autorFirstName,
|
||||
required this.autorLastName,
|
||||
required this.autorFullName,
|
||||
required this.categories,
|
||||
});
|
||||
|
||||
factory AllBooksOneTableModel.fromJson(String str) =>
|
||||
AllBooksOneTableModel.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory AllBooksOneTableModel.fromMap(Map<String, dynamic> json) =>
|
||||
AllBooksOneTableModel(
|
||||
rowNumber: json["row_number"],
|
||||
bookId: json["book_id"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
bookDescription: json["book_description"],
|
||||
title: json["title"],
|
||||
book: json["book"],
|
||||
size: json["size"],
|
||||
year: json["year"],
|
||||
bookCover: json["book_cover"],
|
||||
autorFk: json["autor_fk"],
|
||||
statusFk: json["status_fk"],
|
||||
bookStatus: json["book_status"],
|
||||
autorFirstName: json["autor_first_name"],
|
||||
autorLastName: json["autor_last_name"],
|
||||
autorFullName: json["autor_name"],
|
||||
categories: List<String?>.from(json["categories"].map((x) => x)),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"row_number": rowNumber,
|
||||
"book_id": bookId,
|
||||
"created_at": createdAt.toIso8601String(),
|
||||
"book_description": bookDescription,
|
||||
"title": title,
|
||||
"book": book,
|
||||
"size": size,
|
||||
"year": year,
|
||||
"book_cover": bookCover,
|
||||
"autor_fk": autorFk,
|
||||
"status_fk": statusFk,
|
||||
"book_status": bookStatus,
|
||||
"autor_first_name": autorFirstName,
|
||||
"autor_last_name": autorLastName,
|
||||
"autor_name": autorFullName,
|
||||
"categories": List<dynamic>.from(categories.map((x) => x)),
|
||||
};
|
||||
}
|
||||
69
lib/models/content_manager/book.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class Book {
|
||||
int bookId;
|
||||
String title;
|
||||
String bookDescription;
|
||||
DateTime createdAt;
|
||||
String book;
|
||||
String bookCover;
|
||||
String size;
|
||||
String year;
|
||||
String bookStatus;
|
||||
int autorId;
|
||||
String autorFirstName;
|
||||
String? autorLastName;
|
||||
String category;
|
||||
|
||||
Book({
|
||||
required this.bookId,
|
||||
required this.title,
|
||||
required this.bookDescription,
|
||||
required this.createdAt,
|
||||
required this.book,
|
||||
required this.bookCover,
|
||||
required this.size,
|
||||
required this.year,
|
||||
required this.bookStatus,
|
||||
required this.autorId,
|
||||
required this.autorFirstName,
|
||||
required this.autorLastName,
|
||||
required this.category,
|
||||
});
|
||||
|
||||
factory Book.fromJson(String str) => Book.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory Book.fromMap(Map<String, dynamic> json) => Book(
|
||||
bookId: json["book_id"],
|
||||
title: json["title"],
|
||||
bookDescription: json["book_description"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
book: json["book"],
|
||||
bookCover: json["book_cover"],
|
||||
size: json["size"],
|
||||
year: json["year"],
|
||||
bookStatus: json["book_status"],
|
||||
autorId: json["autor_id"],
|
||||
autorFirstName: json["autor_first_name"],
|
||||
autorLastName: json["autor_last_name"],
|
||||
category: json["category"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"book_id": bookId,
|
||||
"title": title,
|
||||
"book_description": bookDescription,
|
||||
"created_at": createdAt.toIso8601String(),
|
||||
"book": book,
|
||||
"book_cover": bookCover,
|
||||
"size": size,
|
||||
"year": year,
|
||||
"book_status": bookStatus,
|
||||
"autor_id": autorId,
|
||||
"autor_first_name": autorFirstName,
|
||||
"autor_last_name": autorLastName,
|
||||
"category": category,
|
||||
};
|
||||
}
|
||||
124
lib/models/content_manager/book_by_genre.dart
Normal file
@@ -0,0 +1,124 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class BooksByGenreModel {
|
||||
String genreName;
|
||||
int bookCount;
|
||||
int rowNumber;
|
||||
List<Book> books;
|
||||
int genreId;
|
||||
dynamic genrePoster;
|
||||
dynamic posterImageFile;
|
||||
bool isExpanded = false;
|
||||
|
||||
BooksByGenreModel({
|
||||
required this.genreName,
|
||||
required this.bookCount,
|
||||
required this.rowNumber,
|
||||
required this.books,
|
||||
required this.genreId,
|
||||
required this.genrePoster,
|
||||
required this.posterImageFile,
|
||||
});
|
||||
|
||||
factory BooksByGenreModel.fromJson(String str) =>
|
||||
BooksByGenreModel.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory BooksByGenreModel.fromMap(Map<String, dynamic> json) =>
|
||||
BooksByGenreModel(
|
||||
genreName: json["genre_name"],
|
||||
bookCount: json["book_count"],
|
||||
rowNumber: json["row_number"],
|
||||
books: List<Book>.from(json["books"].map((x) => Book.fromMap(x))),
|
||||
genreId: json["genre_id"],
|
||||
genrePoster: json["genre_poster"],
|
||||
posterImageFile: json["poster_image_file"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"genre_name": genreName,
|
||||
"book_count": bookCount,
|
||||
"row_number": rowNumber,
|
||||
"books": List<dynamic>.from(books.map((x) => x.toMap())),
|
||||
"genre_id": genreId,
|
||||
"genre_poster": genrePoster,
|
||||
"poster_image_file": posterImageFile,
|
||||
};
|
||||
}
|
||||
|
||||
class Book {
|
||||
String size;
|
||||
String year;
|
||||
String title;
|
||||
String status;
|
||||
int bookId;
|
||||
int autorId;
|
||||
String bookUrl;
|
||||
String overview;
|
||||
int statusId;
|
||||
String? bookCover;
|
||||
List<String> categories;
|
||||
DateTime createdAt;
|
||||
String autorLastName;
|
||||
String autorFirstName;
|
||||
String? autorFullName = '';
|
||||
|
||||
Book({
|
||||
required this.size,
|
||||
required this.year,
|
||||
required this.title,
|
||||
required this.status,
|
||||
required this.bookId,
|
||||
required this.autorId,
|
||||
required this.bookUrl,
|
||||
required this.overview,
|
||||
required this.statusId,
|
||||
required this.bookCover,
|
||||
required this.categories,
|
||||
required this.createdAt,
|
||||
required this.autorLastName,
|
||||
required this.autorFirstName,
|
||||
required this.autorFullName,
|
||||
});
|
||||
|
||||
factory Book.fromJson(String str) => Book.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory Book.fromMap(Map<String, dynamic> json) => Book(
|
||||
size: json["size"],
|
||||
year: json["year"],
|
||||
title: json["title"],
|
||||
status: json["status"],
|
||||
bookId: json["book_id"],
|
||||
autorId: json["autor_id"],
|
||||
bookUrl: json["book_url"],
|
||||
overview: json["overview"],
|
||||
statusId: json["status_id"],
|
||||
bookCover: json["book_cover"],
|
||||
categories: List<String>.from(json["categories"].map((x) => x)),
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
autorLastName: json["autor_last_name"],
|
||||
autorFirstName: json["autor_first_name"],
|
||||
autorFullName: json["autor_name"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"size": size,
|
||||
"year": year,
|
||||
"title": title,
|
||||
"status": status,
|
||||
"book_id": bookId,
|
||||
"autor_id": autorId,
|
||||
"book_url": bookUrl,
|
||||
"overview": overview,
|
||||
"status_id": statusId,
|
||||
"book_cover": bookCover,
|
||||
"categories": List<dynamic>.from(categories.map((x) => x)),
|
||||
"created_at": createdAt.toIso8601String(),
|
||||
"autor_last_name": autorLastName,
|
||||
"autor_first_name": autorFirstName,
|
||||
"autor_name": autorFullName,
|
||||
};
|
||||
}
|
||||
30
lib/models/content_manager/category_model.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class CategoryModel {
|
||||
int categoryId;
|
||||
DateTime createdAt;
|
||||
String name;
|
||||
|
||||
CategoryModel({
|
||||
required this.categoryId,
|
||||
required this.createdAt,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
factory CategoryModel.fromJson(String str) =>
|
||||
CategoryModel.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory CategoryModel.fromMap(Map<String, dynamic> json) => CategoryModel(
|
||||
categoryId: json["category_id"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
name: json["name"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"category_id": categoryId,
|
||||
"created_at": createdAt.toIso8601String(),
|
||||
"name": name,
|
||||
};
|
||||
}
|
||||
122
lib/models/coupons_manager/coupons_manager.dart
Normal file
@@ -0,0 +1,122 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class CouponsModel {
|
||||
int rowNumber;
|
||||
int couponId;
|
||||
DateTime createdAt;
|
||||
DateTime updateAt;
|
||||
String title;
|
||||
String description;
|
||||
String termConditions;
|
||||
num discountValue;
|
||||
String discountTypeName;
|
||||
String discountTypeDescription;
|
||||
DateTime startDate;
|
||||
DateTime endDate;
|
||||
bool isActive;
|
||||
int usageLimit;
|
||||
String categoryName;
|
||||
bool categoryVisible;
|
||||
String categoryImageFile;
|
||||
bool videoRequired;
|
||||
dynamic couponImageFile;
|
||||
dynamic outLink;
|
||||
List<Map<String, dynamic>> qrCodes;
|
||||
|
||||
CouponsModel({
|
||||
required this.rowNumber,
|
||||
required this.couponId,
|
||||
required this.createdAt,
|
||||
required this.updateAt,
|
||||
required this.title,
|
||||
required this.description,
|
||||
required this.termConditions,
|
||||
required this.discountValue,
|
||||
required this.discountTypeName,
|
||||
required this.discountTypeDescription,
|
||||
required this.startDate,
|
||||
required this.endDate,
|
||||
required this.isActive,
|
||||
required this.usageLimit,
|
||||
required this.categoryName,
|
||||
required this.categoryVisible,
|
||||
required this.categoryImageFile,
|
||||
required this.videoRequired,
|
||||
required this.couponImageFile,
|
||||
required this.outLink,
|
||||
required this.qrCodes,
|
||||
});
|
||||
|
||||
factory CouponsModel.fromMap(Map<String, dynamic> json) {
|
||||
// Aseguramos que qrCodes sea una lista de Map<String, dynamic>
|
||||
final rawQrCodes = json["qr_codes"];
|
||||
|
||||
final parsedQrCodes = rawQrCodes is List
|
||||
? rawQrCodes
|
||||
.map((e) {
|
||||
if (e is String) {
|
||||
try {
|
||||
return Map<String, dynamic>.from(jsonDecode(e));
|
||||
} catch (e) {
|
||||
return {};
|
||||
}
|
||||
} else if (e is Map) {
|
||||
return Map<String, dynamic>.from(e);
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
})
|
||||
.toList()
|
||||
.cast<Map<String, dynamic>>() // 🔥 necesario sí o sí
|
||||
: [];
|
||||
return CouponsModel(
|
||||
rowNumber: json["row_number"],
|
||||
couponId: json["coupon_id"],
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updateAt: DateTime.parse(json["update_at"]),
|
||||
title: json["title"],
|
||||
description: json["description"],
|
||||
termConditions: json["term_conditions"],
|
||||
discountValue: json["discount_value"],
|
||||
discountTypeName: json["discount_type_name"],
|
||||
discountTypeDescription: json["discount_type_description"],
|
||||
startDate: DateTime.parse(json["start_date"]),
|
||||
endDate: DateTime.parse(json["end_date"]),
|
||||
isActive: json["is_active"],
|
||||
usageLimit: json["usage_limit"],
|
||||
categoryName: json["category_name"],
|
||||
categoryVisible: json["category_visible"],
|
||||
categoryImageFile: json["category_image_file"],
|
||||
videoRequired: json["video_required"],
|
||||
couponImageFile: json["coupon_image_file"],
|
||||
outLink: json["out_link"],
|
||||
qrCodes: parsedQrCodes.cast<Map<String, dynamic>>(),
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"row_number": rowNumber,
|
||||
"coupon_id": couponId,
|
||||
"created_at": createdAt.toIso8601String(),
|
||||
"update_at": updateAt.toIso8601String(),
|
||||
"title": title,
|
||||
"description": description,
|
||||
"term_conditions": termConditions,
|
||||
"discount_value": discountValue,
|
||||
"discount_type_name": discountTypeName,
|
||||
"discount_type_description": discountTypeDescription,
|
||||
"start_date": startDate.toIso8601String(),
|
||||
"end_date": endDate.toIso8601String(),
|
||||
"is_active": isActive,
|
||||
"usage_limit": usageLimit,
|
||||
"category_name": categoryName,
|
||||
"category_visible": categoryVisible,
|
||||
"category_image_file": categoryImageFile,
|
||||
"video_required": videoRequired,
|
||||
"coupon_image_file": couponImageFile,
|
||||
"out_link": outLink,
|
||||
"qr_codes": qrCodes,
|
||||
};
|
||||
}
|
||||
93
lib/models/crm/clientes_model.dart
Normal file
@@ -0,0 +1,93 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class ClientesModel {
|
||||
int? customerId;
|
||||
String? firstName;
|
||||
String? lastName;
|
||||
String? email;
|
||||
String? telefono;
|
||||
String? zipcode;
|
||||
DateTime? createdAt;
|
||||
String? direccion;
|
||||
String? ciudad;
|
||||
String? estado;
|
||||
String? proximaActualizacion;
|
||||
String? creadoPor;
|
||||
String? imagen;
|
||||
int? diasDisponibles;
|
||||
int? id;
|
||||
String? empresa;
|
||||
int? qr;
|
||||
String? service;
|
||||
String? status;
|
||||
|
||||
ClientesModel({
|
||||
this.customerId,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.email,
|
||||
this.telefono,
|
||||
this.zipcode,
|
||||
this.createdAt,
|
||||
this.direccion,
|
||||
this.ciudad,
|
||||
this.estado,
|
||||
this.proximaActualizacion,
|
||||
this.creadoPor,
|
||||
this.imagen,
|
||||
this.diasDisponibles,
|
||||
this.id,
|
||||
this.empresa,
|
||||
this.qr,
|
||||
this.service,
|
||||
this.status,
|
||||
});
|
||||
|
||||
factory ClientesModel.fromJson(String str) => ClientesModel.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory ClientesModel.fromMap(Map<String, dynamic> json) => ClientesModel(
|
||||
customerId: json["customer_id"],
|
||||
firstName: json["first_name"],
|
||||
lastName: json["last_name"],
|
||||
email: json["email"],
|
||||
telefono: json["telefono"],
|
||||
zipcode: json["zipcode"],
|
||||
createdAt: json["created_at"] == null ? null : DateTime.parse(json["created_at"]),
|
||||
direccion: json["direccion"],
|
||||
ciudad: json["ciudad"],
|
||||
estado: json["estado"],
|
||||
proximaActualizacion: json["proxima_actualizacion"],
|
||||
creadoPor: json["creado_por"],
|
||||
imagen: json["imagen"],
|
||||
diasDisponibles: json["dias_disponibles"],
|
||||
id: json["id"],
|
||||
empresa: json["empresa"],
|
||||
qr: json["qr"],
|
||||
service: json["service"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"customer_id": customerId,
|
||||
"first_name": firstName,
|
||||
"last_name": lastName,
|
||||
"email": email,
|
||||
"telefono": telefono,
|
||||
"zipcode": zipcode,
|
||||
"created_at": createdAt?.toIso8601String(),
|
||||
"direccion": direccion,
|
||||
"ciudad": ciudad,
|
||||
"estado": estado,
|
||||
"proxima_actualizacion": proximaActualizacion,
|
||||
"creado_por": creadoPor,
|
||||
"imagen": imagen,
|
||||
"dias_disponibles": diasDisponibles,
|
||||
"id": id,
|
||||
"empresa": empresa,
|
||||
"qr": qr,
|
||||
"service": service,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
44
lib/models/customers/address.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:nethive_neo/models/state.dart';
|
||||
|
||||
class Address {
|
||||
Address({
|
||||
required this.id,
|
||||
required this.address1,
|
||||
required this.address2,
|
||||
required this.zipcode,
|
||||
required this.city,
|
||||
required this.stateFk,
|
||||
required this.state,
|
||||
required this.country,
|
||||
});
|
||||
|
||||
int id;
|
||||
String address1;
|
||||
String? address2;
|
||||
String zipcode;
|
||||
String city;
|
||||
int stateFk;
|
||||
StateAPI state;
|
||||
String country;
|
||||
|
||||
String get fullAddress => '$address1 $city, ${state.code} $zipcode $country';
|
||||
|
||||
factory Address.fromJson(String str) => Address.fromMap(json.decode(str));
|
||||
|
||||
factory Address.fromMap(Map<String, dynamic> json) {
|
||||
Address address = Address(
|
||||
id: json["address_id"],
|
||||
address1: json['address_1'],
|
||||
address2: json['address_2'],
|
||||
zipcode: json['zipcode'],
|
||||
city: json['city'],
|
||||
stateFk: json['state_fk'],
|
||||
state: StateAPI.fromMap(json['state']),
|
||||
country: json['country'],
|
||||
);
|
||||
|
||||
return address;
|
||||
}
|
||||
}
|
||||
31
lib/models/customers/bill_cycle.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class BillCycle {
|
||||
BillCycle({
|
||||
required this.customerId,
|
||||
required this.day,
|
||||
required this.billDueDay,
|
||||
required this.graceDays,
|
||||
required this.frequency,
|
||||
});
|
||||
|
||||
int customerId;
|
||||
int day;
|
||||
int billDueDay;
|
||||
int graceDays;
|
||||
int frequency;
|
||||
|
||||
factory BillCycle.fromJson(String str) => BillCycle.fromMap(json.decode(str));
|
||||
|
||||
factory BillCycle.fromMap(Map<String, dynamic> json) {
|
||||
BillCycle billCycle = BillCycle(
|
||||
customerId: json["customer_id"],
|
||||
day: json['day'],
|
||||
billDueDay: json['bill_due_day'],
|
||||
graceDays: json['grace_days'],
|
||||
frequency: json['frequency'],
|
||||
);
|
||||
|
||||
return billCycle;
|
||||
}
|
||||
}
|
||||
33
lib/models/customers/credit_card.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class CreditCard {
|
||||
CreditCard({
|
||||
required this.creditCardId,
|
||||
required this.type,
|
||||
required this.token,
|
||||
required this.automatic,
|
||||
required this.customerFk,
|
||||
});
|
||||
|
||||
int creditCardId;
|
||||
String type;
|
||||
String token;
|
||||
bool automatic;
|
||||
int customerFk;
|
||||
|
||||
String get last4Digits => token.substring(token.length - 4);
|
||||
|
||||
factory CreditCard.fromJson(String str) => CreditCard.fromMap(json.decode(str));
|
||||
|
||||
factory CreditCard.fromMap(Map<String, dynamic> json) {
|
||||
CreditCard creditCard = CreditCard(
|
||||
creditCardId: json["credit_card_id"],
|
||||
type: json['type'] ?? 'Credit Card',
|
||||
token: json['token'],
|
||||
automatic: json['automatic'] ?? true,
|
||||
customerFk: json['customer_fk'],
|
||||
);
|
||||
|
||||
return creditCard;
|
||||
}
|
||||
}
|
||||
45
lib/models/customers/customer.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class Customer {
|
||||
Customer({
|
||||
required this.id,
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
required this.email,
|
||||
required this.createdAt,
|
||||
required this.status,
|
||||
required this.phoneNumber,
|
||||
required this.balance,
|
||||
this.image,
|
||||
});
|
||||
|
||||
int id;
|
||||
String firstName;
|
||||
String lastName;
|
||||
String email;
|
||||
DateTime createdAt;
|
||||
String status;
|
||||
String phoneNumber;
|
||||
num balance;
|
||||
String? image;
|
||||
|
||||
String get fullName => '$firstName $lastName';
|
||||
|
||||
factory Customer.fromJson(String str) => Customer.fromMap(json.decode(str));
|
||||
|
||||
factory Customer.fromMap(Map<String, dynamic> json) {
|
||||
Customer customer = Customer(
|
||||
id: json["customer_id"],
|
||||
firstName: json['first_name'],
|
||||
lastName: json['last_name'],
|
||||
email: json["email"],
|
||||
createdAt: DateTime.parse(json['created_at']),
|
||||
status: json['status'],
|
||||
phoneNumber: json['mobile_phone'],
|
||||
balance: json['balance'] ?? 0.00,
|
||||
image: json['image'],
|
||||
);
|
||||
|
||||
return customer;
|
||||
}
|
||||
}
|
||||
37
lib/models/customers/customer_dashboards.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class CustomerDashboards {
|
||||
int? customerId;
|
||||
DateTime? createdAt;
|
||||
String? firstName;
|
||||
String? lastName;
|
||||
String? status;
|
||||
|
||||
CustomerDashboards({
|
||||
this.customerId,
|
||||
this.createdAt,
|
||||
this.firstName,
|
||||
this.lastName,
|
||||
this.status,
|
||||
});
|
||||
|
||||
factory CustomerDashboards.fromJson(String str) => CustomerDashboards.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory CustomerDashboards.fromMap(Map<String, dynamic> json) => CustomerDashboards(
|
||||
customerId: json["customer_id"],
|
||||
createdAt: json["created_at"] == null ? null : DateTime.parse(json["created_at"]),
|
||||
firstName: json["first_name"],
|
||||
lastName: json["last_name"],
|
||||
status: json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"customer_id": customerId,
|
||||
"created_at": createdAt?.toIso8601String(),
|
||||
"first_name": firstName,
|
||||
"last_name": lastName,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
72
lib/models/customers/customer_details.dart
Normal file
@@ -0,0 +1,72 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:nethive_neo/models/models.dart';
|
||||
|
||||
class CustomerDetails {
|
||||
CustomerDetails({
|
||||
required this.id,
|
||||
required this.createdDate,
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
required this.email,
|
||||
required this.billingAddress,
|
||||
required this.status,
|
||||
required this.phoneNumber,
|
||||
required this.balance,
|
||||
this.image,
|
||||
required this.billCycle,
|
||||
required this.services,
|
||||
required this.notes,
|
||||
required this.messages,
|
||||
});
|
||||
|
||||
int id;
|
||||
DateTime createdDate;
|
||||
String firstName;
|
||||
String lastName;
|
||||
String email;
|
||||
Address billingAddress;
|
||||
String status;
|
||||
String phoneNumber;
|
||||
num balance;
|
||||
String? image;
|
||||
BillCycle billCycle;
|
||||
List<Service> services;
|
||||
List<Note> notes;
|
||||
List<Message> messages;
|
||||
|
||||
String get fullName => '$firstName $lastName';
|
||||
|
||||
DateTime get billingDate {
|
||||
final now = DateTime.now();
|
||||
return DateTime(now.year, now.month, billCycle.day);
|
||||
}
|
||||
|
||||
factory CustomerDetails.fromJson(String str) =>
|
||||
CustomerDetails.fromMap(json.decode(str));
|
||||
|
||||
factory CustomerDetails.fromMap(Map<String, dynamic> json) {
|
||||
CustomerDetails customer = CustomerDetails(
|
||||
id: json["customer_id"],
|
||||
createdDate: DateTime.parse(json['created_date']),
|
||||
firstName: json['first_name'],
|
||||
lastName: json['last_name'],
|
||||
email: json["email"],
|
||||
billingAddress: Address.fromMap(json['billing_address']),
|
||||
status: json['status'],
|
||||
phoneNumber: json['mobile_phone'],
|
||||
balance: json['balance'] ?? 0.00,
|
||||
image: json['image'],
|
||||
billCycle: BillCycle.fromMap(json['billing_cycle']),
|
||||
services: (json['services'] as List)
|
||||
.map((service) => Service.fromMap(service))
|
||||
.toList(),
|
||||
notes: (json['notes'] as List).map((note) => Note.fromMap(note)).toList(),
|
||||
messages: (json['messages'] as List)
|
||||
.map((note) => Message.fromMap(note))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
return customer;
|
||||
}
|
||||
}
|
||||
73
lib/models/customers/customer_marcadores.dart
Normal file
@@ -0,0 +1,73 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class CustomerMarcadores {
|
||||
int? id;
|
||||
DateTime? createdAt;
|
||||
double? customersTotals;
|
||||
double? activeTotals;
|
||||
double? leadTotals;
|
||||
List<NewCustomersId>? newCustomersId;
|
||||
|
||||
CustomerMarcadores({
|
||||
this.id,
|
||||
this.createdAt,
|
||||
this.customersTotals,
|
||||
this.activeTotals,
|
||||
this.leadTotals,
|
||||
this.newCustomersId,
|
||||
});
|
||||
|
||||
factory CustomerMarcadores.fromJson(String str) => CustomerMarcadores.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory CustomerMarcadores.fromMap(Map<String, dynamic> json) => CustomerMarcadores(
|
||||
id: json["id"],
|
||||
createdAt: json["created_at"] == null ? null : DateTime.parse(json["created_at"]),
|
||||
customersTotals: json["customers_totals"],
|
||||
activeTotals: json["active_totals"],
|
||||
leadTotals: json["lead_totals"],
|
||||
newCustomersId: json["new_customers_id"] == null ? [] : List<NewCustomersId>.from(json["new_customers_id"]!.map((x) => NewCustomersId.fromMap(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"id": id,
|
||||
"created_at": createdAt?.toIso8601String(),
|
||||
"customers_totals": customersTotals,
|
||||
"active_totals": activeTotals,
|
||||
"lead_totals": leadTotals,
|
||||
"new_customers_id": newCustomersId == null ? [] : List<dynamic>.from(newCustomersId!.map((x) => x.toMap())),
|
||||
};
|
||||
}
|
||||
|
||||
class NewCustomersId {
|
||||
int? count;
|
||||
String? status;
|
||||
DateTime? createdAt;
|
||||
List<int>? customerIds;
|
||||
|
||||
NewCustomersId({
|
||||
this.count,
|
||||
this.status,
|
||||
this.createdAt,
|
||||
this.customerIds,
|
||||
});
|
||||
|
||||
factory NewCustomersId.fromJson(String str) => NewCustomersId.fromMap(json.decode(str));
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory NewCustomersId.fromMap(Map<String, dynamic> json) => NewCustomersId(
|
||||
count: json["count"],
|
||||
status: json["status"],
|
||||
createdAt: json["created_at"] == null ? null : DateTime.parse(json["created_at"]),
|
||||
customerIds: json["customer_ids"] == null ? [] : List<int>.from(json["customer_ids"]!.map((x) => x)),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
"count": count,
|
||||
"status": status,
|
||||
"created_at": "${createdAt!.year.toString().padLeft(4, '0')}-${createdAt!.month.toString().padLeft(2, '0')}-${createdAt!.day.toString().padLeft(2, '0')}",
|
||||
"customer_ids": customerIds == null ? [] : List<dynamic>.from(customerIds!.map((x) => x)),
|
||||
};
|
||||
}
|
||||