Primeiro commit Funcionado- flutter atualizado- somente na Uema

parents
Pipeline #208 failed with stages
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# 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/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# 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: f30b7f4db93ee747cd727df747941a28ead25ff5
channel: stable
project_type: app
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "uema_iduema",
"request": "launch",
"type": "dart"
}
]
}
\ No newline at end of file
{
"git.ignoreLimitWarning": true
}
\ No newline at end of file
# uema_iduema
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://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
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
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 29
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.uema_iduema"
minSdkVersion 16
targetSdkVersion 29
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 {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.uema_iduema">
<!-- Flutter 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>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.uema_iduema">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<!--Permissões para uso do aplicativo na internet-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<!--Permissões para uso do aplicativo na internet nos parâmetros acima-->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="ID UEMA"
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
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"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<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>
</manifest>
package com.example.uema_iduema
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: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 -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter 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:color/white</item>
</style>
</resources>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.uema_iduema">
<!-- Flutter 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>
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-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"
*.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/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>$(DEVELOPMENT_LANGUAGE)</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>9.0</string>
</dict>
</plist>
#include "Generated.xcconfig"
#include "Generated.xcconfig"
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.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>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
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">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</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>
<AdditionalOptions>
</AdditionalOptions>
</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>
</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" 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>
<?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>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>ID UEMA</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>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
\ No newline at end of file
#import "GeneratedPluginRegistrant.h"
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'src/app-view.dart';
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
//força o aplicativo a ter apenas a horientação vertical
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
runApp(MaterialApp(
theme: ThemeData(
//primaryColor: Color(0xFF6495ED),
),
debugShowCheckedModeBanner: false,
home: AppView(),
));
}
import 'package:flutter/material.dart';
import 'package:uema_iduema/src/login/splash-screen.dart';
class AppView extends StatelessWidget {
/*
Classe de visualização geral da aplicação
*/
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "ID UEMA",
debugShowCheckedModeBanner: false,
home: SplashScreen(),
);
}
}
\ No newline at end of file
import 'package:dio/dio.dart';
import 'package:shared_preferences/shared_preferences.dart';
class CustomDio {
var _dio;
CustomDio() {
_dio = Dio();
}
CustomDio.withAuthentication() {
_dio = Dio();
_dio.interceptors.add(InterceptorsWrapper(
onRequest: _onRequest, onResponse: _onRespose, onError: _onError));
}
Dio get instance => _dio;
_onRequest(RequestOptions options) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
var token01= prefs.get('token');
var token = 'Bearer $token01';
options.headers['Authorization'] = token;
}
_onError(DioError e) {
print(e);
return e;
}
_onRespose(Response e) {
print('########### Response Log');
print(e.data);
print('########### Response Log');
}
}
This diff is collapsed.
import 'package:flutter/material.dart';
class RodapeHome extends StatelessWidget{
/***
* Classe para retornar o rodapé da Home
*/
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
Container(
child: Text("#OrgulhoDeSerUema",style:
TextStyle(fontSize: MediaQuery.of(context).size.width * 0.045,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
color: Color(0xFF113A68)),),
),
SizedBox(height: MediaQuery.of(context).size.height * 0.0075,),
Container(
child: Text("Válido em todo o território nacional,\ncom base na Lei Federal nº 12.037/2009.",
textAlign: TextAlign.center, style:
TextStyle(fontSize: MediaQuery.of(context).size.width * 0.04,
fontFamily: 'Poppins',
fontWeight: FontWeight.w500,
color: Colors.black54),
),
),
SizedBox(height: MediaQuery.of(context).size.height * 0.025,),
],
),
);
}
}
\ No newline at end of file
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:flutter/widgets.dart';
import 'package:shared_preferences/shared_preferences.dart';
const IMAGE_KEY = 'IMAGE_KEY';
class ImageSharedPrefs {
static Future<bool> saveImageToPrefs(String value) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return await prefs.setString(IMAGE_KEY, value);
}
static Future<bool> emptyPrefs() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return await prefs.clear();
}
static Future<String> loadImageFromPrefs() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return prefs.getString(IMAGE_KEY);
}
// encodes bytes list as string
static String base64String(Uint8List data) {
return base64Encode(data);
}
// decode bytes from a string
static imageFrom64BaseString(String base64String) {
return Image.memory(
base64Decode(base64String),
fit: BoxFit.cover,
);
}
}
import 'package:flutter/material.dart';
class Spinner extends StatefulWidget {
@override
_SpinnerState createState() => _SpinnerState();
}
class _SpinnerState extends State<Spinner> with TickerProviderStateMixin {
AnimationController _controller;
@override
void initState() {
super.initState();
_controller = AnimationController(
duration: const Duration(seconds: 10),
vsync: this,
)..repeat();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return SpinningContainer(controller: _controller);
}
}
class SpinningContainer extends AnimatedWidget {
const SpinningContainer({Key key, AnimationController controller})
: super(key: key, listenable: controller);
Animation<double> get _progress => listenable;
@override
Widget build(BuildContext context) {
return Transform.rotate(
angle: _progress.value * 2.0 * 3.14,
child: //Container(width: 100.0, height: 100.0, color: Colors.deepPurple),
Theme(
data: Theme.of(context).copyWith(accentColor: Color(0xFF6495ED)),
child: new CircularProgressIndicator(),
),
);
}
}
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class TopoHome extends StatelessWidget {
/***
* Classe para retornar o topo da página de dados
*/
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(horizontal:MediaQuery.of(context).size.width * 0.025),
width: MediaQuery.of(context).size.width,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Image(
image: new AssetImage("assets/img/topo-progep.png"),
height: MediaQuery.of(context).size.height * 0.08,
),
new Image(
image: new AssetImage("assets/img/logo_uema.png"),
height: MediaQuery.of(context).size.height * 0.08,
),
],
),
SizedBox(height: MediaQuery.of(context).size.height * 0.015,),
Text(
"CARTEIRA DE IDENTIDADE FUNCIONAL",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Poppins',
fontSize: MediaQuery.of(context).size.width * 0.055,
color: Colors.black54,
fontWeight: FontWeight.bold),
),
],
),
);
}
}
import 'dart:convert';
import 'package:uema_iduema/src/home/componentes/rodape-home.dart';
import 'package:uema_iduema/src/home/componentes/spinner-home.dart';
import 'package:uema_iduema/src/home/componentes/topo-home.dart';
import 'package:uema_iduema/src/home/componentes/corpo-home.dart';
import 'package:uema_iduema/src/login/login-view.dart';
import 'package:uema_iduema/src/tema/background.dart' as Tema;
import 'package:uema_iduema/src/usuario/usuario-model.dart';
import 'package:uema_iduema/src/usuario/usuario-service.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class HomeView extends StatefulWidget {
final String dado; //cpf do usuário
const HomeView({Key key, this.dado}) : super(key: key);
@override
HomeViewState createState() {
return HomeViewState();
}
}
class HomeViewState extends State<HomeView> {
UsuarioService userService = new UsuarioService();
UsuarioModel user = new UsuarioModel();
Spinner spinner = new Spinner();
bool isLoading = false;
@override
void initState() {
//controleSessao();
print("${widget.dado}");
Future.delayed(Duration(seconds: 3), () {
userService.retornoInfo(widget.dado).then((resultado) {
user = resultado;
setState(() {
isLoading = true;
});
});
});
}
@override
Widget build(BuildContext context) {
if (isLoading == false) {
return Scaffold(
body: SingleChildScrollView(
child: SafeArea(
child: Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
decoration:
BoxDecoration(gradient: Tema.Background.gradientePrimario),
child: Stack(
children: <Widget>[
retornaSpinner(),
],
),
),
),
),
);
}
if (isLoading == true) {
if (user.error != null) {
return Scaffold(
body: Center(
child: Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(
height: MediaQuery.of(context).size.height / 2.2,
),
SizedBox(
width: MediaQuery.of(context).size.width - 60,
child: Center(
child: Text(
"${user.error}",
textAlign: TextAlign.center,
softWrap: true,
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w500),
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height / 2.5,
),
Container(
width: MediaQuery.of(context).size.width - 30,
child: RaisedButton(
color: Color(0xFF113A68),
splashColor: Color(0xFF113A68),
disabledColor: Color(0xFF113A68),
onPressed: () {
Navigator.pop(context);
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
child: Text(
"SAIR",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 18,
color: Colors.white,
fontWeight: FontWeight.w500),
),
),
),
],
),
),
),
);
}
if (user.error == null) {
return Scaffold(
body: SingleChildScrollView(
child: SafeArea(
child: Container(
height: MediaQuery.of(context).size.height,
//width: MediaQuery.of(context).size.width,
decoration:
BoxDecoration(gradient: Tema.Background.gradientePrimario),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
TopoHome(),
CorpoHome(
user: user,
),
RodapeHome(),
botaoValidar(),
botaoSair(),
SizedBox(
height: MediaQuery.of(context).size.height * 0.025,
)
],
),
),
),
),
);
}
}
}
retornaSpinner() {
return Center(
child: spinner,
);
}
controleSessao() {
Future.delayed(Duration(seconds: 5), () {
Flushbar(
message: "Sua sessão irá expirar em 5 segundos",
icon: Icon(
Icons.info_outline,
color: Colors.blue.shade600,
),
leftBarIndicatorColor: Colors.blue.shade600,
duration: Duration(seconds: 3),
)..show(context);
});
Future.delayed(Duration(seconds: 10), () {
return showDialog(
context: context,
builder: (context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
backgroundColor: Colors.white,
content: Text("Sua sessão expirou.",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w500)),
actions: <Widget>[
new FlatButton(
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => LoginView()));
},
child: Text("OK",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.w600))),
],
);
});
});
}
botaoSair() {
return Container(
height: MediaQuery.of(context).size.height * 0.05,
width: MediaQuery.of(context).size.width - 20,
child: RaisedButton(
color: Color(0xFF113A68),
splashColor: Color(0xFF113A68),
disabledColor: Color(0xFF113A68),
onPressed: () {
Navigator.pop(context);
},
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text(
"SAIR",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: MediaQuery.of(context).size.width * 0.05,
color: Colors.white,
fontWeight: FontWeight.w700),
),
),
);
}
botaoValidar() {
var cpfUser = user.cpf;
var cpfUTF8 = utf8.encode(cpfUser);
var cpfBase64 = base64.encode(cpfUTF8);
return Container(
height: MediaQuery.of(context).size.height * 0.05,
width: MediaQuery.of(context).size.width - 20,
child: RaisedButton(
color: Colors. transparent,
/* splashColor: Color(0xFF113A68),
disabledColor: Color(0xFF113A68), */
onPressed: () async {
if (await canLaunch("https://www.progep.uema.br/?page_id=776&data=$cpfBase64")) {
await (launch("https://www.progep.uema.br/?page_id=776&data=$cpfBase64"));
}
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: Color(0xFF113A68))),
child: Text(
"VALIDAR",
style: TextStyle(
fontFamily: 'Poppins',
fontSize: MediaQuery.of(context).size.width * 0.05,
color: Colors.white,
fontWeight: FontWeight.w700),
),
),
);
}
}
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class RodapeLogin extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width-40,
child: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("Esqueceu a senha? Clique ", style:
TextStyle(
fontFamily: 'Poppins',
fontSize: MediaQuery.of(context).size.width * 0.05,
fontWeight: FontWeight.w500,
),),
InkWell(
child: Text("aqui.",textAlign: TextAlign.center, style:
TextStyle(
decoration: TextDecoration.underline,
fontFamily: 'Poppins',
fontSize: MediaQuery.of(context).size.width * 0.05,
fontWeight: FontWeight.w500,
),),
onTap: ()async{
if(await canLaunch("https://bit.ly/2K2Fmx4")){
await (launch("https://bit.ly/2K2Fmx4"));
}
},
),
],
)
)
);
}
}
import 'package:uema_iduema/src/home/home-view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class VerificadorLogin{
int status;
verificador(int resultado, String dado, BuildContext context){
print("dentro do verificador $resultado");
status = resultado;
if(status == 200){
Navigator.push(context, MaterialPageRoute(builder: (context) => HomeView(dado: dado,)));
}
if(status == 404){
return showDialog(context: context, builder: (context){
return AlertDialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
backgroundColor: Colors.white,
content: Text("Senha ou login não conferem!", style: TextStyle(
fontFamily: 'Poppins',
fontSize: MediaQuery.of(context).size .width * 0.045,
fontWeight: FontWeight.w500)),
actions: <Widget>[
new FlatButton(
onPressed: (){
Navigator.pop(context);
},
child: Text("TENTAR NOVAMENTE", style: TextStyle(
fontFamily: 'Poppins',
fontSize: MediaQuery.of(context).size .width * 0.045,
fontWeight: FontWeight.w600))),
],
);
} );
}
if(status == 404){
return showDialog(context: context, builder: (context){
return AlertDialog(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
content: Text("CPF ou senha não conferem!", style: TextStyle(
fontFamily: 'Poppins',
fontSize: MediaQuery.of(context).size .width * 0.045,
fontWeight: FontWeight.w500)),
actions: <Widget>[
new FlatButton(
onPressed: (){
Navigator.pop(context);
},
child: Text("TENTAR NOVAMENTE", style: TextStyle(
fontFamily: 'Poppins',
fontSize: MediaQuery.of(context).size .width * 0.04,
fontWeight: FontWeight.w600))),
],
);
} );
}
}
}
\ No newline at end of file
class LoginModel{
String login;
String senha;
LoginModel();
Map toMap(){
var json = new Map<String,dynamic>();
json['email'] = login;
if(senha != null){
json['password'] = senha;
}
return json;
}
LoginModel.fromMap(Map<String,dynamic> json){
this.login = json['email'];
this.senha = json['password'];
}
}
\ No newline at end of file
import 'package:shared_preferences/shared_preferences.dart';
import '../dio.dart';
import 'login-model.dart';
import 'dart:convert' as convert;
import 'package:http/http.dart' as http;
import 'dart:io';
class LoginService {
int status;
LoginModel loginModel;
LoginModel loginResposta = new LoginModel();
Future<int> checaLogin(LoginModel loginModel) async {
String url = "http://new-sigws.intranet.uema.br/api/v1/login";
var dio = CustomDio().instance;
return dio.post(url, data: {
'login': loginModel.login,
'senha': loginModel.senha
}).then((res) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString('token', res.data['token']);
status = res.statusCode;
// loginResposta=LoginModel.fromMap(convert.jsonDecode(res.data));
print(res.data['token']);
return status;
}).catchError((err) {
return 404;
});
}
}
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_masked_text/flutter_masked_text.dart';
import 'package:uema_iduema/src/login/componentes/rodape-login.dart';
import 'package:uema_iduema/src/login/componentes/verificador-login.dart';
import 'package:uema_iduema/src/login/login-model.dart';
import 'package:uema_iduema/src/login/login-service.dart';
import 'package:uema_iduema/src/tema/background.dart' as Tema;
/*
Classe de visualização da Página Inicial
*/
class LoginView extends StatefulWidget {
@override
LoginViewState createState() {
return LoginViewState();
}
}
class LoginViewState extends State<LoginView> {
LoginModel loginModel = new LoginModel();
LoginService loginService = new LoginService();
VerificadorLogin exceptions = new VerificadorLogin();
final GlobalKey<FormState> _formKey = new GlobalKey<FormState>();
var loginController = new MaskedTextController(mask: '000.000.000-00');
TextEditingController senhaController = TextEditingController();
bool _validate = false;
String login, senha;
_validarcpf() {}
_sendForm() {
if (_formKey.currentState.validate()) {
_formKey.currentState.save();
login = loginController.text.replaceAll(new RegExp(r'[.\-]'), '');
senha = senhaController.text;
loginModel.login = login;
loginModel.senha = senha;
//print("login: ${loginModel.login},senha: ${loginModel.senha}");
Future<int> statusConexao = loginService.checaLogin(loginModel);
statusConexao.then((resultado) {
exceptions.verificador(resultado, loginModel.login, context);
});
setState(() {
loginController.text = "";
senhaController.text = "";
});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: GestureDetector(
onTap: (){
FocusScope.of(context).unfocus();
},
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
gradient: Tema.Background.gradientePrimario,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
carregarLogo(),
SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
),
carregarLogin(),
SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
),
RodapeLogin()
],
),
),
),
),
);
}
Widget carregarLogo() {
return new Center(
child: new Image(
height: MediaQuery.of(context).size.height * 0.3,
image: new AssetImage("assets/img/logo_idUema.png"),
),
);
}
Widget carregarLogin() {
return new Center(
child: new Container(
height: MediaQuery.of(context).size.height * 0.3,
child: new Form(
key: _formKey,
autovalidate: _validate,
child: _formUI(),
),
));
}
Widget _formUI() {
double largura = (MediaQuery.of(context).size.width - 60);
return new Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
new SizedBox(
height: MediaQuery.of(context).size.height * 0.08,
width: largura,
child: new TextFormField(
style:
TextStyle(fontSize: MediaQuery.of(context).size.width * 0.05),
controller: loginController,
decoration: new InputDecoration(
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: const BorderSide(color: Colors.white),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: const BorderSide(color: Colors.white),
),
fillColor: Colors.white,
filled: true,
contentPadding:
new EdgeInsets.all(MediaQuery.of(context).size.width * 0.025),
hintText: 'CPF',
hintStyle: TextStyle(
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
),
inputFormatters: [
new LengthLimitingTextInputFormatter(15),
],
keyboardType: TextInputType.number,
validator: (text) {
if (text == "") return "Preencha o campo acima!";
},
),
),
new SizedBox(
height: MediaQuery.of(context).size.height * 0.08,
width: largura,
child: new TextFormField(
style:
TextStyle(fontSize: MediaQuery.of(context).size.width * 0.05),
controller: senhaController,
obscureText: true,
decoration: new InputDecoration(
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: const BorderSide(color: Colors.white),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: const BorderSide(color: Colors.white),
),
fillColor: Colors.white,
filled: true,
contentPadding:
new EdgeInsets.all(MediaQuery.of(context).size.width * 0.025),
hintText: 'SENHA',
hintStyle: TextStyle(
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
),
validator: (text) {
if (text == "") return "Preencha o campo acima!";
},
),
),
new SizedBox(
height: MediaQuery.of(context).size.height * 0.07,
width: largura,
child: new GestureDetector(
child: new Card(
color: Color(0xFF113A68),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
child: Center(
child: Text(
"LOGIN",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Poppins',
color: Colors.white,
fontSize: MediaQuery.of(context).size.width * 0.06,
fontWeight: FontWeight.w600,
),
),
)),
onTap: () {
_sendForm();
},
),
)
],
);
}
}
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:uema_iduema/src/login/login-view.dart';
import 'package:uema_iduema/src/tema/background.dart' as Tema;
class SplashScreen extends StatefulWidget {
@override
_SplashScreenState createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
@override
void initState() {
// TODO: implement initState
super.initState();
Timer(Duration(seconds: 3), () {
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => LoginView()),
);
});
}
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(gradient: Tema.Background.gradientePrimario),
child: Center(
child: Image.asset("assets/img/logo_idUema.png", height: MediaQuery.of(context).size.height * 0.4,)
),
);
}
}
\ No newline at end of file
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'dart:ui';
class Background{
const Background();
static const Color corInicial = const Color(0xFFFFFFFF);
static const Color corFinal = const Color(0xFF6495ED);
static const gradientePrimario = const LinearGradient(
colors: const[corInicial, corFinal],
begin: Alignment.topCenter,
end: Alignment.bottomCenter
);
}
\ No newline at end of file
import 'dart:convert' as convert;
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:uema_iduema/src/login/login-model.dart';
import 'dart:io';
import 'package:uema_iduema/src/usuario/usuario-model.dart';
import 'package:uema_iduema/src/usuario/usuario-service.dart';
import '../dio.dart';
Future<UrlFoto> urlFoto() async {
UsuarioModel user = new UsuarioModel();
LoginModel loginModel = new LoginModel();
final response = await http.get(
'https://sis.sig.uema.br/sigaa/resgatarFotoUsuario?cpf=${user.cpf.toString()}');
print(loginModel.login);
if (response.statusCode == 200) {
// If the server did return a 200 OK response,
// then parse the JSON.
print('Resgata imagem' + response.statusCode.toString());
print(response.body);
print(UrlFoto.fromJson(jsonDecode(response.body)));
return UrlFoto.fromJson(jsonDecode(response.body));
} else {
// If the server did not return a 200 OK response,
// then throw an exception.
throw Exception('Failed to load album');
}
}
Future<UrlFoto> retornoInfo(String dado) async {
UsuarioModel user = new UsuarioModel();
String url = "https://sis.sig.uema.br/sigaa/resgatarFotoUsuario?cpf=${dado}";
print(dado);
var dio = CustomDio.withAuthentication().instance;
UrlFoto urlFoto = new UrlFoto();
return dio.get(url).then((res) {
print(res.toString());
urlFoto = UrlFoto.fromJson(res.data);
print(res.data);
return urlFoto;
});
}
class UrlFoto {
final String url;
UrlFoto({@required this.url});
factory UrlFoto.fromJson(Map<String, dynamic> json) {
return UrlFoto(url: json['url']);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
return data;
}
}
class ImagemService extends StatefulWidget {
final String dado;
const ImagemService({Key key, this.dado}) : super(key: key);
String get _dado {
return dado;
}
@override
_ImagemServiceState createState() => _ImagemServiceState();
}
class _ImagemServiceState extends State<ImagemService> {
UsuarioService userService = new UsuarioService();
UsuarioModel user = new UsuarioModel();
Future<UrlFoto> pegarFoto;
@override
void initState() {
//retornoInfo();
pegarFoto = urlFoto();
super.initState();
}
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: pegarFoto,
builder: (context, snapshot) {
if (snapshot.hasError) {
return Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(
Icons.face_outlined,
size: 100,
),
Text(
'Sem foto!',
style: TextStyle(fontSize: 25),
)
],
),
);
} else if (snapshot.hasData) {
return Container(
height: MediaQuery.of(context).size.height * 0.255,
width: MediaQuery.of(context).size.width * 0.35,
child: Text(
'https://sis.sig.uema.br/' + snapshot.data.url.toString(),
),
);
} else {
return CircularProgressIndicator();
}
});
}
}
class UsuarioModel{
int id_interno;
String nome;
String cpf;
String dataNascimento;
String lotacao;
String categoria;
String cargo;
String error;
UsuarioModel ();
Map toMap(){
var json = new Map<String,dynamic>();
json['id-interno'] = id_interno;
json['nome'] = nome;
json['cpf'] = cpf;
json['dt-nasc'] = dataNascimento;
json['unidade-nome'] = lotacao;
json['categoria-raiz'] = categoria;
json['cargo-atual'] = cargo;
json['error'] = error;
}
UsuarioModel.fromMap(Map<String,dynamic> json){
this.id_interno = json['id-interno'];
this.nome = json['nome'];
this.cpf = json['cpf'];
this.dataNascimento = json['dt-nasc'];
this.lotacao = json['unidade-nome'];
this.categoria = json['categoria-raiz'];
this.cargo = json['cargo-atual'];
this.error = json['error'];
}
}
\ No newline at end of file
import 'dart:convert' as convert;
import 'package:http/http.dart' as http;
import 'dart:io';
import 'package:uema_iduema/src/usuario/usuario-model.dart';
import '../dio.dart';
class UsuarioService{
Future<UsuarioModel> retornoInfo(String dado) async{
String url = "http://new-sigws.intranet.uema.br/api/v1/cart-func?cpf=$dado";
var dio = CustomDio.withAuthentication().instance;
UsuarioModel userDados = new UsuarioModel();
return dio
.get(url)
.then((res){
userDados=UsuarioModel.fromMap(res.data);
print(res.data);
return userDados;
});
}
}
This diff is collapsed.
name: uema_iduema
description: Aplicativo de Identificação Funcional da Uema.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.6.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
masked_text: ^0.0.6
text_input_mask_formatter: ^0.0.3
flutter_masked_text: ^0.8.0
masked_text_input_formatter: ^0.0.1
http: ^0.12.0+4
flutter_launcher_icons: ^0.7.4
flutter_launcher_name: ^0.0.1
url_launcher: ^5.4.1
flutter_linkify: ^3.1.0
flushbar: ^1.9.1
image_picker: ^0.6.3+1
simple_image_crop: ^0.1.3
image_crop: ^0.4.0
dio: ^3.0.9
shared_preferences: ^2.0.5
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/img/logo_idUema.png
- assets/img/icone.png
- assets/img/topo-progep.png
- assets/img/topo_uema.jpg
- assets/img/logo_uema.png
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: Century
fonts:
- asset: assets/fontes/Century Gothic.ttf
- family: Poppins
fonts:
- asset: assets/fontes/Poppins-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
flutter_icons:
image_path: "assets/img/icone.png"
android: "launcher_icon"
ios: true
flutter_launcher_name:
name: "ID UEMA"
This diff is collapsed.
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