Repository: livelivecoding/flutter-weather-app
Branch: master
Commit: c92aa252a6fd
Files: 59
Total size: 95.1 KB
Directory structure:
gitextract_ea601f7q/
├── .github/
│ └── workflows/
│ └── main.yml
├── .gitignore
├── .metadata
├── README.md
├── android/
│ ├── .gitignore
│ ├── app/
│ │ ├── build.gradle
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin/
│ │ │ └── com/
│ │ │ └── diegoveloper/
│ │ │ └── weatherflut/
│ │ │ └── MainActivity.kt
│ │ └── res/
│ │ ├── drawable/
│ │ │ └── launch_background.xml
│ │ └── values/
│ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle/
│ │ └── wrapper/
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ └── settings.gradle
├── ios/
│ ├── .gitignore
│ ├── Flutter/
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Runner/
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets/
│ │ │ ├── AppIcon.appiconset/
│ │ │ │ └── Contents.json
│ │ │ └── LaunchImage.imageset/
│ │ │ ├── Contents.json
│ │ │ └── README.md
│ │ ├── Base.lproj/
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
│ ├── Runner.xcodeproj/
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace/
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata/
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ │ └── xcshareddata/
│ │ └── xcschemes/
│ │ └── Runner.xcscheme
│ └── Runner.xcworkspace/
│ ├── contents.xcworkspacedata
│ └── xcshareddata/
│ ├── IDEWorkspaceChecks.plist
│ └── WorkspaceSettings.xcsettings
├── lib/
│ ├── data/
│ │ ├── data_constants.dart
│ │ └── repository/
│ │ ├── api_impl.dart
│ │ ├── api_repository.dart
│ │ ├── store_impl.dart
│ │ └── store_repository.dart
│ ├── main.dart
│ ├── model/
│ │ ├── city.dart
│ │ └── weather.dart
│ └── ui/
│ ├── cities/
│ │ ├── add/
│ │ │ ├── add_city_bloc.dart
│ │ │ └── add_city_page.dart
│ │ ├── cities_bloc.dart
│ │ └── cities_page.dart
│ ├── common/
│ │ ├── debouncer.dart
│ │ ├── fade_indexed_stack.dart
│ │ ├── header_widget.dart
│ │ └── loader_widget.dart
│ ├── home/
│ │ ├── empty_widget.dart
│ │ ├── weather_details_widget.dart
│ │ └── weathers_widget.dart
│ ├── home_bloc.dart
│ ├── home_page.dart
│ └── ui_constants.dart
├── pubspec.yaml
└── test/
└── widget_test.dart
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/main.yml
================================================
name: Flutter CI
# This workflow is triggered on pushes to the repository.
on:
push:
branches:
- master
# on: push # Default will running for every branch.
jobs:
build:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
steps:
# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
# Setup the flutter environment.
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
# flutter-version: '1.12.x' # you can also specify exact version of flutter
# Get flutter dependencies.
- run: flutter pub get
# Statically analyze the Dart code for any errors.
- run: flutter analyze .
# Build apk.
- run: flutter build apk
# Upload generated apk to the artifacts.
- uses: actions/upload-artifact@v1
with:
name: release-apk
path: build/app/outputs/apk/release/app-release.apk
================================================
FILE: .gitignore
================================================
# 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/
.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
# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
================================================
FILE: .metadata
================================================
# 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: 1ad9baa8b99a2897c20f9e6e54d3b9b359ade314
channel: stable
project_type: app
================================================
FILE: README.md
================================================
# Weatherflut
Es un proyecto creado en el live streaming que se hizo en el canal de Leonidas Esteban, luego fue terminado en el canal de The Dart Side.
Contributors:
- Diego Velásquez - @diegoveloper
- Argel Bejarano - @ArkangelB
- Leonidas Esteban - @LeonidasEsteban
- Mauricio Lopez (UX) - https://www.behance.net/designylove
## Instalador
Pueden descargar el instalador aquí: https://drive.google.com/file/d/1h5r6S7lg6kmy4wwwepnAyTryvmos2KHJ/view?usp=sharing
================================================
FILE: android/.gitignore
================================================
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
================================================
FILE: android/app/build.gradle
================================================
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 28
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.diegoveloper.weatherflut"
minSdkVersion 16
targetSdkVersion 28
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"
}
================================================
FILE: android/app/src/main/AndroidManifest.xml
================================================
================================================
FILE: android/app/src/main/kotlin/com/diegoveloper/weatherflut/MainActivity.kt
================================================
package com.diegoveloper.weatherflut
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
================================================
FILE: android/app/src/main/res/drawable/launch_background.xml
================================================
================================================
FILE: android/app/src/main/res/values/styles.xml
================================================
================================================
FILE: android/build.gradle
================================================
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
}
================================================
FILE: android/gradle/wrapper/gradle-wrapper.properties
================================================
#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
================================================
FILE: android/gradle.properties
================================================
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
================================================
FILE: android/settings.gradle
================================================
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
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"
================================================
FILE: ios/.gitignore
================================================
*.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
================================================
FILE: ios/Flutter/AppFrameworkInfo.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
App
CFBundleIdentifier
io.flutter.flutter.app
CFBundleInfoDictionaryVersion
6.0
CFBundleName
App
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
1.0
MinimumOSVersion
8.0
================================================
FILE: ios/Flutter/Debug.xcconfig
================================================
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
================================================
FILE: ios/Flutter/Release.xcconfig
================================================
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
================================================
FILE: ios/Podfile
================================================
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
end
generated_key_values
end
target 'Runner' do
use_frameworks!
use_modular_headers!
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
================================================
FILE: ios/Runner/AppDelegate.swift
================================================
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)
}
}
================================================
FILE: ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
"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"
}
}
================================================
FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
================================================
{
"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"
}
}
================================================
FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
================================================
# 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.
================================================
FILE: ios/Runner/Base.lproj/LaunchScreen.storyboard
================================================
================================================
FILE: ios/Runner/Base.lproj/Main.storyboard
================================================
================================================
FILE: ios/Runner/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
weatherflut
CFBundlePackageType
APPL
CFBundleShortVersionString
$(FLUTTER_BUILD_NAME)
CFBundleSignature
????
CFBundleVersion
$(FLUTTER_BUILD_NUMBER)
LSRequiresIPhoneOS
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
Main
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UISupportedInterfaceOrientations~ipad
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UIViewControllerBasedStatusBarAppearance
================================================
FILE: ios/Runner/Runner-Bridging-Header.h
================================================
#import "GeneratedPluginRegistrant.h"
================================================
FILE: ios/Runner.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
43E5923BA10607E6D4FFCA76 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA1CDDBB073BAFE5C5A01993 /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
17276DA01BC6E874D3901981 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
31EBE276798C6A168C0982AD /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
68469A604C9FFF0B3F46609D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
CA1CDDBB073BAFE5C5A01993 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
43E5923BA10607E6D4FFCA76 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
1D7D341D7F00D0CB01B1087C /* Frameworks */ = {
isa = PBXGroup;
children = (
CA1CDDBB073BAFE5C5A01993 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "";
};
874BF1BFF8721B8E08D6A53F /* Pods */ = {
isa = PBXGroup;
children = (
68469A604C9FFF0B3F46609D /* Pods-Runner.debug.xcconfig */,
17276DA01BC6E874D3901981 /* Pods-Runner.release.xcconfig */,
31EBE276798C6A168C0982AD /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
874BF1BFF8721B8E08D6A53F /* Pods */,
1D7D341D7F00D0CB01B1087C /* Frameworks */,
);
sourceTree = "";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "";
};
97C146F11CF9000F007C117D /* Supporting Files */ = {
isa = PBXGroup;
children = (
);
name = "Supporting Files";
sourceTree = "";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
B12BBDEAA8C70FC5255EF803 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
490145E608268371E0005396 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
490145E608268371E0005396 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
B12BBDEAA8C70FC5255EF803 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.diegoveloper.weatherflut;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.diegoveloper.weatherflut;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.diegoveloper.weatherflut;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
================================================
FILE: ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
IDEDidComputeMac32BitWarning
================================================
FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
================================================
PreviewsEnabled
================================================
FILE: ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
================================================
================================================
FILE: ios/Runner.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
IDEDidComputeMac32BitWarning
================================================
FILE: ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
================================================
PreviewsEnabled
================================================
FILE: lib/data/data_constants.dart
================================================
const api = '$server/api/location/';
const server = 'https://www.metaweather.com/';
================================================
FILE: lib/data/repository/api_impl.dart
================================================
import 'dart:convert';
import 'package:weatherflut/data/data_constants.dart';
import 'package:weatherflut/data/repository/api_repository.dart';
import 'package:weatherflut/model/city.dart';
import 'package:http/http.dart' as http;
import 'package:weatherflut/model/weather.dart';
class ApiImpl extends ApiRepository {
@override
Future> getCities(String text) async {
final url = '${api}search/?query=$text';
final response = await http.get(url);
final body = Utf8Decoder().convert(response.bodyBytes);
final data = jsonDecode(body) as List;
final cities = data.map((e) => City.fromJson(e)).toList();
return cities;
}
@override
Future getWeathers(City city) async {
final url = '$api${city.id}';
final response = await http.get(url);
final body = Utf8Decoder().convert(response.bodyBytes);
final data = jsonDecode(body);
final weatherData = data['consolidated_weather'] as List;
final weathers = weatherData.map((e) => Weather.fromJson(e)).toList();
final newCity = city.fromWeathers(weathers);
return newCity;
}
}
================================================
FILE: lib/data/repository/api_repository.dart
================================================
import 'package:weatherflut/model/city.dart';
abstract class ApiRepository {
Future> getCities(String text);
Future getWeathers(City city);
}
================================================
FILE: lib/data/repository/store_impl.dart
================================================
import 'dart:convert';
import 'package:weatherflut/data/repository/store_repository.dart';
import 'package:weatherflut/model/city.dart';
import 'package:shared_preferences/shared_preferences.dart';
const keyCities = 'cities';
const keyLastUpdate = 'last_update';
class StoreImpl extends StoreRepository {
@override
Future> getCities() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final list = prefs.getStringList(keyCities);
if (list != null && list.isNotEmpty) {
final cities = list
.map(
(e) => City.fromJson(
jsonDecode(e),
),
)
.toList();
return cities;
}
return [];
}
@override
Future saveCity(City city) async {
final list = (await getCities());
for (City item in list) {
if (item.id == city.id) {
throw Exception('La ciudad ya existe');
}
}
list.add(city);
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setStringList(
keyCities,
list.map((e) => jsonEncode(e.toJson())).toList(),
);
}
@override
Future saveCities(List cities) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setStringList(
keyCities,
cities.map((e) => jsonEncode(e.toJson())).toList(),
);
}
@override
Future getLastUpdate() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final data = prefs.getInt(keyLastUpdate);
if (data != null && data > 0) {
return DateTime.fromMillisecondsSinceEpoch(data);
}
return null;
}
@override
Future saveLastUpdate() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setInt(keyLastUpdate, DateTime.now().millisecondsSinceEpoch);
}
@override
Future deleteCity(City city) async {
final cities = await getCities();
cities.removeWhere((element) => element.id == city.id);
saveCities(cities);
}
}
================================================
FILE: lib/data/repository/store_repository.dart
================================================
import 'package:weatherflut/model/city.dart';
abstract class StoreRepository {
Future saveCity(City city);
Future saveCities(List cities);
Future> getCities();
Future getLastUpdate();
Future saveLastUpdate();
Future deleteCity(City city);
}
================================================
FILE: lib/main.dart
================================================
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:weatherflut/data/repository/api_impl.dart';
import 'package:weatherflut/data/repository/api_repository.dart';
import 'package:weatherflut/data/repository/store_impl.dart';
import 'package:weatherflut/data/repository/store_repository.dart';
import 'package:weatherflut/ui/home_page.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
Provider(
create: (_) => ApiImpl(),
),
Provider(
create: (_) => StoreImpl(),
),
],
child: MaterialApp(
title: 'WeatherFlut',
debugShowCheckedModeBanner: false,
theme: ThemeData.light(),
home: HomePage(),
),
);
}
}
================================================
FILE: lib/model/city.dart
================================================
import 'package:weatherflut/model/weather.dart';
class City {
final String title;
final int id;
final List weathers;
City({
this.title,
this.id,
this.weathers,
});
Map toJson() => {
"title": title,
"woeid": id,
"weathers": weathers.map((e) => e.toJson()).toList(),
};
factory City.fromJson(Map map) {
final myWeathers = map['weathers'];
return City(
id: map['woeid'],
title: map['title'],
weathers: myWeathers != null
? (myWeathers as List).map((e) => Weather.fromJson(e)).toList()
: null,
);
}
City fromWeathers(List weathers) {
return City(
id: id,
title: title,
weathers: weathers,
);
}
}
================================================
FILE: lib/model/weather.dart
================================================
import 'dart:convert';
Weather weatherFromJson(String str) => Weather.fromJson(
json.decode(str),
);
String weatherToJson(Weather data) => json.encode(
data.toJson(),
);
class Weather {
Weather({
this.id,
this.weatherStateName,
this.weatherStateAbbr,
this.windDirectionCompass,
this.created,
this.applicableDate,
this.minTemp,
this.maxTemp,
this.theTemp,
this.windSpeed,
this.windDirection,
this.airPressure,
this.humidity,
this.visibility,
this.predictability,
});
int id;
String weatherStateName;
String weatherStateAbbr;
String windDirectionCompass;
DateTime created;
DateTime applicableDate;
double minTemp;
double maxTemp;
double theTemp;
double windSpeed;
double windDirection;
double airPressure;
num humidity;
double visibility;
int predictability;
factory Weather.fromJson(Map json) => Weather(
id: json["id"],
weatherStateName: json["weather_state_name"],
weatherStateAbbr: json["weather_state_abbr"],
windDirectionCompass: json["wind_direction_compass"],
created: DateTime.parse(json["created"]),
applicableDate: DateTime.parse(json["applicable_date"]),
minTemp: json["min_temp"].toDouble(),
maxTemp: json["max_temp"].toDouble(),
theTemp: json["the_temp"].toDouble(),
windSpeed: json["wind_speed"].toDouble(),
windDirection: json["wind_direction"].toDouble(),
airPressure: json["air_pressure"],
humidity: json["humidity"],
visibility: json["visibility"].toDouble(),
predictability: json["predictability"],
);
Map toJson() => {
"id": id,
"weather_state_name": weatherStateName,
"weather_state_abbr": weatherStateAbbr,
"wind_direction_compass": windDirectionCompass,
"created": created.toIso8601String(),
"applicable_date":
"${applicableDate.year.toString().padLeft(4, '0')}-${applicableDate.month.toString().padLeft(2, '0')}-${applicableDate.day.toString().padLeft(2, '0')}",
"min_temp": minTemp,
"max_temp": maxTemp,
"the_temp": theTemp,
"wind_speed": windSpeed,
"wind_direction": windDirection,
"air_pressure": airPressure,
"humidity": humidity,
"visibility": visibility,
"predictability": predictability,
};
}
================================================
FILE: lib/ui/cities/add/add_city_bloc.dart
================================================
import 'package:flutter/material.dart';
import 'package:weatherflut/data/repository/api_repository.dart';
import 'package:weatherflut/data/repository/store_repository.dart';
import 'package:weatherflut/model/city.dart';
import 'package:weatherflut/ui/common/debouncer.dart';
class AddCityBloc extends ChangeNotifier {
final debouncer = Debouncer();
final StoreRepository storage;
final ApiRepository apiService;
List cities = [];
bool loading = false;
String errorMessage;
AddCityBloc({
@required this.storage,
@required this.apiService,
});
void onChangedText(String text) {
debouncer.run(
() {
if (text.isNotEmpty) requestSearch(text);
},
);
}
void requestSearch(String text) async {
loading = true;
notifyListeners();
cities = await apiService.getCities(text);
loading = false;
notifyListeners();
}
Future addCity(City city) async {
loading = true;
notifyListeners();
final newCity = await apiService.getWeathers(city);
try {
await storage.saveCity(newCity);
errorMessage = null;
return true;
} on Exception catch (ex) {
print(ex.toString());
errorMessage = ex.toString();
loading = false;
notifyListeners();
return false;
}
}
}
================================================
FILE: lib/ui/cities/add/add_city_page.dart
================================================
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:weatherflut/data/repository/api_repository.dart';
import 'package:weatherflut/data/repository/store_repository.dart';
import 'package:weatherflut/model/city.dart';
import 'package:weatherflut/ui/cities/add/add_city_bloc.dart';
import 'package:weatherflut/ui/common/header_widget.dart';
import 'package:weatherflut/ui/common/loader_widget.dart';
import 'package:weatherflut/ui/ui_constants.dart';
class AddCityPage extends StatefulWidget {
@override
_AddCityPageState createState() => _AddCityPageState();
}
class _AddCityPageState extends State {
AddCityBloc bloc;
void handleAddTap(City city) async {
final result = await bloc.addCity(city);
if (result) {
Navigator.of(context).pop();
}
}
@override
void initState() {
bloc = AddCityBloc(
storage: context.read(),
apiService: context.read(),
);
super.initState();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: bloc,
builder: (context, child) {
return Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.white,
iconTheme: IconThemeData(
color: Colors.black,
),
),
body: Padding(
padding: const EdgeInsets.all(25),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
HeaderWidget(
title: 'Agregar ciudad',
),
const SizedBox(
height: 15,
),
ClipRRect(
borderRadius: BorderRadius.circular(15.0),
child: TextField(
onChanged: bloc.onChangedText,
decoration: InputDecoration(
focusedBorder: InputBorder.none,
border: InputBorder.none,
filled: true,
hintText: 'Buscar ciudad',
fillColor: Colors.grey[200],
prefixIcon: Icon(
Icons.search,
color: Colors.grey,
),
),
),
),
if (bloc.errorMessage != null)
Text(
bloc.errorMessage,
style: TextStyle(color: Colors.red),
),
const SizedBox(
height: 25,
),
Expanded(
child: ListView.builder(
itemCount: bloc.cities.length,
itemBuilder: (context, index) {
final city = bloc.cities[index];
return ListTile(
title: Text(
city.title,
style: TextStyle(
fontWeight: FontWeight.w700,
),
),
trailing: IconButton(
icon: Icon(
Icons.add,
color: primaryColor,
),
onPressed: () {
handleAddTap(city);
},
),
);
},
),
),
if (bloc.loading)
Center(
child: LoaderWidget(),
),
],
),
),
);
},
);
}
}
================================================
FILE: lib/ui/cities/cities_bloc.dart
================================================
import 'package:flutter/material.dart';
import 'package:weatherflut/data/repository/store_repository.dart';
import 'package:weatherflut/model/city.dart';
class CitiesBloc extends ChangeNotifier {
List cities = [];
final StoreRepository storage;
CitiesBloc({@required this.storage});
void loadCities() async {
cities = await storage.getCities();
notifyListeners();
}
void deleteCity(City city) async {
await storage.deleteCity(city);
loadCities();
}
}
================================================
FILE: lib/ui/cities/cities_page.dart
================================================
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:weatherflut/data/repository/store_repository.dart';
import 'package:weatherflut/model/city.dart';
import 'package:weatherflut/ui/cities/add/add_city_page.dart';
import 'package:weatherflut/ui/cities/cities_bloc.dart';
import 'package:weatherflut/ui/common/header_widget.dart';
import 'package:weatherflut/ui/ui_constants.dart';
class CitiesPage extends StatefulWidget {
@override
_CitiesPageState createState() => _CitiesPageState();
}
class _CitiesPageState extends State {
CitiesBloc bloc;
void handleDeleteTap(City city) async {
final result = await showDialog(
context: context,
barrierDismissible: false,
builder: (context) => Center(
child: AlertDialog(
title: Text('Confirmación'),
content: Text('Seguro que desea eliminar la ciudad ${city.title}?'),
actions: [
OutlineButton(
child: Text('NO'),
onPressed: () => Navigator.of(context).pop(false),
),
OutlineButton(
child: Text('SI'),
onPressed: () => Navigator.of(context).pop(true),
)
],
),
),
);
if (result) {
bloc.deleteCity(city);
}
}
@override
void initState() {
bloc = CitiesBloc(
storage: context.read(),
);
bloc.loadCities();
super.initState();
}
void handleNavigatePress(BuildContext context) async {
await Navigator.of(context).push(
PageRouteBuilder(
transitionDuration: const Duration(
milliseconds: 400,
),
pageBuilder: (_, animation1, animation2) {
return SlideTransition(
position: Tween(
begin: Offset(0.0, 1.0),
end: Offset(0.0, 0.0),
).animate(animation1),
child: AddCityPage(),
);
},
),
);
bloc.loadCities();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: bloc,
builder: (context, child) {
return Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.white,
iconTheme: IconThemeData(
color: Colors.black,
),
),
floatingActionButton: Padding(
padding: const EdgeInsets.only(bottom: 20.0),
child: FloatingActionButton(
child: Icon(Icons.add),
backgroundColor: primaryColor,
onPressed: () => handleNavigatePress(context),
),
),
body: Center(
child: Padding(
padding: const EdgeInsets.all(25),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
HeaderWidget(
title: 'Mis ciudades',
),
Expanded(
child: bloc.cities.isEmpty
? Center(
child: Text('No tienes ciudades :('),
)
: ListView.builder(
padding: const EdgeInsets.only(
bottom: 20,
),
itemCount: bloc.cities.length,
itemBuilder: (context, index) {
final city = bloc.cities[index];
return CityItem(
city: city,
onTap: () => handleDeleteTap(city),
);
},
),
),
],
),
),
),
);
},
);
}
}
class CityItem extends StatelessWidget {
final City city;
final VoidCallback onTap;
const CityItem({
Key key,
this.city,
this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Container(
color: Colors.grey[200],
padding: const EdgeInsets.all(20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
city.title,
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 20,
),
),
InkWell(
onTap: onTap,
child: Icon(
Icons.close,
),
),
],
),
),
);
}
}
================================================
FILE: lib/ui/common/debouncer.dart
================================================
import 'dart:async';
import 'package:flutter/material.dart';
class Debouncer {
Timer _timer;
void run(VoidCallback callback) {
_timer?.cancel();
_timer = Timer(
const Duration(seconds: 1),
callback,
);
}
}
================================================
FILE: lib/ui/common/fade_indexed_stack.dart
================================================
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
class FadeIndexedStack extends StatefulWidget {
final int currentIndex;
final List children;
const FadeIndexedStack({
Key key,
this.currentIndex,
this.children,
}) : super(key: key);
@override
_FadeIndexedStackState createState() => _FadeIndexedStackState();
}
class _FadeIndexedStackState extends State
with SingleTickerProviderStateMixin {
AnimationController _controller;
@override
void didUpdateWidget(FadeIndexedStack oldWidget) {
if (widget.currentIndex != oldWidget.currentIndex) {
_controller.forward(from: 0.0);
}
super.didUpdateWidget(oldWidget);
}
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(
milliseconds: 10,
),
);
_controller.forward();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
timeDilation = 1.0;
return FadeTransition(
opacity: _controller,
child: IndexedStack(
index: widget.currentIndex,
children: widget.children,
),
);
}
}
================================================
FILE: lib/ui/common/header_widget.dart
================================================
import 'package:flutter/material.dart';
class HeaderWidget extends StatelessWidget {
final String title;
const HeaderWidget({Key key, this.title}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 15.0),
child: Text(
title,
style: TextStyle(
fontSize: 23,
fontWeight: FontWeight.w700,
),
),
),
const SizedBox(
height: 20,
),
Divider(),
],
);
}
}
================================================
FILE: lib/ui/common/loader_widget.dart
================================================
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math.dart' as vector;
class LoaderWidget extends StatefulWidget {
@override
_LoaderWidgetState createState() => _LoaderWidgetState();
}
class _LoaderWidgetState extends State
with SingleTickerProviderStateMixin {
AnimationController _controller;
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(seconds: 1),
);
_controller.repeat();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return Transform.rotate(
angle: vector.radians(
180 * _controller.value,
),
child: child,
);
},
child: Image.asset(
'assets/loader.png',
height: 40,
),
);
}
}
================================================
FILE: lib/ui/home/empty_widget.dart
================================================
import 'package:flutter/material.dart';
import 'package:weatherflut/ui/ui_constants.dart';
class EmptyWidget extends StatelessWidget {
final VoidCallback onTap;
const EmptyWidget({Key key, this.onTap}) : super(key: key);
@override
Widget build(BuildContext context) {
return Stack(
fit: StackFit.expand,
children: [
Positioned.fill(
child: Image.asset(
'assets/welcome.jpg',
fit: BoxFit.cover,
),
),
SafeArea(
child: Center(
child: Container(
constraints: BoxConstraints(
maxWidth: maxPageWidth,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(
height: 30,
),
Image.asset(
'assets/logo.png',
height: 55,
),
const SizedBox(
height: 80,
),
Text(
'Hola,\nBienvenido',
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 34,
fontWeight: FontWeight.bold,
),
),
const SizedBox(
height: 20,
),
Text(
'Qué te parece si agregamos\nuna nueva ciudad?',
textAlign: TextAlign.start,
),
const SizedBox(
height: 50,
),
RaisedButton(
color: Colors.white,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
15.0,
),
),
child: Text('Agregar ciudad'),
onPressed: onTap,
),
],
),
),
),
),
],
);
}
}
================================================
FILE: lib/ui/home/weather_details_widget.dart
================================================
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:weatherflut/data/data_constants.dart';
import 'package:weatherflut/model/city.dart';
final dayFormat = DateFormat('EEEE');
class WeatherDetailsWidget extends StatelessWidget {
final City city;
const WeatherDetailsWidget({Key key, this.city}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
height: MediaQuery.of(context).size.height * 0.7,
child: Align(
alignment: Alignment.bottomCenter,
child: Column(
children: [
const SizedBox(
height: 30,
),
Text(
'Pronóstico de ${city.weathers.length} Días',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 25,
),
),
const SizedBox(
height: 30,
),
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: city.weathers.length,
itemBuilder: (context, index) {
final weather = city.weathers[index];
return Padding(
padding: const EdgeInsets.all(20.0),
child: Card(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(20.0),
child: Row(
children: [
Text(
dayFormat.format(
weather.applicableDate,
),
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10.0),
child: Image.network(
'${server}static/img/weather/png/64/${weather.weatherStateAbbr}.png',
height: 25,
),
),
Spacer(),
Text(
'${weather.theTemp.toInt().toString()}°C',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 17,
),
),
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
'Viento',
textAlign: TextAlign.center,
),
),
Expanded(
child: Text(
'Presión de aire',
textAlign: TextAlign.center,
),
),
Expanded(
child: Text(
'Humedad',
textAlign: TextAlign.center,
),
),
],
),
const SizedBox(
height: 15,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
'${weather.windSpeed.toStringAsFixed(2)} mph',
textAlign: TextAlign.center,
),
),
Expanded(
child: Text(
'${weather.airPressure} mbar',
textAlign: TextAlign.center,
),
),
Expanded(
child: Text(
'${weather.humidity}%',
textAlign: TextAlign.center,
),
),
],
),
const SizedBox(
height: 15,
),
],
),
),
);
},
),
),
],
),
),
);
}
}
================================================
FILE: lib/ui/home/weathers_widget.dart
================================================
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:weatherflut/model/city.dart';
import 'package:weatherflut/ui/home/weather_details_widget.dart';
import 'package:weatherflut/ui/ui_constants.dart';
DateFormat format = DateFormat('E, dd MMM yyyy');
class WeathersWidget extends StatefulWidget {
final List cities;
final VoidCallback onTap;
const WeathersWidget({
Key key,
this.cities,
this.onTap,
}) : super(key: key);
@override
_WeathersWidgetState createState() => _WeathersWidgetState();
}
class _WeathersWidgetState extends State {
int _currentIndex = 0;
void handleArrowPressed(City city) {
showBottomSheet(
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(
40.0,
),
),
),
builder: (_) {
return WeatherDetailsWidget(city: city);
},
);
}
@override
Widget build(BuildContext context) {
final weather = widget.cities[_currentIndex].weathers.first;
return Stack(
fit: StackFit.expand,
children: [
Positioned.fill(
child: AnimatedSwitcher(
layoutBuilder: (currentChild, previousChildren) {
return Stack(
fit: StackFit.expand,
children: [
...previousChildren,
if (currentChild != null) currentChild,
],
alignment: Alignment.center,
);
},
duration: Duration(
milliseconds: 600,
),
child: Image.asset(
'assets/background_states/${weather.weatherStateAbbr}.jpg',
fit: BoxFit.cover,
key: Key(weather.weatherStateAbbr),
),
),
),
PageView.builder(
onPageChanged: (val) {
setState(() {
_currentIndex = val;
});
},
physics: const ClampingScrollPhysics(),
itemCount: widget.cities.length,
itemBuilder: (context, index) {
final city = widget.cities[index];
return WeatherItem(
city: city,
onTap: () => handleArrowPressed(city),
);
},
),
Positioned(
left: 20,
top: 20,
child: SafeArea(
child: IconButton(
icon: Icon(Icons.add),
onPressed: widget.onTap,
),
),
),
Positioned(
right: 20,
top: 20,
child: SafeArea(
child: IconButton(
icon: Icon(Icons.settings),
onPressed: widget.onTap,
),
),
),
],
);
}
}
class WeatherItem extends StatelessWidget {
final City city;
final VoidCallback onTap;
const WeatherItem({
Key key,
this.city,
this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final weather = city.weathers.first;
return Stack(
fit: StackFit.expand,
children: [
SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(
height: 50,
),
Text(
city.title,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 40,
fontWeight: FontWeight.w700,
color: Colors.white,
shadows: shadows,
),
),
Text(
format.format(weather.applicableDate),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
shadows: shadows,
),
),
const SizedBox(
height: 50,
),
Align(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,
children: [
TweenAnimationBuilder(
tween: IntTween(
begin: 0,
end: weather.theTemp.toInt(),
),
duration: const Duration(
milliseconds: 800,
),
builder: (context, value, child) {
return Text(
value.toString(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
shadows: shadows,
fontSize: 75,
fontWeight: FontWeight.bold,
),
);
},
),
Padding(
padding: const EdgeInsets.only(top: 10),
child: Align(
alignment: Alignment.topRight,
child: Text(
'°C',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w700,
shadows: shadows,
),
),
),
),
],
),
),
Text(
weather.weatherStateName,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
shadows: shadows,
fontSize: 22,
),
),
const SizedBox(
height: 70,
),
],
),
),
Center(
child: Padding(
padding: const EdgeInsets.only(top: 30.0),
child: IconButton(
onPressed: onTap,
icon: Icon(
Icons.keyboard_arrow_up,
color: Colors.white,
size: 50,
),
),
),
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 40),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(children: [
Expanded(
child: _WeatherItemDetails(
title: 'Viento',
value: "${weather.windSpeed.toStringAsFixed(2)} mph",
),
),
Expanded(
child: _WeatherItemDetails(
title: 'Presión de aire',
value: '${weather.airPressure.toStringAsFixed(2)} mbar',
),
),
Expanded(
child: _WeatherItemDetails(
title: 'Humedad',
value: '${weather.humidity}%',
),
),
]),
const SizedBox(
height: 15,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_WeatherItemDetails(
title: 'Temp min',
value: weather.minTemp.toStringAsFixed(2),
),
_WeatherItemDetails(
title: 'Temp Max',
value: weather.maxTemp.toStringAsFixed(2),
),
],
),
],
),
),
),
],
);
}
}
class _WeatherItemDetails extends StatelessWidget {
final String title;
final String value;
const _WeatherItemDetails({Key key, this.title, this.value}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
Text(
title,
style: TextStyle(color: Colors.white, shadows: shadows),
),
const SizedBox(
height: 15,
),
Text(
value,
style: TextStyle(
color: Colors.white,
shadows: shadows,
),
),
],
);
}
}
================================================
FILE: lib/ui/home_bloc.dart
================================================
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:weatherflut/data/repository/api_repository.dart';
import 'package:weatherflut/data/repository/store_repository.dart';
import 'package:weatherflut/model/city.dart';
class HomeBloc extends ChangeNotifier {
List cities = [];
final StoreRepository storage;
final ApiRepository apiService;
bool loading = false;
final formatDate = DateFormat('dd/MM/yyyy HH');
HomeBloc({this.storage, this.apiService});
void loadCities() async {
final lastUpdate = await storage.getLastUpdate();
final now = DateTime.now();
final localCities = await storage.getCities();
if (localCities.isEmpty) return;
if (lastUpdate == null || (formatDate.format(now) != formatDate.format(lastUpdate))) {
List citiesUpdated = [];
loading = true;
notifyListeners();
for (City city in localCities) {
final cityUpdated = await apiService.getWeathers(city);
citiesUpdated.add(cityUpdated);
}
await storage.saveCities(citiesUpdated);
await storage.saveLastUpdate();
cities = citiesUpdated;
loading = false;
} else {
cities = await storage.getCities();
}
notifyListeners();
}
}
================================================
FILE: lib/ui/home_page.dart
================================================
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:weatherflut/data/repository/api_repository.dart';
import 'package:weatherflut/data/repository/store_repository.dart';
import 'package:weatherflut/ui/cities/cities_page.dart';
import 'package:weatherflut/ui/common/loader_widget.dart';
import 'package:weatherflut/ui/home/empty_widget.dart';
import 'package:weatherflut/ui/home/weathers_widget.dart';
import 'package:weatherflut/ui/home_bloc.dart';
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State with WidgetsBindingObserver {
HomeBloc bloc;
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
bloc.loadCities();
}
super.didChangeAppLifecycleState(state);
}
@override
void initState() {
bloc = HomeBloc(
apiService: context.read(),
storage: context.read(),
);
bloc.loadCities();
WidgetsBinding.instance.addObserver(this);
super.initState();
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}
void handleNavigatePress(BuildContext context) async {
await Navigator.of(context).push(
MaterialPageRoute(builder: (_) => CitiesPage()),
);
bloc.loadCities();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: bloc,
builder: (context, child) {
return Scaffold(
body: bloc.cities.isEmpty
? bloc.loading
? Center(child: LoaderWidget())
: EmptyWidget(
onTap: () => handleNavigatePress(context),
)
: WeathersWidget(
cities: bloc.cities,
onTap: () => handleNavigatePress(context),
),
);
},
);
}
}
================================================
FILE: lib/ui/ui_constants.dart
================================================
import 'package:flutter/material.dart';
const double maxPageWidth = 250.0;
const primaryColor = Color(0xFF0086B9);
const shadows = [
BoxShadow(
color: Colors.black38,
offset: Offset(1.0, 1.0),
blurRadius: 5.0,
spreadRadius: 5.0,
),
];
================================================
FILE: pubspec.yaml
================================================
name: weatherflut
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 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.7.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
http: any
shared_preferences: ^0.5.8
intl: any
provider: any
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.7.5
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon.png"
# 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/
- assets/background_states/
# 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: Schyler
# fonts:
# - asset: fonts/Schyler-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
================================================
FILE: test/widget_test.dart
================================================
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:weatherflut/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}