Commit 321e1f5f authored by Thiago Nitschke's avatar Thiago Nitschke
Browse files

Merge remote-tracking branch 'origin/feature/courseRegistration' into release/sprint2

# Conflicts:
#	android/app/google-services.json
#	ios/Runner.xcodeproj/project.pbxproj
#	lib/pages/photos_list.dart
parents 2a75bcd3 8110f549
Showing with 554 additions and 254 deletions
+554 -254
......@@ -10,78 +10,32 @@ project 'Runner', {
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
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
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
generated_key_values
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
# Flutter 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
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
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
flutter_additional_ios_build_settings(target)
end
end
......@@ -3,17 +3,18 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
04724E112E6FC581959DD18A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADF4D62D0EE4B6866080C71D /* Pods_Runner.framework */; };
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
F10FA46FC55E9065F707A8A1 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68CA57B035E7DC33E288096D /* Pods_Runner.framework */; };
E48476FE251EC4C500A6C9D7 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = E48476FD251EC4C400A6C9D7 /* GoogleService-Info.plist */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -33,12 +34,13 @@
01C19B2820338DEF9FFA1FBE /* 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 = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
19C74291ABFB5253329F6F62 /* 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 = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
68CA57B035E7DC33E288096D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
553CF591784C45CC5F40B328 /* 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 = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
8BA299DFCAAE62B5B5031604 /* 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 = "<group>"; };
7D28DD1BC6A52A8814B4A288 /* 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 = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -46,7 +48,8 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F0604EF1215DDF8AEA3A85F2 /* 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 = "<group>"; };
ADF4D62D0EE4B6866080C71D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E48476FD251EC4C400A6C9D7 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -54,7 +57,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F10FA46FC55E9065F707A8A1 /* Pods_Runner.framework in Frameworks */,
04724E112E6FC581959DD18A /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -86,8 +89,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
B692C102CE0CB0045D8F8A92 /* Pods */,
3BDC59BB9963F71670BB8E3B /* Frameworks */,
C9A16BCB8469C4CE0D37D618 /* Pods */,
A47D0C01ABA8956885F96AA8 /* Frameworks */,
);
sourceTree = "<group>";
};
......@@ -102,6 +105,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
E48476FD251EC4C400A6C9D7 /* GoogleService-Info.plist */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
......@@ -114,12 +118,20 @@
path = Runner;
sourceTree = "<group>";
};
B692C102CE0CB0045D8F8A92 /* Pods */ = {
A47D0C01ABA8956885F96AA8 /* Frameworks */ = {
isa = PBXGroup;
children = (
01C19B2820338DEF9FFA1FBE /* Pods-Runner.debug.xcconfig */,
F0604EF1215DDF8AEA3A85F2 /* Pods-Runner.release.xcconfig */,
8BA299DFCAAE62B5B5031604 /* Pods-Runner.profile.xcconfig */,
ADF4D62D0EE4B6866080C71D /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
C9A16BCB8469C4CE0D37D618 /* Pods */ = {
isa = PBXGroup;
children = (
7D28DD1BC6A52A8814B4A288 /* Pods-Runner.debug.xcconfig */,
553CF591784C45CC5F40B328 /* Pods-Runner.release.xcconfig */,
19C74291ABFB5253329F6F62 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
......@@ -132,14 +144,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
C075D2D9A3211E5DA0CB660D /* [CP] Check Pods Manifest.lock */,
FD85B6BF5653BFDC0C106C90 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
51CC992BE9BE3E9D6F85F44E /* [CP] Embed Pods Frameworks */,
F171827203E2D22F1AB54181 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
......@@ -190,6 +202,7 @@
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
E48476FE251EC4C500A6C9D7 /* GoogleService-Info.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
......@@ -272,7 +285,24 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
C075D2D9A3211E5DA0CB660D /* [CP] Check Pods Manifest.lock */ = {
F171827203E2D22F1AB54181 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FD85B6BF5653BFDC0C106C90 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
......@@ -391,7 +421,11 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
......@@ -504,7 +538,8 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
......@@ -523,7 +558,11 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
......@@ -550,7 +589,11 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
......
<?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">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
......@@ -14,13 +16,14 @@
<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"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="64" y="-23"/>
</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>CLIENT_ID</key>
<string>970216410138-to4sr3e0nhrvgmrc1ei0ibs3lhnkqidn.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.970216410138-to4sr3e0nhrvgmrc1ei0ibs3lhnkqidn</string>
<key>API_KEY</key>
<string>AIzaSyClgOdwPa_SXsabXbQFjUhD-9gd67VORoY</string>
<key>GCM_SENDER_ID</key>
<string>970216410138</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.ages.cupertino</string>
<key>PROJECT_ID</key>
<string>cupertinoapp-f8318</string>
<key>STORAGE_BUCKET</key>
<string>cupertinoapp-f8318.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:970216410138:ios:3ecf080f48ffd3234c15a3</string>
<key>DATABASE_URL</key>
<string>https://cupertinoapp-f8318.firebaseio.com</string>
</dict>
</plist>
\ No newline at end of file
import 'package:flutter/material.dart';
class ColorsSelect extends StatefulWidget {
ColorsSelect(
{@required this.color, @required this.highlighted, @required this.onTap});
final bool highlighted;
final Color color;
final VoidCallback onTap;
@override
_ColorsSelectState createState() => _ColorsSelectState();
}
class _ColorsSelectState extends State<ColorsSelect> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: widget.onTap, //retorna a cor do item atual
child: Container(
decoration: BoxDecoration(
border: Border.all(
width: 2,
color: widget.highlighted ? Colors.white : Colors.transparent),
color: widget.color,
borderRadius: BorderRadius.circular(15)),
width: 30,
height: 30,
),
);
}
}
import 'package:flutter/material.dart';
import 'package:intl/date_symbol_data_local.dart';
import 'package:intl/intl.dart';
class WeekdayBadge extends StatefulWidget {
WeekdayBadge(
{@required this.weekday,
@required this.highlighted,
@required this.onTap});
final bool highlighted;
final String weekday;
final VoidCallback onTap;
@override
_WeekdayBadgeState createState() => _WeekdayBadgeState();
}
class _WeekdayBadgeState extends State<WeekdayBadge> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: widget.onTap, //retorna a cor do item atual
child: Container(
height: 44,
margin: EdgeInsets.symmetric(horizontal: 2.0),
decoration: BoxDecoration(
color: widget.highlighted ? Color(0xFFA766E4) : Color(0xFF2E2E2E),
borderRadius: BorderRadius.circular(16),
),
child: Center(
child: Text(
widget.weekday,
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xDDFFFFFF),
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
),
),
);
}
}
class WeekdaySelector extends StatefulWidget {
@override
_WeekdaySelectorState createState() => _WeekdaySelectorState();
}
class _WeekdaySelectorState extends State<WeekdaySelector> {
Set<String> selectedWeekdays = {};
final List<String> weekdays = weekdaysGenerator('pt_BR');
static List<String> weekdaysGenerator(String localeName) {
initializeDateFormatting(localeName, null);
DateFormat formatter = DateFormat(DateFormat.WEEKDAY, localeName);
return formatter.dateSymbols.SHORTWEEKDAYS
.map((day) => "${day[0].toUpperCase()}${day.substring(1)}")
.toList();
}
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.only(top: 8.0),
child: Container(
height: 60,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: weekdays
.map((weekday) => Expanded(
child: WeekdayBadge(
weekday: weekday,
onTap: () {
setState(() {
if (selectedWeekdays.contains(weekday)) {
this.selectedWeekdays.remove(weekday);
} else {
this.selectedWeekdays.add(weekday);
}
});
},
highlighted: selectedWeekdays.contains(weekday),
),
))
.toList(),
),
),
);
}
}
......@@ -2,151 +2,173 @@ import 'package:cupertino/components/course_tile.dart';
import 'package:cupertino/pages/course_registration.dart';
import 'package:flutter/material.dart';
import 'package:sticky_and_expandable_list/sticky_and_expandable_list.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart';
class CoursesList extends StatelessWidget {
List<SemesterSection> semesters = [
SemesterSection(header: '1.º', expanded: true, items: [
{
'id': 0,
'name': 'Redes de Computadores',
'code': '24003-04',
'class': '127',
'schedule': [
{
'weekdays': ['Seg', 'Qua'],
'initialTime': TimeOfDay(hour: 17, minute: 30),
'endTime': TimeOfDay(hour: 19, minute: 00)
}
],
'photos': [],
'color': Colors.red
},
{
'id': 1,
'name': 'Organização e Arquitetura de Computadores',
'code': '44342-04',
'class': '128',
'schedule': [
{
'weekdays': ['Ter', 'Qui'],
'initialTime': TimeOfDay(hour: 19, minute: 15),
'endTime': TimeOfDay(hour: 20, minute: 45)
}
],
'photos': [],
'color': Colors.green
},
{
'id': 2,
'name': 'Gerenciamento e Modelagem de Processos de Negócio - N',
'code': 'INF2345-04',
'class': 'U',
'schedule': [
{
'weekdays': ['Sex'],
'initialTime': TimeOfDay(hour: 8, minute: 30),
'endTime': TimeOfDay(hour: 12, minute: 10)
}
],
'photos': [],
'color': Colors.blue
},
]),
SemesterSection(header: '2.º', expanded: true, items: [
{
'id': 0,
'name': 'Redes de Computadores',
'code': '24003-04',
'class': '127',
'schedule': [
{
'weekdays': ['Seg', 'Qua'],
'initialTime': TimeOfDay(hour: 17, minute: 30),
'endTime': TimeOfDay(hour: 19, minute: 00)
}
],
'photos': [],
'color': Colors.red
},
{
'id': 1,
'name': 'Organização e Arquitetura de Computadores',
'code': '44342-04',
'class': '128',
'schedule': [
{
'weekdays': ['Ter', 'Qui'],
'initialTime': TimeOfDay(hour: 19, minute: 15),
'endTime': TimeOfDay(hour: 20, minute: 45)
}
],
'photos': [],
'color': Colors.green
},
{
'id': 2,
'name': 'Gerenciamento e Modelagem de Processos de Negócio - N',
'code': 'INF2345-04',
'class': 'U',
'schedule': [
{
'weekdays': ['Sex'],
'initialTime': TimeOfDay(hour: 8, minute: 30),
'endTime': TimeOfDay(hour: 12, minute: 10)
}
],
'photos': [],
'color': Colors.blue
},
]),
SemesterSection(header: 'Intercâmbio', expanded: true, items: [
{
'id': 0,
'name': 'Redes de Computadores',
'code': '24003-04',
'class': '127',
'schedule': [
{
'weekdays': ['Seg', 'Qua'],
'initialTime': TimeOfDay(hour: 17, minute: 30),
'endTime': TimeOfDay(hour: 19, minute: 00)
}
],
'photos': [],
'color': Colors.red
},
{
'id': 1,
'name': 'Organização e Arquitetura de Computadores',
'code': '44342-04',
'class': '128',
'schedule': [
{
'weekdays': ['Ter', 'Qui'],
'initialTime': TimeOfDay(hour: 19, minute: 15),
'endTime': TimeOfDay(hour: 20, minute: 45)
}
],
'photos': [],
'color': Colors.green
},
{
'id': 2,
'name': 'Gerenciamento e Modelagem de Processos de Negócio - N',
'code': 'INF2345-04',
'class': 'U',
'schedule': [
{
'weekdays': ['Sex'],
'initialTime': TimeOfDay(hour: 8, minute: 30),
'endTime': TimeOfDay(hour: 12, minute: 10)
}
],
'photos': [],
'color': Colors.blue
},
]),
];
class CoursesList extends StatefulWidget {
@override
_CoursesListState createState() => _CoursesListState();
}
class _CoursesListState extends State<CoursesList> {
final Firestore firestoreInstance = Firestore.instance;
final FirebaseAuth firebaseAuth = FirebaseAuth.instance;
FirebaseUser firebaseUser;
FirebaseStorage storage = FirebaseStorage.instance;
List<SemesterSection> semesters;
CollectionReference fireBaseSemesters;
@override
void initState(){
super.initState();
semesters = [
SemesterSection(header: '1.º', expanded: true, items: [
{
'id': 0,
'name': 'Redes de Computadores',
'code': '24003-04',
'class': '127',
'schedule': [
{
'weekdays': ['Seg', 'Qua'],
'initialTime': TimeOfDay(hour: 17, minute: 30),
'endTime': TimeOfDay(hour: 19, minute: 00)
}
],
'photos': [],
'color': Colors.red
},
{
'id': 1,
'name': 'Organização e Arquitetura de Computadores',
'code': '44342-04',
'class': '128',
'schedule': [
{
'weekdays': ['Ter', 'Qui'],
'initialTime': TimeOfDay(hour: 19, minute: 15),
'endTime': TimeOfDay(hour: 20, minute: 45)
}
],
'photos': [],
'color': Colors.green
},
{
'id': 2,
'name': 'Gerenciamento e Modelagem de Processos de Negócio - N',
'code': 'INF2345-04',
'class': 'U',
'schedule': [
{
'weekdays': ['Sex'],
'initialTime': TimeOfDay(hour: 8, minute: 30),
'endTime': TimeOfDay(hour: 12, minute: 10)
}
],
'photos': [],
'color': Colors.blue
},
]),
SemesterSection(header: '2.º', expanded: true, items: [
{
'id': 0,
'name': 'Redes de Computadores',
'code': '24003-04',
'class': '127',
'schedule': [
{
'weekdays': ['Seg', 'Qua'],
'initialTime': TimeOfDay(hour: 17, minute: 30),
'endTime': TimeOfDay(hour: 19, minute: 00)
}
],
'photos': [],
'color': Colors.red
},
{
'id': 1,
'name': 'Organização e Arquitetura de Computadores',
'code': '44342-04',
'class': '128',
'schedule': [
{
'weekdays': ['Ter', 'Qui'],
'initialTime': TimeOfDay(hour: 19, minute: 15),
'endTime': TimeOfDay(hour: 20, minute: 45)
}
],
'photos': [],
'color': Colors.green
},
{
'id': 2,
'name': 'Gerenciamento e Modelagem de Processos de Negócio - N',
'code': 'INF2345-04',
'class': 'U',
'schedule': [
{
'weekdays': ['Sex'],
'initialTime': TimeOfDay(hour: 8, minute: 30),
'endTime': TimeOfDay(hour: 12, minute: 10)
}
],
'photos': [],
'color': Colors.blue
},
]),
SemesterSection(header: 'Intercâmbio', expanded: true, items: [
{
'id': 0,
'name': 'Redes de Computadores',
'code': '24003-04',
'class': '127',
'schedule': [
{
'weekdays': ['Seg', 'Qua'],
'initialTime': TimeOfDay(hour: 17, minute: 30),
'endTime': TimeOfDay(hour: 19, minute: 00)
}
],
'photos': [],
'color': Colors.red
},
{
'id': 1,
'name': 'Organização e Arquitetura de Computadores',
'code': '44342-04',
'class': '128',
'schedule': [
{
'weekdays': ['Ter', 'Qui'],
'initialTime': TimeOfDay(hour: 19, minute: 15),
'endTime': TimeOfDay(hour: 20, minute: 45)
}
],
'photos': [],
'color': Colors.green
},
{
'id': 2,
'name': 'Gerenciamento e Modelagem de Processos de Negócio - N',
'code': 'INF2345-04',
'class': 'U',
'schedule': [
{
'weekdays': ['Sex'],
'initialTime': TimeOfDay(hour: 8, minute: 30),
'endTime': TimeOfDay(hour: 12, minute: 10)
}
],
'photos': [],
'color': Colors.blue
},
]),
];
getFirebaseData();
}
@override
Widget build(BuildContext context) {
......@@ -159,7 +181,7 @@ class CoursesList extends StatelessWidget {
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CourseRegistration())),
builder: (context) => CourseRegistration(this.fireBaseSemesters))),
),
IconButton(
icon: Icon(Icons.search),
......@@ -199,6 +221,23 @@ class CoursesList extends StatelessWidget {
}),
));
}
//Metodo que pega todos os dados do usuario do firebase, futuramente será colocado no inicio
void getFirebaseData() async {
await firebaseAuth
.signInWithEmailAndPassword(
email: "fredericohi18@gmail.com", password: "123456")
.then((fbUser) async {
firebaseUser = fbUser.user;
}).catchError((error) {
print(error.message);
print(error.code);
});
fireBaseSemesters = firestoreInstance
.collection("users")
.document(firebaseUser.uid)
.collection("semesters");
}
}
///Section semester model
......
import 'dart:ui';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:cupertino/components/weekday_selector.dart';
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import '../components/colors_select.dart';
class CourseRegistration extends StatefulWidget {
CollectionReference fireBaseSemesters;
CourseRegistration(this.fireBaseSemesters);
@override
_CourseRegistrationState createState() => _CourseRegistrationState();
_CourseRegistrationState createState() => _CourseRegistrationState(this.fireBaseSemesters);
}
class _CourseRegistrationState extends State<CourseRegistration> {
_CourseRegistrationState(this.fireBaseSemesters);
final colors = [
Color(0xFF9B51E0),
Color(0xFFEB5757),
......@@ -21,8 +33,62 @@ class _CourseRegistrationState extends State<CourseRegistration> {
Color(0xFF56CCF2)
];
String semester = "1º";
List semesters = ["1º", "2º", "3º", "intercambio"];
String name;
String codigo;
String begin;
String end;
List<String> days;
Color selectedColor;
DocumentSnapshot semester;
List<DocumentSnapshot> semesters = [];
CollectionReference fireBaseSemesters;
@override
void initState() {
super.initState();
name = null;
codigo = null;
begin = null;
end = null;
days = [];
selectedColor = null;
this.fireBaseSemesters
.getDocuments()
.then((value) => {
value.documents.forEach((element) {
setState(() {
this.semesters.insert(0, element);
});
})
});
}
void checkAdd(){
//todo: check if all necessary data is completed
this.add();
}
void add(){
this.fireBaseSemesters
.document(this.semester.documentID)
.collection("disciplines")
.add({
'name': 'oi'
}).then((value) {
this.fireBaseSemesters
.document(this.semester.documentID)
.collection("disciplines")
.document(value.documentID)
.collection("hours")
.add({
'begin': this.begin,
'days': this.days,
'end': this.end
});
});
Navigator.pop(context);
}
@override
Widget build(BuildContext context) {
......@@ -33,18 +99,24 @@ class _CourseRegistrationState extends State<CourseRegistration> {
icon: Icon(
Icons.check,
),
onPressed: () => Navigator.pop(context),
onPressed: () => this.checkAdd(),
)
],
title: Text('Cadastro Disciplina'),
),
body: SafeArea(
child: ListView(padding: kMaterialListPadding, children: [
TextInputWidget(title: 'Nome'),
TextInputWidget(title: 'Nome', value: name, func:(value) => {
this.setState(() {
this.name = value;
})
}),
BasicTimeField(),
TextInputWidget(
title: 'Código',
),
TextInputWidget(title: 'Código', value: codigo, func:(value) => {
this.setState(() {
this.codigo = value;
})
}),
Padding(
padding: EdgeInsets.all(16.0),
child:
......@@ -82,8 +154,8 @@ class _CourseRegistrationState extends State<CourseRegistration> {
),
items: semesters
.map((e) => DropdownMenuItem(
child: Text(e.toString()),
value: e.toString(),
child: Text(e.data.values.elementAt(0).toString()),
value: e,
))
.toList(),
onChanged: (value) {
......@@ -116,22 +188,20 @@ class _CourseRegistrationState extends State<CourseRegistration> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: colors
.map((color) => GestureDetector(
onTap: () {}, //retorna a cor do item atual
child: Container(
decoration: BoxDecoration(
color: color,
borderRadius:
BorderRadius.circular(15)),
width: 30,
height: 30,
),
.map((color) => ColorsSelect(
onTap: () {
setState(() {
this.selectedColor = color;
});
},
color: color,
highlighted:
selectedColor == color ? true : false,
))
.toList(),
),
)
]))
//TODO: falta criar um widget para horario e data
]),
),
);
......@@ -139,10 +209,11 @@ class _CourseRegistrationState extends State<CourseRegistration> {
}
class TextInputWidget extends StatefulWidget {
TextInputWidget({@required this.title, this.value});
TextInputWidget({@required this.title, @required this.value, @required this.func});
final String title;
String title;
String value;
void func;
@override
_TextInputWidgetState createState() => _TextInputWidgetState();
......@@ -231,7 +302,35 @@ class BasicTimeField extends StatelessWidget {
fillColor: Color(0xFF2F2F2F),
filled: true,
alignLabelWithHint: true,
hintText: 'Horário',
hintText: 'Horário Inicial',
hintStyle: TextStyle(
fontSize: 16, height: 1, color: Colors.white.withAlpha(0x99)),
border: UnderlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(4.0))),
),
format: format,
onShowPicker: (context, currentValue) async {
final time = await showTimePicker(
context: context,
initialTime:
TimeOfDay.fromDateTime(currentValue ?? DateTime.now()),
);
return DateTimeField.convert(time);
},
),
SizedBox(
height: 10.0,
),
DateTimeField(
cursorColor: Colors.deepPurpleAccent,
decoration: InputDecoration(
contentPadding:
EdgeInsets.only(top: 22, bottom: 22, left: 16, right: 16),
fillColor: Color(0xFF2F2F2F),
filled: true,
alignLabelWithHint: true,
hintText: 'Horário Final',
hintStyle: TextStyle(
fontSize: 16, height: 1, color: Colors.white.withAlpha(0x99)),
border: UnderlineInputBorder(
......@@ -248,6 +347,7 @@ class BasicTimeField extends StatelessWidget {
return DateTimeField.convert(time);
},
),
WeekdaySelector(),
]));
}
}
......@@ -15,6 +15,7 @@ dependencies:
sdk: flutter
cupertino_icons: ^0.1.3
intl: ^0.16.1
firebase_auth: ^0.16.1
cloud_firestore: ^0.13.7
firebase_storage: ^3.1.6
......
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