Skip to content

Changed to mobx #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/todo_app_open_source/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions code/todo_app_open_source/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
87 changes: 87 additions & 0 deletions code/todo_app_open_source/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 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
6 changes: 6 additions & 0 deletions code/todo_app_open_source/lib/controller/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ abstract class ControllerBase with Store {
@observable
dynamic textColor = Colors.black;

@observable
dynamic labelBorderColor = Colors.blue;

@observable
String animation = "minion";

Expand All @@ -42,11 +45,13 @@ abstract class ControllerBase with Store {
secondColorApp = Colors.blue;
textColor = Colors.black;
animation = "minion";
labelBorderColor = Colors.blue;
} else {
primaryColorApp = Colors.black;
secondColorApp = Colors.white;
textColor = Colors.white;
animation = "intro";
labelBorderColor = Colors.white;
}
}

Expand Down Expand Up @@ -101,4 +106,5 @@ abstract class ControllerBase with Store {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setStringList("myTasks", myTasks);
}

}
9 changes: 6 additions & 3 deletions code/todo_app_open_source/lib/pages/my_task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,17 @@ class _MyTaskState extends State<MyTask> {
maxLines: null,
keyboardType: TextInputType.multiline,
decoration: InputDecoration(
hintText: "Escreve ai sem pressa!",
labelText: "Escreve aí sem pressa!!",
labelStyle: TextStyle(
color: controller.labelBorderColor
),
hintStyle: TextStyle(
color: Colors.grey,
fontWeight: FontWeight.bold),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white)),
borderSide: BorderSide(color: controller.labelBorderColor)),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white))),
borderSide: BorderSide(color: controller.labelBorderColor))),
),
),
Container(
Expand Down
24 changes: 12 additions & 12 deletions code/todo_app_open_source/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ packages:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.2"
version: "1.6.0"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
version: "2.4.1"
auto_size_text:
dependency: "direct main"
description:
Expand All @@ -49,7 +49,7 @@ packages:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "2.0.0"
build:
dependency: transitive
description:
Expand Down Expand Up @@ -112,7 +112,7 @@ packages:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
version: "1.1.3"
checked_yaml:
dependency: transitive
description:
Expand All @@ -133,7 +133,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
version: "1.14.12"
convert:
dependency: transitive
description:
Expand All @@ -147,7 +147,7 @@ packages:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.1.4"
csslib:
dependency: transitive
description:
Expand Down Expand Up @@ -274,7 +274,7 @@ packages:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "2.1.12"
io:
dependency: transitive
description:
Expand Down Expand Up @@ -414,7 +414,7 @@ packages:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
version: "2.1.3"
shared_preferences:
dependency: "direct main"
description:
Expand Down Expand Up @@ -475,7 +475,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.5"
version: "1.7.0"
splashscreen:
dependency: "direct main"
description:
Expand Down Expand Up @@ -524,7 +524,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.11"
version: "0.2.15"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -566,7 +566,7 @@ packages:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.0"
version: "3.6.1"
yaml:
dependency: transitive
description:
Expand Down