-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Li
committed
Jul 29, 2019
1 parent
3352c87
commit 8bd7791
Showing
18 changed files
with
1,143 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# 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 | ||
pods_ary = [] | ||
skip_line_start_symbols = ["#", "/"] | ||
File.foreach(file_abs_path) { |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) | ||
pods_ary.push({:name => podname, :path => podpath}); | ||
else | ||
puts "Invalid plugin specification: #{line}" | ||
end | ||
} | ||
return pods_ary | ||
end | ||
|
||
target 'Runner' do | ||
# 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') | ||
|
||
# Flutter Pods | ||
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') | ||
if generated_xcode_build_settings.empty? | ||
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first." | ||
end | ||
generated_xcode_build_settings.map { |p| | ||
if p[:name] == 'FLUTTER_FRAMEWORK_DIR' | ||
symlink = File.join('.symlinks', 'flutter') | ||
File.symlink(File.dirname(p[:path]), symlink) | ||
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) | ||
end | ||
} | ||
|
||
# Plugin Pods | ||
plugin_pods = parse_KV_file('../.flutter-plugins') | ||
plugin_pods.map { |p| | ||
symlink = File.join('.symlinks', 'plugins', p[:name]) | ||
File.symlink(p[:path], symlink) | ||
pod p[:name], :path => File.join(symlink, 'ios') | ||
} | ||
end | ||
|
||
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. | ||
install! 'cocoapods', :disable_input_output_paths => true | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
PODS: | ||
- Flutter (1.0.0) | ||
- FMDB (2.7.5): | ||
- FMDB/standard (= 2.7.5) | ||
- FMDB/standard (2.7.5) | ||
- path_provider (0.0.1): | ||
- Flutter | ||
- sqflite (0.0.1): | ||
- Flutter | ||
- FMDB (~> 2.7.2) | ||
|
||
DEPENDENCIES: | ||
- Flutter (from `.symlinks/flutter/ios`) | ||
- path_provider (from `.symlinks/plugins/path_provider/ios`) | ||
- sqflite (from `.symlinks/plugins/sqflite/ios`) | ||
|
||
SPEC REPOS: | ||
https://github.com/cocoapods/specs.git: | ||
- FMDB | ||
|
||
EXTERNAL SOURCES: | ||
Flutter: | ||
:path: ".symlinks/flutter/ios" | ||
path_provider: | ||
:path: ".symlinks/plugins/path_provider/ios" | ||
sqflite: | ||
:path: ".symlinks/plugins/sqflite/ios" | ||
|
||
SPEC CHECKSUMS: | ||
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a | ||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a | ||
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 | ||
sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a | ||
|
||
PODFILE CHECKSUM: 7fb83752f59ead6285236625b82473f90b1cb932 | ||
|
||
COCOAPODS: 1.6.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'dart:math'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class CustomSliverPersistentHeader extends SliverPersistentHeaderDelegate { | ||
CustomSliverPersistentHeader({ | ||
@required this.minHeight, | ||
@required this.maxHeight, | ||
@required this.child, | ||
}); | ||
|
||
final double minHeight; | ||
final double maxHeight; | ||
final Widget child; | ||
|
||
@override | ||
double get minExtent => minHeight; | ||
|
||
@override | ||
double get maxExtent => max(maxHeight, minHeight); | ||
|
||
@override | ||
Widget build( | ||
BuildContext context, double shrinkOffset, bool overlapsContent) { | ||
return child; | ||
} | ||
|
||
@override | ||
bool shouldRebuild(CustomSliverPersistentHeader oldDelegate) { | ||
return maxHeight != oldDelegate.maxHeight || | ||
minHeight != oldDelegate.minHeight || | ||
child != oldDelegate.child; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:cached_network_image/cached_network_image.dart'; | ||
|
||
class HomeCategoryNav extends StatefulWidget { | ||
final categorys; | ||
|
||
HomeCategoryNav(this.categorys); | ||
|
||
_HomeCategoryNavState createState() => _HomeCategoryNavState(); | ||
} | ||
|
||
class _HomeCategoryNavState extends State<HomeCategoryNav> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
padding: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 10.0), | ||
decoration: BoxDecoration(color: Colors.white), | ||
child: Wrap( | ||
children: _items(), | ||
), | ||
); | ||
} | ||
|
||
List<Widget> _items() { | ||
return widget.categorys.map<Widget>((f) { | ||
return Container( | ||
width: (MediaQuery.of(context).size.width - 20.0) * 0.2, | ||
margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: <Widget>[ | ||
CachedNetworkImage( | ||
width: 40.0, | ||
height: 40.0, | ||
imageUrl: f['image'], | ||
fit: BoxFit.cover, | ||
), | ||
SizedBox( | ||
height: 2.0, | ||
), | ||
Text(f['name'], style: TextStyle(fontSize: 12.0)), | ||
], | ||
), | ||
); | ||
}).toList(); | ||
} | ||
} |
Oops, something went wrong.