Commit ecc5cc24 by Gautam G

mini

parents
# 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
.packages
.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
# 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.
version:
revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
channel: stable
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
- platform: android
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
- platform: ios
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
- platform: linux
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
- platform: macos
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
- platform: web
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
- platform: windows
create_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
base_revision: e99c9c7cd9f6c0b2f8ae6e3ebfd585239f5568f4
# 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'
{
"java.configuration.updateBuildConfiguration": "disabled",
"git.ignoreLimitWarning": true
}
\ No newline at end of file
# photoshoot
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.
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
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
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=false
show.console.view=false
show.executions.view=false
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "com.example.photoshoot"
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
compileSdkVersion 33
}
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.photoshoot">
<!-- 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"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<queries>
<intent>
<action android:name="android.intent.action.TTS_SERVICE" />
</intent>
</queries>
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.photoshoot">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<queries>
<intent>
<action android:name="android.intent.action.TTS_SERVICE" />
</intent>
</queries>
<application
android:label="photoshoot"
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">
<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>
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
// Generated file.
//
// If you wish to remove Flutter's multidex support, delete this entire file.
//
// Modifications to this file should be done in a copy under a different name
// as this file may be regenerated.
package io.flutter.app;
import android.app.Application;
import android.content.Context;
import androidx.annotation.CallSuper;
import androidx.multidex.MultiDex;
/**
* Extension of {@link android.app.Application}, adding multidex support.
*/
public class FlutterMultiDexApplication extends Application {
@Override
@CallSuper
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
package com.example.photoshoot
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
<?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>
<?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>
<?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>
<?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>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.photoshoot">
<!-- 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"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<queries>
<intent>
<action android:name="android.intent.action.TTS_SERVICE" />
</intent>
</queries>
</manifest>
buildscript {
ext.kotlin_version = '1.9.22'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
\ No newline at end of file
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
**/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
<?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>
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
# Uncomment this line to define a global platform for your project
#platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
platform :ios, '12.0'
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
<?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>
<?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>
<?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>
</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>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
<?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>
<?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>
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)
}
}
{
"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"
}
}
{
"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"
}
}
# 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.
\ No newline at end of file
<?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>
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</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="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-16" y="-40"/>
</scene>
</scenes>
</document>
<?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>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>photoshoot</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>photoshoot</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>NSCameraUsageDescription</key>
<string>Camera access required</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is required to record audio for video content creation.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This library access to the photo library</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiresFullScreen</key>
<false/>
<key>UIStatusBarStyle</key>
<string></string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>Speech recognition allows you to use text-to-speech and speech</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
#import "GeneratedPluginRegistrant.h"
// To parse this JSON data, do
//
// final gridItems = gridItemsFromJson(jsonString);
import 'dart:convert';
GridItems gridItemsFromJson(String str) => GridItems.fromJson(json.decode(str));
String gridItemsToJson(GridItems data) => json.encode(data.toJson());
class GridItems {
GridItems({
required this.page,
required this.perPage,
required this.total,
required this.totalPages,
required this.data,
required this.support,
});
int page;
int perPage;
int total;
int totalPages;
List<Grid> data;
Support support;
factory GridItems.fromJson(Map<String, dynamic> json) => GridItems(
page: json["page"],
perPage: json["per_page"],
total: json["total"],
totalPages: json["total_pages"],
data: List<Grid>.from(json["data"].map((x) => Grid.fromJson(x))),
support: Support.fromJson(json["support"]),
);
Map<String, dynamic> toJson() => {
"page": page,
"per_page": perPage,
"total": total,
"total_pages": totalPages,
"data": List<dynamic>.from(data.map((x) => x.toJson())),
"support": support.toJson(),
};
}
class Grid {
Grid({
required this.id,
required this.email,
required this.firstName,
required this.lastName,
required this.avatar,
});
int id;
String email;
String firstName;
String lastName;
String avatar;
factory Grid.fromJson(Map<String, dynamic> json) => Grid(
id: json["id"],
email: json["email"],
firstName: json["first_name"],
lastName: json["last_name"],
avatar: json["avatar"],
);
Map<String, dynamic> toJson() => {
"id": id,
"email": email,
"first_name": firstName,
"last_name": lastName,
"avatar": avatar,
};
}
class Support {
Support({
required this.url,
required this.text,
});
String url;
String text;
factory Support.fromJson(Map<String, dynamic> json) => Support(
url: json["url"],
text: json["text"],
);
Map<String, dynamic> toJson() => {
"url": url,
"text": text,
};
}
import 'dart:convert';
LoginResponse loginResponseFromJson(String str) =>
LoginResponse.fromJson(json.decode(str));
String loginResponseToJson(LoginResponse data) => json.encode(data.toJson());
class LoginResponse {
LoginResponse({
required this.success,
required this.data,
});
int success;
Data data;
factory LoginResponse.fromJson(Map<String, dynamic> json) => LoginResponse(
success: json["success"],
data: Data.fromJson(json["data"]),
);
Map<String, dynamic> toJson() => {
"success": success,
"data": data.toJson(),
};
}
class Data {
Data({
required this.userAccessToken,
required this.printerAddress,
required this.storeId,
required this.storeName,
required this.storeFormat,
required this.ecommerceLocation,
required this.minDelayForSlideShow,
required this.userName,
required this.empId,
required this.userRole,
required this.feedbackUrlToken,
required this.appRunnigMode,
required this.appRunnigModeString,
required this.dsPrefix,
});
String userAccessToken;
String printerAddress;
int storeId;
String storeName;
String storeFormat;
String ecommerceLocation;
int minDelayForSlideShow;
String userName;
int empId;
String userRole;
String feedbackUrlToken;
int appRunnigMode;
String appRunnigModeString;
String dsPrefix;
factory Data.fromJson(Map<String, dynamic> json) => Data(
userAccessToken: json["user_access_token"],
printerAddress: json["printer_address"],
storeId: json["store_id"],
storeName: json["store_name"],
storeFormat: json["store_format"],
ecommerceLocation: json["ecommerce_location"],
minDelayForSlideShow: json["minDelayForSlideShow"],
userName: json["user_name"],
empId: json["emp_id"],
userRole: json["user_role"],
feedbackUrlToken: json["feedback_url_token"],
appRunnigMode: json["app_runnig_mode"],
appRunnigModeString: json["app_runnig_mode_string"],
dsPrefix: json["ds_prefix"],
);
Map<String, dynamic> toJson() => {
"user_access_token": userAccessToken,
"printer_address": printerAddress,
"store_id": storeId,
"store_name": storeName,
"store_format": storeFormat,
"ecommerce_location": ecommerceLocation,
"minDelayForSlideShow": minDelayForSlideShow,
"user_name": userName,
"emp_id": empId,
"user_role": userRole,
"feedback_url_token": feedbackUrlToken,
"app_runnig_mode": appRunnigMode,
"app_runnig_mode_string": appRunnigModeString,
"ds_prefix": dsPrefix,
};
}
import 'dart:io';
class NamedFile {
final int index;
final File file;
NamedFile(this.index, this.file);
String get name => file.path;
int get fileIndex => index;
}
import 'dart:convert';
Store storeFromJson(String str) => Store.fromJson(json.decode(str));
String storeToJson(Store data) => json.encode(data.toJson());
class Store {
Store({
required this.success,
required this.data,
});
int success;
List<Datum> data;
factory Store.fromJson(Map<String, dynamic> json) => Store(
success: json["success"],
data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"success": success,
"data": List<dynamic>.from(data.map((x) => x.toJson())),
};
}
class Datum {
Datum({
required this.id,
required this.storeName,
});
int id;
String storeName;
factory Datum.fromJson(Map<String, dynamic> json) => Datum(
id: json["id"],
storeName: json["store_name"],
);
Map<String, dynamic> toJson() => {
"id": id,
"store_name": storeName,
};
}
import 'dart:convert';
Upload uploadFromJson(String str) => Upload.fromJson(json.decode(str));
String uploadToJson(Upload data) => json.encode(data.toJson());
class Upload {
Upload({
required this.success,
required this.msg,
});
int success;
String msg;
factory Upload.fromJson(Map<String, dynamic> json) => Upload(
success: json["success"],
msg: json["msg"],
);
Map<String, dynamic> toJson() => {
"success": success,
"msg": msg,
};
}
import 'dart:convert';
List<User> userFromJson(String str) =>
List<User>.from(json.decode(str).map((x) => User.fromJson(x)));
String userToJson(List<User> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class User {
User({
required this.userId,
required this.id,
required this.title,
required this.body,
});
int userId;
int id;
String title;
String body;
factory User.fromJson(Map<String, dynamic> json) => User(
userId: json["userId"],
id: json["id"],
title: json["title"],
body: json["body"],
);
Map<String, dynamic> toJson() => {
"userId": userId,
"id": id,
"title": title,
"body": body,
};
}
import 'dart:convert';
UserData userDataFromJson(String str) => UserData.fromJson(json.decode(str));
String userDataToJson(UserData data) => json.encode(data.toJson());
class UserData {
UserData({
required this.userId,
required this.id,
required this.title,
required this.body,
});
int userId;
int id;
String title;
String body;
factory UserData.fromJson(Map<String, dynamic> json) => UserData(
userId: json["userId"],
id: json["id"],
title: json["title"],
body: json["body"],
);
Map<String, dynamic> toJson() => {
"userId": userId,
"id": id,
"title": title,
"body": body,
};
}
import 'dart:convert';
import 'dart:core';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:http/http.dart' as http;
import '../Model/LoginResponse.dart';
import '../Model/NamedFile.dart';
import '../Model/Store.dart';
import '../Model/Upload.dart';
class RemoteData {
String baseUrl = 'http://posapi.plutokm.com/';
String storeid = 'http://posapi.plutokm.com/login/getStoresMappedToUser/';
String loginurl = 'http://posapi.plutokm.com/login/doLogin';
String logout = 'http://posapi.plutokm.com/login/doLogout/';
String speechtotext = 'http://192.168.65.148:5113/mobile_response/';
String validbarcode =
'https://plutokm.com/tools/MobileApps_onlyklm_MagicCommonBackend/is_barcode_alreadygrcd.php?barcode=';
String uploadimages =
'https://plutokm.com/tools/MobileApps_onlyklm_MagicCommonBackend/catalog_capture_images.php';
String type = "Content-Type";
String appjson = "application/json";
//8978968396
//Stores List Request GET Method
Future<List<Datum>?> getStoreList(String id) async {
var header = {type: appjson};
var response = await http.get(Uri.parse('$storeid$id'), headers: header);
if (response.statusCode == 200) {
var res = response.body;
return storeFromJson(res).data;
}
return null;
}
//Login Request GET Method
Future<Upload?> getValidBarcode(String barcode) async {
var client = http.Client();
var response = await client.get(Uri.parse('$validbarcode$barcode'));
if (response.statusCode == 200) {
return uploadFromJson(response.body);
} else {
return uploadFromJson(response.body);
}
}
//Login Request POST Method
Future<LoginResponse> getLoginRequest(
String email, String pass, int storeId) async {
Map<String, dynamic> body = {
'emp_id': email,
'password': pass,
'store_id': storeId,
'using_dongle': false,
};
var client = http.Client();
var res = await client.post(Uri.parse(loginurl),
headers: {type: appjson}, body: json.encode(body));
if (res.statusCode == 200) {
return loginResponseFromJson(res.body);
} else {
return loginResponseFromJson(res.body);
}
}
Future<String> getSpeechResponse(String? text) async {
var header = {type: appjson};
var res = '';
var response = await http.post(
Uri.parse('$speechtotext$text'),
headers: header,
);
if (kDebugMode) {
print(response.statusCode);
}
if (response.statusCode == 200) {
res = response.body;
if (kDebugMode) {
print('Logout : $res');
}
}
return res;
}
//Logout Request GET Method
Future<String> getLogout(String? id) async {
var header = {type: appjson};
var res = '';
var response = await http.get(Uri.parse('$logout$id'), headers: header);
if (response.statusCode == 200) {
res = response.body;
if (kDebugMode) {
print('Logout : $res');
}
}
return res;
}
//Upload Images POST Method
Future<Upload?> uploadImages(String token, String storeId, String barcode,
List<NamedFile> imageList, String channels, String model) async {
try {
final request = http.MultipartRequest('POST', Uri.parse(uploadimages));
request.headers.addAll({
'Pos-Access-Token': token,
'Pos-User-Access-Store-Id': storeId,
type: appjson,
});
request.fields['barcode'] = barcode;
if (Platform.isAndroid) {
request.fields['APPOS'] = 'ANDROID';
} else if (Platform.isIOS) {
request.fields['APPOS'] = 'IOS';
}
request.fields['DeviceModel'] = model;
request.fields['DeviceUUID'] = '';
request.fields['Channels'] = channels;
for (var i = 0; i < imageList.length; i++) {
NamedFile namedFile = imageList[i];
int position = namedFile.fileIndex;
request.files.add(await http.MultipartFile.fromPath(
'pic$position', namedFile.file.path));
}
//'files': await MultipartFile.fromFile(num[i].path),
var response = await request.send();
var responseString = await response.stream.bytesToString();
if (response.statusCode == 200) {
return uploadFromJson(responseString);
} else {
return uploadFromJson(responseString);
}
} catch (e) {
if (kDebugMode) {
print(e);
}
}
return null;
}
}
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class CheckBoxlist extends StatefulWidget {
const CheckBoxlist({Key? key}) : super(key: key);
@override
_CheckBoxListState createState() => _CheckBoxListState();
}
class _CheckBoxListState extends State<CheckBoxlist> {
bool isvisible = false;
final List<SimpleModel> _items = <SimpleModel>[
SimpleModel('InduceSmile.com', false),
SimpleModel('Flutter.io', false),
SimpleModel('google.com', false),
SimpleModel('youtube.com', false),
SimpleModel('yahoo.com', false),
SimpleModel('gmail.com', false),
];
@override
void initState() {
super.initState();
String daysOfTheWeek = DateFormat('EEEE').format(DateTime.now());
if (daysOfTheWeek == 'Monday' || daysOfTheWeek == 'Tuesday') {
isvisible = true;
} else {
isvisible = false;
}
}
@override
Widget build(BuildContext context) => MaterialApp(
home: Scaffold(
appBar: AppBar(
// debugShowCheckedModeBanner: false,
title: const Text('Checkbox in ListView'),
),
body: ListView(
padding: const EdgeInsets.all(8),
children: _items
.map(
(SimpleModel item) => CheckboxListTile(
title: Text(item.title),
value: item.isChecked,
onChanged: (bool? val) {
setState(() {
item.isChecked = val!;
if (_items.isNotEmpty) {
int count = 0;
for (SimpleModel simpleModel in _items) {
if (kDebugMode) {
print(simpleModel.isChecked);
}
if (simpleModel.isChecked) {
count++;
}
}
if (kDebugMode) {
print(count);
}
}
});
},
),
)
.toList(),
),
bottomNavigationBar: isvisible
? Padding(
padding: const EdgeInsets.all(20.0),
child: SizedBox(
height: 50.0,
child: ElevatedButton(
onPressed: () {
if (_items.isNotEmpty) {
int count = 0;
for (SimpleModel simpleModel in _items) {
if (kDebugMode) {
print(simpleModel.isChecked);
}
if (simpleModel.isChecked) {
count++;
}
}
if (kDebugMode) {
print(count);
}
}
String daysOfTheWeek =
DateFormat('EEEE').format(DateTime.now());
print('Day : $daysOfTheWeek');
},
child: const Text('SUBMIT'),
),
),
)
: null,
),
);
}
class SimpleModel {
String title;
bool isChecked;
SimpleModel(this.title, this.isChecked);
}
import 'dart:convert';
import 'package:connectivity/connectivity.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:crypto/crypto.dart';
class Constants {
var title;
var message;
late AlertDialog alert;
Constants(String title, String message) {
this.title = title;
this.message = message;
}
static Future<void> showAlertDialog1(BuildContext context) async {
AlertDialog alert = AlertDialog(
content: Row(
children: [
const CircularProgressIndicator(),
Container(
margin: const EdgeInsets.only(left: 5),
child: const Text("Loading")),
],
),
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return alert;
},
);
}
static Future<void> dismissAlertDialog1(BuildContext context) async {
Navigator.pop(context);
}
static Future<bool> checkInternetConnectivity() async {
var connectivityResult = await (Connectivity().checkConnectivity());
if (connectivityResult == ConnectivityResult.none) {
return false;
} else {
return true;
}
}
static showLoader(BuildContext ctx) {
showDialog(
context: ctx,
builder: (context) {
return const Center(child: CircularProgressIndicator());
}
);
}
static Future<void> saveLoginCredentials(String username, String token,
String storeId, String storeName, bool validate) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString('userId', username);
prefs.setString('userToken', token);
prefs.setString('store_Id', storeId);
prefs.setString('storeName', storeName);
prefs.setBool('islogged', validate);
}
Future<bool?> getLoggedIn() async {
SharedPreferences preferences = await SharedPreferences.getInstance();
bool? validate = preferences.getBool('islogged');
return validate;
}
Future<String?> getStoreId() async {
SharedPreferences preferences = await SharedPreferences.getInstance();
return preferences.getString('store_Id');
}
static String hashPassword(String password) {
var bytes = utf8.encode(password);
var digest = sha256.convert(bytes);
return digest.toString();
}
showAlertDialog(BuildContext context) {
// set up the button
Widget okButton = TextButton(
child: const Text("Cancel"),
onPressed: () {
Navigator.of(context).pop();
});
// set up the AlertDialog
AlertDialog alert = AlertDialog(
title: Text(title),
content: Text(message),
actions: [
okButton,
],
);
// show the dialog
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}
}
import 'dart:async';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:image_picker/image_picker.dart';
import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart' show FlutterBarcodeScanner, ScanMode;
import 'Constants.dart';
class Home extends StatefulWidget {
const Home({super.key});
@override
State<StatefulWidget> createState() => _Home();
}
class _Home extends State<Home> {
File? imagefile;
File? imagefile1;
File? imagefile2;
File? imagefile3;
File? imagefile4;
File? imagefile5;
final TextEditingController _barcodevalue = TextEditingController();
final ImagePicker _picker = ImagePicker();
late List<File> arraylist = [];
XFile? image;
bool isloading = false;
Future<void> _getImage(int index) async {
if (_barcodevalue.text.isEmpty) {
Constants('Barcode', 'Please Scan Barcode First').showAlertDialog(context);
} else {
image = await _picker.pickImage(source: ImageSource.camera);
if (image != null) {
imagefile = File(image!.path);
} else {
image = await _picker.pickImage(source: ImageSource.camera);
}
}
}
Future<void> startBarcodeScanStream() async {
String barcodeScanRes;
try {
barcodeScanRes = await FlutterBarcodeScanner.scanBarcode(
'#ff6666',
'Cancel',
true,
ScanMode.BARCODE,
// scanAreaWidth: 300,
// scanAreaHeight: 200,
);
if (kDebugMode) {
print(barcodeScanRes);
}
setState(() {
_barcodevalue.text = barcodeScanRes;
//if(barcodeScanRes == '-1') {
// _barcodevalue.text = '';
//} else{
// _barcodevalue.text = barcodeScanRes;
// if(RegExp(r'^[0-9]+$').hasMatch(_barcodevalue.text)) {
// _barcodevalue.text = '';
// startBarcodeScanStream();
// }else{
// //getUpdate(_barcodevalue.text);
// }
//}
});
} on PlatformException {
barcodeScanRes = 'Failed to get platform version.';
}
}
@override
void initState() {
super.initState();
//loadData();
}
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(title: const Text('Grc Images')),
body: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(children: [
Expanded(
child: TextFormField(
readOnly: true,
showCursor: false,
autofocus: false,
autocorrect: true,
controller: _barcodevalue,
decoration: const InputDecoration(hintText: 'TGB47943987'),
),
),
IconButton(
onPressed: () {
startBarcodeScanStream();
},
icon: Image.asset('assets/images/ic_barcode.png')),
]),
const SizedBox(height: 20),
Row(mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
children: [
const Text(
'Capture Image',
style: TextStyle(
fontSize: 16,
color: Colors.black,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.bold),
),
GestureDetector(
onTap: () {
_getImage(4);
},
child: imagefile4 != null
? Image.file(
imagefile4!,
width: 160.0,
height: 200.0,
)
: Image.asset(
'assets/images/camera.png',
width: 160.0,
height: 200.0,
),
),
],
),
]),
const Padding(
padding: EdgeInsets.only(bottom: 1, left: 1, right: 1, top: 1),
),
const Padding(
padding: EdgeInsets.only(bottom: 1, top: 1, left: 1, right: 1),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue,
minimumSize: const Size.fromHeight(50),
),
onPressed: () async {
if (imagefile == null) {
Constants('Barcode', 'Please Capture All images')
.showAlertDialog(context);
} else {
isloading = true;
bool isInternetConnected =
await Constants.checkInternetConnectivity();
if (isInternetConnected) {
showDialog(
context: context,
builder: (context) {
return const Center(
child: CircularProgressIndicator());
});
} else {
Constants(
'Upload Images', 'Check your internet connection')
.showAlertDialog(context);
}
}
},
child: const Text('Upload Images'),
),
]),
),
);
}
// void getUpdate(String text) async {
// Upload? upload = await RemoteData().getValidBarcode(_barcodevalue.text);
// //print('Response Data :${upload?.success}');
// if (upload?.success == 1) {
// } else if (upload?.success == 2) {
// _showDialog();
// } else if (upload?.success == 0) {
// //print(upload!.msg);
// Constants('Multiple Images', upload!.msg).showAlertDialog(context);
// _barcodevalue.text = '';
// }
// }
void _showDialog() {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Scan Additional Items?'),
content: const Text(
'This item is already Catloged. Scan Additional Pics of this item? Click No to skip this barcode'),
actions: [
TextButton(
onPressed: () {
// Perform some action
Navigator.of(context).pop();
},
child: const Text('Ok'),
),
TextButton(
onPressed: () {
Navigator.of(context).pop();
_barcodevalue.text = '';
},
child: const Text('No'),
),
],
);
},
);
}
}
import 'package:flutter/cupertino.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'PieChart.dart';
class MyPieChart extends StatelessWidget {
final List<ChartData> data;
MyPieChart({required this.data});
@override
Widget build(BuildContext context) {
return charts.PieChart(
[
charts.Series<ChartData, String>(
id: 'chartData',
domainFn: (ChartData data, _) => data.label,
measureFn: (ChartData data, _) => data.value,
data: data,
labelAccessorFn: (ChartData row, _) => '${row.label}: ${row.value}',
),
],
animate: true,
defaultRenderer: charts.ArcRendererConfig(
arcRendererDecorators: [
charts.ArcLabelDecorator(
labelPosition: charts.ArcLabelPosition.inside,
),
],
),
);
}
}
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'MyPieChart.dart';
class PieChart extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Pie Chart Example',
home: Scaffold(
appBar: AppBar(
title: Text('Pie Chart Example'),
),
body: Center(
child: MyPieChart(data: data),
),
),
);
}
}
class ChartData {
final String label;
final int value;
ChartData(this.label, this.value);
}
final List<ChartData> data = [
ChartData('Apples', 10),
ChartData('Bananas', 20),
ChartData('Oranges', 15),
ChartData('Grapes', 50),
];
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import '../Model/LoginResponse.dart';
import '../Model/Store.dart';
import '../Remote/RemoteData.dart';
import 'Constants.dart';
import 'MultipleImages.dart';
class SignUp extends StatefulWidget {
const SignUp({super.key});
@override
State<StatefulWidget> createState() => _SignUpState();
}
class _SignUpState extends State<SignUp> {
final TextEditingController _email = TextEditingController();
final TextEditingController _pass = TextEditingController();
List<Datum>? storesList;
String dropdownValue = 'Option 2';
Datum? selectedModel;
bool item = true;
bool isLoading = false;
Future<void> login(String email, String pass) async {
try {
Constants.hashPassword(pass);
int? storeId = selectedModel?.id;
LoginResponse res = await RemoteData()
.getLoginRequest(email, Constants.hashPassword(pass), storeId!);
//print('This is StoreId $storeId');
//print(res.data.userAccessToken);
//print(res.data.empId);
//print(res.data.storeName);
if (res.success == 1) {
//Navigator.pop(context);
Constants.saveLoginCredentials(
res.data.empId.toString(),
res.data.userAccessToken,
res.data.storeId.toString(),
res.data.storeName,
true);
Navigator.of(context).pop();
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) => const MultipleImages()));
} else {
//Navigator.pop(context);
Constants('Login', 'Invalid Credentials').showAlertDialog(context);
}
} catch (e) {
print(e.toString());
}
}
@override
void dispose() {
_focusNode.dispose();
_email.dispose();
_pass.dispose();
super.dispose();
}
@override
void initState() {
super.initState();
_focusNode.addListener(() async {
if (_email.text.isNotEmpty) {
if (item) {
if (_focusNode.hasFocus) {
bool isInternetConnected =
await Constants.checkInternetConnectivity();
if (isInternetConnected) {
showDialog(
context: context,
builder: (context) {
return const Center(child: CircularProgressIndicator());
}
);
item = false;
storesList = await RemoteData().getStoreList(_email.text);
setState(() {
Navigator.pop(context);
storesList = storesList;
});
} else {
Constants('LoginPage', 'check your network connection')
.showAlertDialog(context);
}
} else {
//_focusNode.unfocus();
}
}
} else {
_focusNode.unfocus();
//print('UserId is Empty calling method');
//Toast.show('Enter Id', duration: 1, gravity: Toast.top);
Fluttertoast.showToast(
msg: "Enter UserId",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
textColor: Colors.white,
fontSize: 16.0);
}
});
}
final FocusNode _focusNode = FocusNode();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Login '),
backgroundColor: const Color.fromARGB(255, 23, 94, 228),
titleTextStyle: const TextStyle(color: Colors.white, fontSize: 22),
),
resizeToAvoidBottomInset: false,
body: Container(
margin: const EdgeInsets.all(15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextField(
keyboardType: TextInputType.number,
controller: _email,
scrollPadding: const EdgeInsets.all(100.0),
decoration: const InputDecoration(
hintText: 'UserId',
border: OutlineInputBorder(),
),
),
const SizedBox(
height: 20,
),
TextFormField(
focusNode: _focusNode,
showCursor: false,
obscureText: true,
controller: _pass,
decoration: const InputDecoration(
hintText: 'Password',
border: OutlineInputBorder(),
),
),
DropdownButton<Datum>(
isExpanded: true,
value: selectedModel,
hint: const Text("Select Store"),
onChanged: (Datum? newValue) {
setState(() {
selectedModel = newValue;
});
},
items: storesList?.map((store) {
return DropdownMenuItem<Datum>(
value: store,
child: Text(store.storeName),
);
}).toList(),
),
const SizedBox(
height: 30,
),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color.fromARGB(255, 23, 94, 228),
minimumSize: const Size.fromHeight(60),
),
onPressed: () async {
if (_email.text.isEmpty && _pass.text.isEmpty) {
Constants('Login ', 'Enter email and password')
.showAlertDialog(context);
} else if (_email.text.isEmpty) {
Constants('Login ', 'Enter email').showAlertDialog(context);
} else if (_pass.text.isEmpty) {
Constants('Login ', 'Enter password')
.showAlertDialog(context);
} else {
bool isInternetConnected =
await Constants.checkInternetConnectivity();
if (isInternetConnected) {
Constants.showLoader(context);
login(_email.text, _pass.text);
} else {
Constants('Login', 'Check internet connection')
.showAlertDialog(context);
}
}
},
child: SizedBox(
height: 50,
child: Center(
child: isLoading
? const CircularProgressIndicator(
color: Colors.amber,
)
: const Text('Sign In',
style: TextStyle(fontSize: 16, color: Colors.white)),
),
),
),
// Visibility(
// visible: isLoading,
// child: const SpinKitFadingCircle(
// color: Colors.blue,
// size: 50.0,
// ),
// ),
],
),
),
);
}
}
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'MultipleImages.dart';
import 'SignUp.dart';
class UserPreferences {
static const String isLoggedInKey = 'isLoggedIn';
static Future<SharedPreferences> getSharedPreferences() async {
return await SharedPreferences.getInstance();
}
static Future<bool> isLoggedIn() async {
final prefs = await getSharedPreferences();
return prefs.getBool(isLoggedInKey) ?? false;
}
}
class SplashScreen extends StatefulWidget {
const SplashScreen({Key? key}) : super(key: key);
@override
SplashScreenState createState() => SplashScreenState();
}
class SplashScreenState extends State<SplashScreen> {
bool? isLoggedIn = false;
void timeToShowSplashScreenOnScreen() async {
Timer(const Duration(seconds: 3), () async {
if (!mounted) return;
SharedPreferences prefs = await SharedPreferences.getInstance();
var isLoggedIn = prefs.getBool("islogged") ?? false;
if (kDebugMode) {
print(isLoggedIn);
}
if (isLoggedIn) {
if (kDebugMode) {
print('if condition :$isLoggedIn');
}
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) => const MultipleImages()));
} else {
if (kDebugMode) {
print('else condition :$isLoggedIn');
}
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => const SignUp()),
(Route<dynamic> route) => false
);
}
});
}
@override
void initState() {
super.initState();
//Constants('header', 'intit').showAlertDialog();
timeToShowSplashScreenOnScreen();
//getDeviceId();
//Constants.showAlertDialog1(context);
}
@override
Widget build(BuildContext context) {
/* return Scaffold(
appBar: AppBar(
title: Text('Splash Screen'),
),
); */
return Scaffold(
body: Container(
decoration: const BoxDecoration(
//loadingText: Text("Loading"),
image: DecorationImage(
image: AssetImage("assets/images/splash.png"),
fit: BoxFit.cover,
),
),
),
);
}
/*Future<void> getDeviceId() async {
String uniqueDeviceId = (await PlatformDeviceId.getDeviceId)!;
print(uniqueDeviceId);
if (Platform.isAndroid) {
final info = await DeviceInfoPlugin().iosInfo;
print(info.model);
//print(info.systemVersion);
}
if (Platform.isIOS) {
final info = await DeviceInfoPlugin().iosInfo;
print(info.utsname.machine); // "iPhone15,2"
print(info.utsname.version); // "iPhone 14 Pro"
}
} */
}
import 'package:flutter/material.dart';
import 'Screen/SplashScreen.dart';
void main() => runApp(const MaterialApp(
debugShowCheckedModeBanner: false,
home: SplashScreen(),
));
flutter/ephemeral
# Project-level configuration.
cmake_minimum_required(VERSION 3.10)
project(runner LANGUAGES CXX)
# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "photoshoot")
# The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "com.example.photoshoot")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.
cmake_policy(SET CMP0063 NEW)
# Load bundled libraries from the lib/ directory relative to the binary.
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
# Root filesystem for cross-building.
if(FLUTTER_TARGET_PLATFORM_SYSROOT)
set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endif()
# Define build configuration options.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Debug" CACHE
STRING "Flutter build mode" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Profile" "Release")
endif()
# Compilation settings that should be applied to most targets.
#
# Be cautious about adding new options here, as plugins use this function by
# default. In most cases, you should add new options to specific targets instead
# of modifying this function.
function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_features(${TARGET} PUBLIC cxx_std_14)
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
endfunction()
# Flutter library and tool build rules.
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
add_subdirectory(${FLUTTER_MANAGED_DIR})
# System-level dependencies.
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
# Define the application target. To change its name, change BINARY_NAME above,
# not the value here, or `flutter run` will no longer work.
#
# Any new source files that you add to the application should be added here.
add_executable(${BINARY_NAME}
"main.cc"
"my_application.cc"
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
)
# Apply the standard set of build settings. This can be removed for applications
# that need different build settings.
apply_standard_settings(${BINARY_NAME})
# Add dependency libraries. Add any application-specific dependencies here.
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
# Run the Flutter tool portions of the build. This must not be removed.
add_dependencies(${BINARY_NAME} flutter_assemble)
# Only the install-generated bundle's copy of the executable will launch
# correctly, since the resources must in the right relative locations. To avoid
# people trying to run the unbundled copy, put it in a subdirectory instead of
# the default top-level location.
set_target_properties(${BINARY_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
)
# Generated plugin build rules, which manage building the plugins and adding
# them to the application.
include(flutter/generated_plugins.cmake)
# === Installation ===
# By default, "installing" just makes a relocatable bundle in the build
# directory.
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
endif()
# Start with a clean build bundle directory every time.
install(CODE "
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
" COMPONENT Runtime)
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime)
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
COMPONENT Runtime)
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
install(FILES "${bundled_library}"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
endforeach(bundled_library)
# Fully re-copy the assets directory on each build to avoid having stale files
# from a previous install.
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
install(CODE "
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
" COMPONENT Runtime)
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
# Install the AOT library on non-Debug builds only.
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
endif()
# This file controls Flutter-level build steps. It should not be edited.
cmake_minimum_required(VERSION 3.10)
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
# Configuration provided via flutter tool.
include(${EPHEMERAL_DIR}/generated_config.cmake)
# TODO: Move the rest of this into files in ephemeral. See
# https://github.com/flutter/flutter/issues/57146.
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
# which isn't available in 3.10.
function(list_prepend LIST_NAME PREFIX)
set(NEW_LIST "")
foreach(element ${${LIST_NAME}})
list(APPEND NEW_LIST "${PREFIX}${element}")
endforeach(element)
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
endfunction()
# === Flutter Library ===
# System-level dependencies.
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
# Published to parent scope for install step.
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
list(APPEND FLUTTER_LIBRARY_HEADERS
"fl_basic_message_channel.h"
"fl_binary_codec.h"
"fl_binary_messenger.h"
"fl_dart_project.h"
"fl_engine.h"
"fl_json_message_codec.h"
"fl_json_method_codec.h"
"fl_message_codec.h"
"fl_method_call.h"
"fl_method_channel.h"
"fl_method_codec.h"
"fl_method_response.h"
"fl_plugin_registrar.h"
"fl_plugin_registry.h"
"fl_standard_message_codec.h"
"fl_standard_method_codec.h"
"fl_string_codec.h"
"fl_value.h"
"fl_view.h"
"flutter_linux.h"
)
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
add_library(flutter INTERFACE)
target_include_directories(flutter INTERFACE
"${EPHEMERAL_DIR}"
)
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
target_link_libraries(flutter INTERFACE
PkgConfig::GTK
PkgConfig::GLIB
PkgConfig::GIO
)
add_dependencies(flutter flutter_assemble)
# === Flutter tool backend ===
# _phony_ is a non-existent file to force this command to run every time,
# since currently there's no way to get a full input/output list from the
# flutter tool.
add_custom_command(
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/_phony_
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
"${FLUTTER_LIBRARY}"
${FLUTTER_LIBRARY_HEADERS}
)
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
#include <platform_device_id_linux/platform_device_id_linux_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) platform_device_id_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "PlatformDeviceIdLinuxPlugin");
platform_device_id_linux_plugin_register_with_registrar(platform_device_id_linux_registrar);
}
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include <flutter_linux/flutter_linux.h>
// Registers Flutter plugins.
void fl_register_plugins(FlPluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_
#
# Generated file, do not edit.
#
list(APPEND FLUTTER_PLUGIN_LIST
platform_device_id_linux
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
#include "my_application.h"
int main(int argc, char** argv) {
g_autoptr(MyApplication) app = my_application_new();
return g_application_run(G_APPLICATION(app), argc, argv);
}
#include "my_application.h"
#include <flutter_linux/flutter_linux.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#include "flutter/generated_plugin_registrant.h"
struct _MyApplication {
GtkApplication parent_instance;
char** dart_entrypoint_arguments;
};
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
// Implements GApplication::activate.
static void my_application_activate(GApplication* application) {
MyApplication* self = MY_APPLICATION(application);
GtkWindow* window =
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
// Use a header bar when running in GNOME as this is the common style used
// by applications and is the setup most users will be using (e.g. Ubuntu
// desktop).
// If running on X and not using GNOME then just use a traditional title bar
// in case the window manager does more exotic layout, e.g. tiling.
// If running on Wayland assume the header bar will work (may need changing
// if future cases occur).
gboolean use_header_bar = TRUE;
#ifdef GDK_WINDOWING_X11
GdkScreen* screen = gtk_window_get_screen(window);
if (GDK_IS_X11_SCREEN(screen)) {
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
use_header_bar = FALSE;
}
}
#endif
if (use_header_bar) {
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar));
gtk_header_bar_set_title(header_bar, "photoshoot");
gtk_header_bar_set_show_close_button(header_bar, TRUE);
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
} else {
gtk_window_set_title(window, "photoshoot");
}
gtk_window_set_default_size(window, 1280, 720);
gtk_widget_show(GTK_WIDGET(window));
g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
FlView* view = fl_view_new(project);
gtk_widget_show(GTK_WIDGET(view));
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
gtk_widget_grab_focus(GTK_WIDGET(view));
}
// Implements GApplication::local_command_line.
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
MyApplication* self = MY_APPLICATION(application);
// Strip out the first argument as it is the binary name.
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
g_autoptr(GError) error = nullptr;
if (!g_application_register(application, nullptr, &error)) {
g_warning("Failed to register: %s", error->message);
*exit_status = 1;
return TRUE;
}
g_application_activate(application);
*exit_status = 0;
return TRUE;
}
// Implements GObject::dispose.
static void my_application_dispose(GObject* object) {
MyApplication* self = MY_APPLICATION(object);
g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
}
static void my_application_class_init(MyApplicationClass* klass) {
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
}
static void my_application_init(MyApplication* self) {}
MyApplication* my_application_new() {
return MY_APPLICATION(g_object_new(my_application_get_type(),
"application-id", APPLICATION_ID,
"flags", G_APPLICATION_NON_UNIQUE,
nullptr));
}
#ifndef FLUTTER_MY_APPLICATION_H_
#define FLUTTER_MY_APPLICATION_H_
#include <gtk/gtk.h>
G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
GtkApplication)
/**
* my_application_new:
*
* Creates a new Flutter-based application.
*
* Returns: a new #MyApplication.
*/
MyApplication* my_application_new();
#endif // FLUTTER_MY_APPLICATION_H_
# Flutter-related
**/Flutter/ephemeral/
**/Pods/
# Xcode-related
**/dgph
**/xcuserdata/
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
//
// Generated file. Do not edit.
//
import FlutterMacOS
import Foundation
import connectivity_macos
import device_info_plus
import flutter_tts
import path_provider_foundation
import platform_device_id
import platform_device_id_macos
import shared_preferences_foundation
import speech_to_text_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
PlatformDeviceIdMacosPlugin.register(with: registry.registrar(forPlugin: "PlatformDeviceIdMacosPlugin"))
PlatformDeviceIdMacosPlugin.register(with: registry.registrar(forPlugin: "PlatformDeviceIdMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SpeechToTextMacosPlugin.register(with: registry.registrar(forPlugin: "SpeechToTextMacosPlugin"))
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment