├── .gitignore
├── .tours
└── cloudbase.tour
├── README.md
├── client
├── .editorconfig
├── .eslintrc
├── .gitignore
├── config
│ ├── dev.js
│ ├── index.js
│ └── prod.js
├── package-lock.json
├── package.json
└── src
│ ├── app.jsx
│ ├── app.scss
│ ├── assets
│ └── logo.png
│ ├── components
│ ├── header
│ │ ├── index.jsx
│ │ └── index.scss
│ └── login
│ │ └── index.weapp.jsx
│ ├── index.html
│ ├── lib
│ └── cloud
│ │ ├── index.h5.js
│ │ └── index.weapp.js
│ └── pages
│ └── index
│ ├── index.jsx
│ └── index.scss
├── cloud
└── functions
│ ├── hackernews-api
│ ├── config.json
│ ├── index.js
│ └── package.json
│ └── openapi
│ ├── config.json
│ ├── index.js
│ └── package.json
├── cloudbaserc.js
├── flutter_hackernews
├── .gitignore
├── .metadata
├── README.md
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── flutter_hackernews
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── 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
│ └── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ │ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
├── lib
│ └── main.dart
├── pubspec.yaml
└── test
│ └── widget_test.dart
├── package-lock.json
├── package.json
└── project.config.json
/.gitignore:
--------------------------------------------------------------------------------
1 | **/node_modules
2 | node_modules
3 | client/build
4 | **/.DS_Store
5 | private.json
--------------------------------------------------------------------------------
/.tours/cloudbase.tour:
--------------------------------------------------------------------------------
1 | {
2 | "title": "CLoudBase",
3 | "steps": [
4 | {
5 | "file": "project.config.json",
6 | "line": 6,
7 | "description": "修改 appid 为自己的小程序appid",
8 | "selection": {
9 | "start": {
10 | "line": 6,
11 | "character": 3
12 | },
13 | "end": {
14 | "line": 6,
15 | "character": 8
16 | }
17 | }
18 | },
19 | {
20 | "file": "package.json",
21 | "line": 8,
22 | "description": "运行开发命令\ncd client && npm run dev:weapp"
23 | },
24 | {
25 | "file": "client/src/pages/index/index.jsx",
26 | "line": 74,
27 | "description": "实现前端界面"
28 | },
29 | {
30 | "file": "client/src/pages/index/index.scss",
31 | "line": 1,
32 | "description": "添加CSS样式"
33 | },
34 | {
35 | "file": "package.json",
36 | "line": 10,
37 | "description": "构建查看效果\n\nnpm run build:weapp",
38 | "selection": {
39 | "start": {
40 | "line": 10,
41 | "character": 6
42 | },
43 | "end": {
44 | "line": 10,
45 | "character": 17
46 | }
47 | }
48 | },
49 | {
50 | "file": "cloud/functions/hackernews-api/index.js",
51 | "line": 9,
52 | "description": "接下来进入开发云函数阶段\n\n首先在云开发控制台开通一个数据库集合 hackernews\n"
53 | },
54 | {
55 | "file": "cloud/functions/hackernews-api/index.js",
56 | "line": 22,
57 | "description": "使用 云开发 sdk 进行数据的查询"
58 | },
59 | {
60 | "file": "cloud/functions/hackernews-api/index.js",
61 | "line": 40,
62 | "description": "根据查询返回数据和总数"
63 | },
64 | {
65 | "file": "client/src/pages/index/index.jsx",
66 | "line": 30,
67 | "description": "使用微信客户端 sdk 调用云函数来请求数据并渲染"
68 | },
69 | {
70 | "file": "client/src/lib/cloud/index.weapp.js",
71 | "line": 9,
72 | "description": "在微信环境下调用云函数使用的是wx.cloud内置的callFunction 方法"
73 | },
74 | {
75 | "file": "cloudbaserc.js",
76 | "line": 2,
77 | "description": "接下来进入部署函数\n一共有三种方式可以部署函数\n微信控制台(不需要配置文件)\nCLI\nVSCODE 插件"
78 | },
79 | {
80 | "file": "package.json",
81 | "line": 12,
82 | "description": "接下来在小程序开发者工具里面运行\n了解下云函数 日志 云数据库 等功能"
83 | },
84 | {
85 | "file": "cloud/functions/openapi/index.js",
86 | "line": 30,
87 | "description": "接下来演示如何实现几行代码调用微信开放能力\n\n新建一个云函数 openapi 通过 cloud.openapi.wxacode.get 实现获取小程序码",
88 | "selection": {
89 | "start": {
90 | "line": 32,
91 | "character": 32
92 | },
93 | "end": {
94 | "line": 32,
95 | "character": 56
96 | }
97 | }
98 | },
99 | {
100 | "file": "cloud/functions/openapi/index.js",
101 | "line": 41,
102 | "description": "将获取的buffer 调用云开发文件上传能力上传到云存储"
103 | },
104 | {
105 | "file": "cloud/functions/openapi/index.js",
106 | "line": 47,
107 | "description": "调用云开发 sdk 的获取临时文件地址拿到url 返回给客户端"
108 | },
109 | {
110 | "file": "cloud/functions/openapi/config.json",
111 | "line": 4,
112 | "description": "调用微信云调用只需要声明权限即可"
113 | },
114 | {
115 | "file": "package.json",
116 | "line": 12,
117 | "description": "部署 openapi 函数,查看效果\n学习使用微信开发者工具的云存储"
118 | },
119 | {
120 | "file": "package.json",
121 | "line": 11,
122 | "description": "了解云调用 和云开发的扩展能力"
123 | },
124 | {
125 | "file": "client/src/lib/cloud/index.h5.js",
126 | "line": 3,
127 | "description": "接下来演示如何在 web 页面访问云开发\n\n只需要使用 tcb-js-sdk\n登录方式的选择\n同样提供 callfunction 等方法"
128 | },
129 | {
130 | "file": "package.json",
131 | "line": 7,
132 | "description": "打开 h5 开发模式,演示网页使用云开发\n\n进入控制台演示云开发控制台功能,安全域名,登录方式等"
133 | },
134 | {
135 | "file": "package.json",
136 | "line": 9,
137 | "description": "构建 H5 准备部署到静态托管"
138 | },
139 | {
140 | "file": "package.json",
141 | "line": 15,
142 | "description": "将网站部署到静态托管,在线体验"
143 | },
144 | {
145 | "file": "flutter_hackernews/pubspec.yaml",
146 | "line": 26,
147 | "description": "演示 FLutter 能力\nflutter create cloudbase_hackernews\n\n配置cloudbase 依赖"
148 | },
149 | {
150 | "file": "flutter_hackernews/lib/main.dart",
151 | "line": 8,
152 | "description": "引入 CLoudbase Sdk\n\n调用匿名登录\n"
153 | },
154 | {
155 | "file": "flutter_hackernews/lib/main.dart",
156 | "line": 33,
157 | "description": "调用callFunction 获取数据\n了解移动应用的 数据库、登录、安全来源、文件存储\n"
158 | },
159 | {
160 | "file": "package.json",
161 | "line": 13,
162 | "description": "开放工作完成\n在控制台演示扩展安装 CMS"
163 | },
164 | {
165 | "file": "private.json",
166 | "line": 2,
167 | "description": "CMS 安装需要填写的参数\n在安装过成功中了解 CMS 扩展的构成\n访问 CMS 扩展,演示建模能力,增删改查,在h5 页面和小程序等体验"
168 | },
169 | {
170 | "file": "private.json",
171 | "line": 4,
172 | "description": "演示 CMS 核心函数\nauth koa 应用\n扩展的含义,云上微应用编排能力\n开发者也可以自己开发扩展"
173 | }
174 | ],
175 | "ref": "fecf85cc4ec9f7a10bdf01eb55d8be855a053c93"
176 | }
177 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 云开发 多端 HackerNews 示例
2 |
3 | 
4 |
5 | 更多项目案例请参考
6 |
7 | [项目示例](https://github.com/TencentCloudBase/cloudbase-framework#%E9%A1%B9%E7%9B%AE%E7%A4%BA%E4%BE%8B)
8 |
--------------------------------------------------------------------------------
/client/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
--------------------------------------------------------------------------------
/client/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "taro"
4 | ],
5 | "globals": {
6 | "wx": "readonly"
7 | },
8 | "rules": {
9 | "no-unused-vars": [
10 | "error",
11 | {
12 | "varsIgnorePattern": "Taro"
13 | }
14 | ],
15 | "react/jsx-filename-extension": [
16 | 1,
17 | {
18 | "extensions": [
19 | ".js",
20 | ".jsx",
21 | ".tsx"
22 | ]
23 | }
24 | ],
25 | "jsx-quotes": [
26 | "error",
27 | "prefer-double"
28 | ]
29 | },
30 | "parser": "babel-eslint"
31 | }
32 |
--------------------------------------------------------------------------------
/client/.gitignore:
--------------------------------------------------------------------------------
1 | dist/
2 | deploy_versions/
3 | .temp/
4 | .rn_temp/
5 | node_modules/
6 | .DS_Store
7 |
--------------------------------------------------------------------------------
/client/config/dev.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: '"development"'
4 | },
5 | defineConstants: {
6 | },
7 | mini: {},
8 | h5: {}
9 | }
10 |
--------------------------------------------------------------------------------
/client/config/index.js:
--------------------------------------------------------------------------------
1 | const cloudBaseConfig = require("../../cloudbaserc");
2 |
3 | const config = {
4 | projectName: "tcb-hacker-news",
5 | env: {
6 | ENV_ID: JSON.stringify(cloudBaseConfig.envId)
7 | },
8 | date: "2020-4-23",
9 | designWidth: 750,
10 | deviceRatio: {
11 | "640": 2.34 / 2,
12 | "750": 1,
13 | "828": 1.81 / 2
14 | },
15 | sourceRoot: "src",
16 | outputRoot: process.env.OUTPUT_ROOT || "dist",
17 | babel: {
18 | sourceMap: true,
19 | presets: [
20 | [
21 | "env",
22 | {
23 | modules: false
24 | }
25 | ]
26 | ],
27 | plugins: [
28 | "transform-decorators-legacy",
29 | "transform-class-properties",
30 | "transform-object-rest-spread",
31 | [
32 | "transform-runtime",
33 | {
34 | helpers: false,
35 | polyfill: false,
36 | regenerator: true,
37 | moduleName: "babel-runtime"
38 | }
39 | ]
40 | ]
41 | },
42 | defineConstants: {},
43 | mini: {
44 | postcss: {
45 | autoprefixer: {
46 | enable: true,
47 | config: {
48 | browsers: ["last 3 versions", "Android >= 4.1", "ios >= 8"]
49 | }
50 | },
51 | pxtransform: {
52 | enable: true,
53 | config: {}
54 | },
55 | url: {
56 | enable: true,
57 | config: {
58 | limit: 10240 // 设定转换尺寸上限
59 | }
60 | },
61 | cssModules: {
62 | enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
63 | config: {
64 | namingPattern: "module", // 转换模式,取值为 global/module
65 | generateScopedName: "[name]__[local]___[hash:base64:5]"
66 | }
67 | }
68 | }
69 | },
70 | h5: {
71 | publicPath: "/",
72 | staticDirectory: "static",
73 | postcss: {
74 | autoprefixer: {
75 | enable: true,
76 | config: {
77 | browsers: ["last 3 versions", "Android >= 4.1", "ios >= 8"]
78 | }
79 | },
80 | cssModules: {
81 | enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
82 | config: {
83 | namingPattern: "module", // 转换模式,取值为 global/module
84 | generateScopedName: "[name]__[local]___[hash:base64:5]"
85 | }
86 | }
87 | }
88 | }
89 | };
90 |
91 | module.exports = function(merge) {
92 | if (process.env.NODE_ENV === "development") {
93 | return merge({}, config, require("./dev"));
94 | }
95 | return merge({}, config, require("./prod"));
96 | };
97 |
--------------------------------------------------------------------------------
/client/config/prod.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | NODE_ENV: '"production"'
4 | },
5 | defineConstants: {
6 | },
7 | mini: {},
8 | h5: {
9 | /**
10 | * 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。
11 | * 参考代码如下:
12 | * webpackChain (chain) {
13 | * chain.plugin('analyzer')
14 | * .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
15 | * }
16 | */
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/client/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tcb-hacker-news",
3 | "version": "1.0.0",
4 | "private": true,
5 | "description": "云开发 Hacker News 项目( 小程序+Web)",
6 | "templateInfo": {
7 | "name": "wxcloud",
8 | "typescript": false,
9 | "css": "sass"
10 | },
11 | "scripts": {
12 | "build:weapp": "taro build --type weapp",
13 | "build:swan": "taro build --type swan",
14 | "build:alipay": "taro build --type alipay",
15 | "build:tt": "taro build --type tt",
16 | "build:h5": "taro build --type h5",
17 | "build:rn": "taro build --type rn",
18 | "build:qq": "taro build --type qq",
19 | "build:quickapp": "taro build --type quickapp",
20 | "dev:weapp": "npm run build:weapp -- --watch",
21 | "dev:swan": "npm run build:swan -- --watch",
22 | "dev:alipay": "npm run build:alipay -- --watch",
23 | "dev:tt": "npm run build:tt -- --watch",
24 | "dev:h5": "npm run build:h5 -- --watch",
25 | "dev:rn": "npm run build:rn -- --watch",
26 | "dev:qq": "npm run build:qq -- --watch",
27 | "dev:quickapp": "npm run build:quickapp -- --watch"
28 | },
29 | "author": "",
30 | "license": "MIT",
31 | "dependencies": {
32 | "@tarojs/components": "2.1.5",
33 | "@tarojs/components-qa": "2.1.5",
34 | "@tarojs/router": "2.1.5",
35 | "@tarojs/taro": "2.1.5",
36 | "@tarojs/taro-alipay": "2.1.5",
37 | "@tarojs/taro-h5": "2.1.5",
38 | "@tarojs/taro-qq": "2.1.5",
39 | "@tarojs/taro-quickapp": "2.1.5",
40 | "@tarojs/taro-swan": "2.1.5",
41 | "@tarojs/taro-tt": "2.1.5",
42 | "@tarojs/taro-weapp": "2.1.5",
43 | "babel-runtime": "^6.26.0",
44 | "moment": "^2.24.0",
45 | "nerv-devtools": "^1.5.5",
46 | "nervjs": "^1.5.5",
47 | "regenerator-runtime": "0.11.1",
48 | "tcb-js-sdk": "^1.5.1"
49 | },
50 | "devDependencies": {
51 | "@tarojs/mini-runner": "2.1.5",
52 | "@tarojs/webpack-runner": "2.1.5",
53 | "@types/react": "^16.4.6",
54 | "@types/webpack-env": "^1.13.6",
55 | "babel-eslint": "^8.2.3",
56 | "babel-plugin-transform-class-properties": "^6.24.1",
57 | "babel-plugin-transform-decorators-legacy": "^1.3.5",
58 | "babel-plugin-transform-jsx-stylesheet": "^0.6.5",
59 | "babel-plugin-transform-object-rest-spread": "^6.26.0",
60 | "babel-plugin-transform-runtime": "^6.23.0",
61 | "babel-preset-env": "^1.6.1",
62 | "eslint": "^4.19.1",
63 | "eslint-config-taro": "2.1.5",
64 | "eslint-plugin-import": "^2.12.0",
65 | "eslint-plugin-react": "^7.8.2",
66 | "eslint-plugin-react-hooks": "^1.6.1",
67 | "eslint-plugin-taro": "2.1.5"
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/client/src/app.jsx:
--------------------------------------------------------------------------------
1 | import Taro, { Component } from '@tarojs/taro'
2 | import Index from './pages/index'
3 |
4 | import './app.scss'
5 |
6 | // 如果需要在 h5 环境中开启 React Devtools
7 | // 取消以下注释:
8 | // if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5') {
9 | // require('nerv-devtools')
10 | // }
11 |
12 | class App extends Component {
13 |
14 | config = {
15 | pages: [
16 | 'pages/index/index'
17 | ],
18 | window: {
19 | backgroundTextStyle: 'light',
20 | navigationBarBackgroundColor: '#fff',
21 | navigationBarTitleText: 'WeChat',
22 | navigationBarTextStyle: 'black'
23 | },
24 | cloud: true
25 | }
26 |
27 | componentDidMount () {
28 | if (process.env.TARO_ENV === 'weapp') {
29 | Taro.cloud.init()
30 | }
31 | }
32 |
33 | componentDidShow () {}
34 |
35 | componentDidHide () {}
36 |
37 | componentDidCatchError () {}
38 |
39 | // 在 App 类中的 render() 函数没有实际作用
40 | // 请勿修改此函数
41 | render () {
42 | return (
43 |
44 | )
45 | }
46 | }
47 |
48 | Taro.render(, document.getElementById('app'))
49 |
--------------------------------------------------------------------------------
/client/src/app.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/client/src/app.scss
--------------------------------------------------------------------------------
/client/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/client/src/assets/logo.png
--------------------------------------------------------------------------------
/client/src/components/header/index.jsx:
--------------------------------------------------------------------------------
1 | import Taro from "@tarojs/taro"
2 | import { View, Image } from '@tarojs/components'
3 | import logo from '../../assets/logo.png'
4 |
5 | import './index.scss'
6 |
7 | function Header(props) {
8 | const {
9 | types,
10 | onSelect = () => { }
11 | } = props
12 | return (
13 |
14 | {
15 | types.map(type => onSelect(type)}> {type} )
16 | }
17 | )
18 | }
19 |
20 | export default Header
21 |
--------------------------------------------------------------------------------
/client/src/components/header/index.scss:
--------------------------------------------------------------------------------
1 | .header {
2 | background-color: #f60;
3 | color: #fff;
4 | display: flex;
5 | text-align: center;
6 |
7 | .logo {
8 | width: 40px;
9 | height: 40px;
10 | margin:20px;
11 | }
12 |
13 | .link {
14 | line-height: 50px;
15 | padding:20px;
16 | flex: 1;
17 |
18 | &:active {
19 | background: rgba(255,255,255, 0.3);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/client/src/components/login/index.weapp.jsx:
--------------------------------------------------------------------------------
1 | import Taro, { Component } from "@tarojs/taro"
2 | import { View, Text, Button } from "@tarojs/components"
3 |
4 | export default class Login extends Component {
5 | state = {
6 | context: {}
7 | }
8 |
9 | componentWillMount() {}
10 |
11 | componentDidMount() {}
12 |
13 | componentWillUnmount() {}
14 |
15 | componentDidShow() {}
16 |
17 | componentDidHide() {}
18 |
19 | getLogin = () => {
20 | Taro.cloud
21 | .callFunction({
22 | name: "login",
23 | data: {}
24 | })
25 | .then(res => {
26 | this.setState({
27 | context: res.result
28 | })
29 | })
30 | }
31 |
32 | render() {
33 | return (
34 |
35 |
36 | context:{JSON.stringify(this.state.context)}
37 |
38 | )
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/client/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/client/src/lib/cloud/index.h5.js:
--------------------------------------------------------------------------------
1 | import tcb from 'tcb-js-sdk'
2 |
3 | const envId = process.env.ENV_ID
4 | let app = tcb.init({
5 | env: envId
6 | });
7 |
8 | async function checkAuth() {
9 | const loginState = app.auth().hasLoginState();
10 |
11 | if (!loginState) {
12 | return app.auth().anonymousAuthProvider()
13 | .signIn()
14 | }
15 | }
16 |
17 | export default async function () {
18 | await checkAuth()
19 | return app
20 | }
21 |
--------------------------------------------------------------------------------
/client/src/lib/cloud/index.weapp.js:
--------------------------------------------------------------------------------
1 | const envId = process.env.ENV_ID
2 |
3 | export default async function () {
4 | return {
5 | callFunction({
6 | name,
7 | data
8 | }) {
9 | return wx.cloud.callFunction({
10 | name,
11 | data,
12 | config: {
13 | env: envId
14 | }
15 | })
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/client/src/pages/index/index.jsx:
--------------------------------------------------------------------------------
1 | import Taro, { useState, useEffect } from "@tarojs/taro";
2 | import { View, Text, Image } from "@tarojs/components";
3 | import moment from "moment";
4 | import getCloud from "../../lib/cloud";
5 |
6 | import "./index.scss";
7 | import Header from "../../components/header";
8 |
9 | function Index() {
10 | const [types] = useState(["Top", "New", "Show", "Ask", "Jobs"]);
11 | const [curType, setCurType] = useState("Top");
12 | const [list, setList] = useState([]);
13 | const [total, setTotal] = useState(0);
14 | const [curPage, setCurPage] = useState(0);
15 | const [wxacodeSrc, setWxacodeSrc] = useState("");
16 | const pageSize = 10;
17 |
18 | useEffect(() => {
19 | fetchList(curType, curPage);
20 | }, [curType, curPage]);
21 |
22 | useEffect(() => {
23 | getWXACode();
24 | }, []);
25 |
26 | async function fetchList(type, page) {
27 | const cloud = await getCloud();
28 |
29 | const res = await cloud.callFunction({
30 | name: "hackernews-api",
31 | data: {
32 | type: ["Top", "New"].includes(type) ? "story" : type,
33 | ...(type == "Top"
34 | ? {
35 | orderField: "score",
36 | order: "desc"
37 | }
38 | : {}),
39 | perPage: pageSize,
40 | page: Math.max(page, 1)
41 | }
42 | });
43 |
44 | if (res.result) {
45 | setCurPage(Math.max(page, 1));
46 | setList(res.result.data);
47 | setTotal(Math.ceil(res.result.total / pageSize));
48 | }
49 | }
50 |
51 | async function getWXACode() {
52 | const cloud = await getCloud();
53 |
54 | const res = await cloud.callFunction({
55 | name: "openapi",
56 | data: {
57 | action: "getWXACode"
58 | }
59 | });
60 |
61 | if (res.result) {
62 | setWxacodeSrc(res.result);
63 | }
64 | }
65 |
66 | function onSelectType(type) {
67 | setCurType(type);
68 | setCurPage(0);
69 | setTotal(0);
70 | setList([]);
71 | }
72 |
73 | return (
74 |
75 |
76 |
77 |
78 | setCurPage(curPage - 1)}
81 | >
82 | prev
83 |
84 |
85 | {curPage} / {total}
86 |
87 | setCurPage(curPage + 1)}
90 | >
91 | more
92 |
93 |
94 |
95 | {list.map(item => (
96 |
97 | {item.score}
98 |
99 |
100 | {item.title}
101 | (github.com)
102 |
103 |
104 | by {item.by}
105 | {moment(item.time).fromNow()}
106 |
107 |
108 |
109 | ))}
110 |
111 | {wxacodeSrc && (
112 |
113 |
117 |
118 | )}
119 |
120 |
121 | );
122 | }
123 |
124 | Index.config = {
125 | navigationBarTitleText: "云开发 Hacker News",
126 | navigationBarBackgroundColor: "#f60",
127 | navigationBarTextStyle: "white"
128 | };
129 |
130 | export default Index;
131 |
--------------------------------------------------------------------------------
/client/src/pages/index/index.scss:
--------------------------------------------------------------------------------
1 | .index {
2 | background: #f7f7f7;
3 | min-height: 100vh;
4 | }
5 |
6 | .news-list-nav {
7 | background: #fff;
8 | padding: 20px;
9 | text-align: center;
10 | box-shadow: 0 10px 10px rgba(0,0,0,.1);
11 | display: flex;
12 | justify-content: space-evenly;
13 |
14 | .disabled {
15 | pointer-events: none;
16 | color:#999;
17 | }
18 | }
19 |
20 | .news-list {
21 | margin: 40px 0;
22 | .news-item {
23 | display: flex;
24 | padding: 40px 40px 40px 0;
25 | border-bottom: 1px solid #eee;
26 | background: #fff;
27 |
28 | .score {
29 | width: 160px;
30 | text-align: center;
31 | justify-self: center;
32 | align-self: center;
33 | color: #f60;
34 | font-weight: 700;
35 | }
36 |
37 | .body {
38 | flex: 1;
39 | .title {
40 | color: #34495e;
41 | font-size: 30px;
42 | line-height: 40px;
43 | font-weight: bold;
44 | }
45 | .host,.meta, .time {
46 | font-size: 24px;
47 | color: #828282;
48 | font-weight: normal;
49 | }
50 |
51 | .meta {
52 | display: flex;
53 | justify-content: space-between;
54 | }
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/cloud/functions/hackernews-api/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "openapi": [
4 | ]
5 | }
6 | }
--------------------------------------------------------------------------------
/cloud/functions/hackernews-api/index.js:
--------------------------------------------------------------------------------
1 | // 云函数入口文件
2 | const cloud = require("tcb-admin-node");
3 |
4 | cloud.init({
5 | env: cloud.getCurrentEnv(),
6 | });
7 |
8 | // 云函数入口函数
9 | exports.main = async (event, context) => {
10 | const db = cloud.database({
11 | env: cloud.getCurrentEnv(),
12 | });
13 |
14 | const {
15 | type,
16 | page = 1,
17 | perPage = 10,
18 | orderField = "time",
19 | order = "desc",
20 | } = event;
21 |
22 | const collection = db.collection("hackernews");
23 |
24 | let query = collection.where({
25 | type,
26 | });
27 |
28 | const countRes = await query.count();
29 | const getRes = await query
30 | .skip((page - 1) * perPage)
31 | .limit(perPage)
32 | .orderBy(orderField, order)
33 | .get();
34 |
35 | if (getRes.code) {
36 | return getRes;
37 | }
38 |
39 | const result = {
40 | data: getRes.data,
41 | total: countRes.total,
42 | };
43 |
44 | return result;
45 | };
46 |
--------------------------------------------------------------------------------
/cloud/functions/hackernews-api/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hackernews-api",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "tcb-admin-node": "latest"
13 | }
14 | }
--------------------------------------------------------------------------------
/cloud/functions/openapi/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "openapi": [
4 | "wxacode.get",
5 | "subscribeMessage.send",
6 | "subscribeMessage.addTemplate",
7 | "templateMessage.send",
8 | "templateMessage.addTemplate",
9 | "templateMessage.deleteTemplate",
10 | "templateMessage.getTemplateList",
11 | "templateMessage.getTemplateLibraryById",
12 | "templateMessage.getTemplateLibraryList"
13 | ]
14 | }
15 | }
--------------------------------------------------------------------------------
/cloud/functions/openapi/index.js:
--------------------------------------------------------------------------------
1 | // 云函数入口文件
2 | const cloud = require("wx-server-sdk");
3 |
4 | cloud.init();
5 |
6 | // 云函数入口函数
7 | exports.main = async (event, context) => {
8 | console.log(event);
9 | switch (event.action) {
10 | case "requestSubscribeMessage": {
11 | return requestSubscribeMessage(event);
12 | }
13 | case "sendSubscribeMessage": {
14 | return sendSubscribeMessage(event);
15 | }
16 | case "getWXACode": {
17 | return getWXACode(event);
18 | }
19 | case "getOpenData": {
20 | return getOpenData(event);
21 | }
22 | default: {
23 | return;
24 | }
25 | }
26 | };
27 |
28 | // 获取小程序码
29 | async function getWXACode(event) {
30 | // 此处将获取永久有效的小程序码,并将其保存在云文件存储中,最后返回云文件 ID 给前端使用
31 |
32 | const wxacodeResult = await cloud.openapi.wxacode.get({
33 | path: "pages/openapi/openapi",
34 | });
35 |
36 | const fileExtensionMatches = wxacodeResult.contentType.match(/\/([^\/]+)/);
37 | const fileExtension =
38 | (fileExtensionMatches && fileExtensionMatches[1]) || "jpg";
39 |
40 | const uploadResult = await cloud.uploadFile({
41 | // 云文件路径,此处为演示采用一个固定名称
42 | cloudPath: `wxacode_default_openapi_page.${fileExtension}`,
43 | // 要上传的文件内容可直接传入图片 Buffer
44 | fileContent: wxacodeResult.buffer,
45 | });
46 |
47 | const tempRes = await cloud.getTempFileURL({
48 | fileList: [uploadResult.fileID],
49 | });
50 |
51 | return tempRes.fileList[0].tempFileURL;
52 | }
53 |
54 | async function requestSubscribeMessage(event) {
55 | // 此处为模板 ID,开发者需要到小程序管理后台 - 订阅消息 - 公共模板库中添加模板,
56 | // 然后在我的模板中找到对应模板的 ID,填入此处
57 | return "请到管理后台申请模板 ID 然后在此替换"; // 如 'N_J6F05_bjhqd6zh2h1LHJ9TAv9IpkCiAJEpSw0PrmQ'
58 | }
59 |
60 | async function sendSubscribeMessage(event) {
61 | const { OPENID } = cloud.getWXContext();
62 |
63 | const { templateId } = event;
64 |
65 | const sendResult = await cloud.openapi.subscribeMessage.send({
66 | touser: OPENID,
67 | templateId,
68 | miniprogram_state: "developer",
69 | page: "pages/openapi/openapi",
70 | // 此处字段应修改为所申请模板所要求的字段
71 | data: {
72 | thing1: {
73 | value: "咖啡",
74 | },
75 | time3: {
76 | value: "2020-01-01 00:00",
77 | },
78 | },
79 | });
80 |
81 | return sendResult;
82 | }
83 |
84 | async function getOpenData(event) {
85 | return cloud.getOpenData({
86 | list: event.openData.list,
87 | });
88 | }
89 |
--------------------------------------------------------------------------------
/cloud/functions/openapi/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "openapi",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "~2.0.2"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/cloudbaserc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | envId: "bookerzhao-fid9t",
3 | functionRoot: "cloud/functions",
4 | functions: [
5 | {
6 | name: "hackernews-api",
7 | // 超时时间
8 | timeout: 5,
9 | // 运行时
10 | runtime: "Nodejs10.15",
11 | // 内存
12 | memorySize: 128,
13 | // 文件
14 | handler: "index.main",
15 | },
16 | {
17 | name: "openapi",
18 | // 超时时间
19 | timeout: 5,
20 | // 运行时
21 | runtime: "Nodejs10.15",
22 | // 内存
23 | memorySize: 128,
24 | // 文件
25 | handler: "index.main",
26 | },
27 | ],
28 | };
29 |
--------------------------------------------------------------------------------
/flutter_hackernews/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Symbolication related
37 | app.*.symbols
38 |
39 | # Obfuscation related
40 | app.*.map.json
41 |
42 | # Exceptions to above rules.
43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
44 |
--------------------------------------------------------------------------------
/flutter_hackernews/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: f7a6a7906be96d2288f5d63a5a54c515a6e987fe
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/flutter_hackernews/README.md:
--------------------------------------------------------------------------------
1 | # flutter_hackernews
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.example.flutter_hackernews"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | }
47 |
48 | buildTypes {
49 | release {
50 | // TODO: Add your own signing config for the release build.
51 | // Signing with the debug keys for now, so `flutter run --release` works.
52 | signingConfig signingConfigs.debug
53 | }
54 | }
55 | }
56 |
57 | flutter {
58 | source '../..'
59 | }
60 |
61 | dependencies {
62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63 | }
64 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
23 |
27 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/main/kotlin/com/example/flutter_hackernews/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.flutter_hackernews
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/flutter_hackernews/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "";
23 | dstSubfolderSpec = 10;
24 | files = (
25 | );
26 | name = "Embed Frameworks";
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXFrameworksBuildPhase section */
56 |
57 | /* Begin PBXGroup section */
58 | 9740EEB11CF90186004384FC /* Flutter */ = {
59 | isa = PBXGroup;
60 | children = (
61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
65 | );
66 | name = Flutter;
67 | sourceTree = "";
68 | };
69 | 97C146E51CF9000F007C117D = {
70 | isa = PBXGroup;
71 | children = (
72 | 9740EEB11CF90186004384FC /* Flutter */,
73 | 97C146F01CF9000F007C117D /* Runner */,
74 | 97C146EF1CF9000F007C117D /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | 97C146EF1CF9000F007C117D /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 97C146EE1CF9000F007C117D /* Runner.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | 97C146F01CF9000F007C117D /* Runner */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
92 | 97C147021CF9000F007C117D /* Info.plist */,
93 | 97C146F11CF9000F007C117D /* Supporting Files */,
94 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
95 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
96 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
97 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
98 | );
99 | path = Runner;
100 | sourceTree = "";
101 | };
102 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
103 | isa = PBXGroup;
104 | children = (
105 | );
106 | name = "Supporting Files";
107 | sourceTree = "";
108 | };
109 | /* End PBXGroup section */
110 |
111 | /* Begin PBXNativeTarget section */
112 | 97C146ED1CF9000F007C117D /* Runner */ = {
113 | isa = PBXNativeTarget;
114 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
115 | buildPhases = (
116 | 9740EEB61CF901F6004384FC /* Run Script */,
117 | 97C146EA1CF9000F007C117D /* Sources */,
118 | 97C146EB1CF9000F007C117D /* Frameworks */,
119 | 97C146EC1CF9000F007C117D /* Resources */,
120 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
121 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
122 | );
123 | buildRules = (
124 | );
125 | dependencies = (
126 | );
127 | name = Runner;
128 | productName = Runner;
129 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
130 | productType = "com.apple.product-type.application";
131 | };
132 | /* End PBXNativeTarget section */
133 |
134 | /* Begin PBXProject section */
135 | 97C146E61CF9000F007C117D /* Project object */ = {
136 | isa = PBXProject;
137 | attributes = {
138 | LastUpgradeCheck = 1020;
139 | ORGANIZATIONNAME = "";
140 | TargetAttributes = {
141 | 97C146ED1CF9000F007C117D = {
142 | CreatedOnToolsVersion = 7.3.1;
143 | LastSwiftMigration = 1100;
144 | };
145 | };
146 | };
147 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
148 | compatibilityVersion = "Xcode 9.3";
149 | developmentRegion = en;
150 | hasScannedForEncodings = 0;
151 | knownRegions = (
152 | en,
153 | Base,
154 | );
155 | mainGroup = 97C146E51CF9000F007C117D;
156 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
157 | projectDirPath = "";
158 | projectRoot = "";
159 | targets = (
160 | 97C146ED1CF9000F007C117D /* Runner */,
161 | );
162 | };
163 | /* End PBXProject section */
164 |
165 | /* Begin PBXResourcesBuildPhase section */
166 | 97C146EC1CF9000F007C117D /* Resources */ = {
167 | isa = PBXResourcesBuildPhase;
168 | buildActionMask = 2147483647;
169 | files = (
170 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
171 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
172 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
173 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
174 | );
175 | runOnlyForDeploymentPostprocessing = 0;
176 | };
177 | /* End PBXResourcesBuildPhase section */
178 |
179 | /* Begin PBXShellScriptBuildPhase section */
180 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
181 | isa = PBXShellScriptBuildPhase;
182 | buildActionMask = 2147483647;
183 | files = (
184 | );
185 | inputPaths = (
186 | );
187 | name = "Thin Binary";
188 | outputPaths = (
189 | );
190 | runOnlyForDeploymentPostprocessing = 0;
191 | shellPath = /bin/sh;
192 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
193 | };
194 | 9740EEB61CF901F6004384FC /* Run Script */ = {
195 | isa = PBXShellScriptBuildPhase;
196 | buildActionMask = 2147483647;
197 | files = (
198 | );
199 | inputPaths = (
200 | );
201 | name = "Run Script";
202 | outputPaths = (
203 | );
204 | runOnlyForDeploymentPostprocessing = 0;
205 | shellPath = /bin/sh;
206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
207 | };
208 | /* End PBXShellScriptBuildPhase section */
209 |
210 | /* Begin PBXSourcesBuildPhase section */
211 | 97C146EA1CF9000F007C117D /* Sources */ = {
212 | isa = PBXSourcesBuildPhase;
213 | buildActionMask = 2147483647;
214 | files = (
215 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
216 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
217 | );
218 | runOnlyForDeploymentPostprocessing = 0;
219 | };
220 | /* End PBXSourcesBuildPhase section */
221 |
222 | /* Begin PBXVariantGroup section */
223 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
224 | isa = PBXVariantGroup;
225 | children = (
226 | 97C146FB1CF9000F007C117D /* Base */,
227 | );
228 | name = Main.storyboard;
229 | sourceTree = "";
230 | };
231 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
232 | isa = PBXVariantGroup;
233 | children = (
234 | 97C147001CF9000F007C117D /* Base */,
235 | );
236 | name = LaunchScreen.storyboard;
237 | sourceTree = "";
238 | };
239 | /* End PBXVariantGroup section */
240 |
241 | /* Begin XCBuildConfiguration section */
242 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
243 | isa = XCBuildConfiguration;
244 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
245 | buildSettings = {
246 | ALWAYS_SEARCH_USER_PATHS = NO;
247 | CLANG_ANALYZER_NONNULL = YES;
248 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
249 | CLANG_CXX_LIBRARY = "libc++";
250 | CLANG_ENABLE_MODULES = YES;
251 | CLANG_ENABLE_OBJC_ARC = YES;
252 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
253 | CLANG_WARN_BOOL_CONVERSION = YES;
254 | CLANG_WARN_COMMA = YES;
255 | CLANG_WARN_CONSTANT_CONVERSION = YES;
256 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
258 | CLANG_WARN_EMPTY_BODY = YES;
259 | CLANG_WARN_ENUM_CONVERSION = YES;
260 | CLANG_WARN_INFINITE_RECURSION = YES;
261 | CLANG_WARN_INT_CONVERSION = YES;
262 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
263 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
264 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
265 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
266 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
267 | CLANG_WARN_STRICT_PROTOTYPES = YES;
268 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
269 | CLANG_WARN_UNREACHABLE_CODE = YES;
270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
271 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
272 | COPY_PHASE_STRIP = NO;
273 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
274 | ENABLE_NS_ASSERTIONS = NO;
275 | ENABLE_STRICT_OBJC_MSGSEND = YES;
276 | GCC_C_LANGUAGE_STANDARD = gnu99;
277 | GCC_NO_COMMON_BLOCKS = YES;
278 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
279 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
280 | GCC_WARN_UNDECLARED_SELECTOR = YES;
281 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
282 | GCC_WARN_UNUSED_FUNCTION = YES;
283 | GCC_WARN_UNUSED_VARIABLE = YES;
284 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
285 | MTL_ENABLE_DEBUG_INFO = NO;
286 | SDKROOT = iphoneos;
287 | SUPPORTED_PLATFORMS = iphoneos;
288 | TARGETED_DEVICE_FAMILY = "1,2";
289 | VALIDATE_PRODUCT = YES;
290 | };
291 | name = Profile;
292 | };
293 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
294 | isa = XCBuildConfiguration;
295 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
296 | buildSettings = {
297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
298 | CLANG_ENABLE_MODULES = YES;
299 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
300 | ENABLE_BITCODE = NO;
301 | FRAMEWORK_SEARCH_PATHS = (
302 | "$(inherited)",
303 | "$(PROJECT_DIR)/Flutter",
304 | );
305 | INFOPLIST_FILE = Runner/Info.plist;
306 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
307 | LIBRARY_SEARCH_PATHS = (
308 | "$(inherited)",
309 | "$(PROJECT_DIR)/Flutter",
310 | );
311 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterHackernews;
312 | PRODUCT_NAME = "$(TARGET_NAME)";
313 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
314 | SWIFT_VERSION = 5.0;
315 | VERSIONING_SYSTEM = "apple-generic";
316 | };
317 | name = Profile;
318 | };
319 | 97C147031CF9000F007C117D /* Debug */ = {
320 | isa = XCBuildConfiguration;
321 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
322 | buildSettings = {
323 | ALWAYS_SEARCH_USER_PATHS = NO;
324 | CLANG_ANALYZER_NONNULL = YES;
325 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
326 | CLANG_CXX_LIBRARY = "libc++";
327 | CLANG_ENABLE_MODULES = YES;
328 | CLANG_ENABLE_OBJC_ARC = YES;
329 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
330 | CLANG_WARN_BOOL_CONVERSION = YES;
331 | CLANG_WARN_COMMA = YES;
332 | CLANG_WARN_CONSTANT_CONVERSION = YES;
333 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
335 | CLANG_WARN_EMPTY_BODY = YES;
336 | CLANG_WARN_ENUM_CONVERSION = YES;
337 | CLANG_WARN_INFINITE_RECURSION = YES;
338 | CLANG_WARN_INT_CONVERSION = YES;
339 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
340 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
341 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
342 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
343 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
344 | CLANG_WARN_STRICT_PROTOTYPES = YES;
345 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
346 | CLANG_WARN_UNREACHABLE_CODE = YES;
347 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
348 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
349 | COPY_PHASE_STRIP = NO;
350 | DEBUG_INFORMATION_FORMAT = dwarf;
351 | ENABLE_STRICT_OBJC_MSGSEND = YES;
352 | ENABLE_TESTABILITY = YES;
353 | GCC_C_LANGUAGE_STANDARD = gnu99;
354 | GCC_DYNAMIC_NO_PIC = NO;
355 | GCC_NO_COMMON_BLOCKS = YES;
356 | GCC_OPTIMIZATION_LEVEL = 0;
357 | GCC_PREPROCESSOR_DEFINITIONS = (
358 | "DEBUG=1",
359 | "$(inherited)",
360 | );
361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
363 | GCC_WARN_UNDECLARED_SELECTOR = YES;
364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
365 | GCC_WARN_UNUSED_FUNCTION = YES;
366 | GCC_WARN_UNUSED_VARIABLE = YES;
367 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
368 | MTL_ENABLE_DEBUG_INFO = YES;
369 | ONLY_ACTIVE_ARCH = YES;
370 | SDKROOT = iphoneos;
371 | TARGETED_DEVICE_FAMILY = "1,2";
372 | };
373 | name = Debug;
374 | };
375 | 97C147041CF9000F007C117D /* Release */ = {
376 | isa = XCBuildConfiguration;
377 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
378 | buildSettings = {
379 | ALWAYS_SEARCH_USER_PATHS = NO;
380 | CLANG_ANALYZER_NONNULL = YES;
381 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
382 | CLANG_CXX_LIBRARY = "libc++";
383 | CLANG_ENABLE_MODULES = YES;
384 | CLANG_ENABLE_OBJC_ARC = YES;
385 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
386 | CLANG_WARN_BOOL_CONVERSION = YES;
387 | CLANG_WARN_COMMA = YES;
388 | CLANG_WARN_CONSTANT_CONVERSION = YES;
389 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
390 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
391 | CLANG_WARN_EMPTY_BODY = YES;
392 | CLANG_WARN_ENUM_CONVERSION = YES;
393 | CLANG_WARN_INFINITE_RECURSION = YES;
394 | CLANG_WARN_INT_CONVERSION = YES;
395 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
396 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
397 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
398 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
399 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
400 | CLANG_WARN_STRICT_PROTOTYPES = YES;
401 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
402 | CLANG_WARN_UNREACHABLE_CODE = YES;
403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
405 | COPY_PHASE_STRIP = NO;
406 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
407 | ENABLE_NS_ASSERTIONS = NO;
408 | ENABLE_STRICT_OBJC_MSGSEND = YES;
409 | GCC_C_LANGUAGE_STANDARD = gnu99;
410 | GCC_NO_COMMON_BLOCKS = YES;
411 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
412 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
413 | GCC_WARN_UNDECLARED_SELECTOR = YES;
414 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
415 | GCC_WARN_UNUSED_FUNCTION = YES;
416 | GCC_WARN_UNUSED_VARIABLE = YES;
417 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
418 | MTL_ENABLE_DEBUG_INFO = NO;
419 | SDKROOT = iphoneos;
420 | SUPPORTED_PLATFORMS = iphoneos;
421 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
422 | TARGETED_DEVICE_FAMILY = "1,2";
423 | VALIDATE_PRODUCT = YES;
424 | };
425 | name = Release;
426 | };
427 | 97C147061CF9000F007C117D /* Debug */ = {
428 | isa = XCBuildConfiguration;
429 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
430 | buildSettings = {
431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
432 | CLANG_ENABLE_MODULES = YES;
433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
434 | ENABLE_BITCODE = NO;
435 | FRAMEWORK_SEARCH_PATHS = (
436 | "$(inherited)",
437 | "$(PROJECT_DIR)/Flutter",
438 | );
439 | INFOPLIST_FILE = Runner/Info.plist;
440 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
441 | LIBRARY_SEARCH_PATHS = (
442 | "$(inherited)",
443 | "$(PROJECT_DIR)/Flutter",
444 | );
445 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterHackernews;
446 | PRODUCT_NAME = "$(TARGET_NAME)";
447 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
448 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
449 | SWIFT_VERSION = 5.0;
450 | VERSIONING_SYSTEM = "apple-generic";
451 | };
452 | name = Debug;
453 | };
454 | 97C147071CF9000F007C117D /* Release */ = {
455 | isa = XCBuildConfiguration;
456 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
457 | buildSettings = {
458 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
459 | CLANG_ENABLE_MODULES = YES;
460 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
461 | ENABLE_BITCODE = NO;
462 | FRAMEWORK_SEARCH_PATHS = (
463 | "$(inherited)",
464 | "$(PROJECT_DIR)/Flutter",
465 | );
466 | INFOPLIST_FILE = Runner/Info.plist;
467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
468 | LIBRARY_SEARCH_PATHS = (
469 | "$(inherited)",
470 | "$(PROJECT_DIR)/Flutter",
471 | );
472 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterHackernews;
473 | PRODUCT_NAME = "$(TARGET_NAME)";
474 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
475 | SWIFT_VERSION = 5.0;
476 | VERSIONING_SYSTEM = "apple-generic";
477 | };
478 | name = Release;
479 | };
480 | /* End XCBuildConfiguration section */
481 |
482 | /* Begin XCConfigurationList section */
483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
484 | isa = XCConfigurationList;
485 | buildConfigurations = (
486 | 97C147031CF9000F007C117D /* Debug */,
487 | 97C147041CF9000F007C117D /* Release */,
488 | 249021D3217E4FDB00AE95B9 /* Profile */,
489 | );
490 | defaultConfigurationIsVisible = 0;
491 | defaultConfigurationName = Release;
492 | };
493 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
494 | isa = XCConfigurationList;
495 | buildConfigurations = (
496 | 97C147061CF9000F007C117D /* Debug */,
497 | 97C147071CF9000F007C117D /* Release */,
498 | 249021D4217E4FDB00AE95B9 /* Profile */,
499 | );
500 | defaultConfigurationIsVisible = 0;
501 | defaultConfigurationName = Release;
502 | };
503 | /* End XCConfigurationList section */
504 | };
505 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
506 | }
507 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binggg/tcb-hackernews/9d8837cd3ba67879ee278e2e70523e13e6ba90cb/flutter_hackernews/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | 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.
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_hackernews
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/flutter_hackernews/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/flutter_hackernews/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'package:cloudbase_core/cloudbase_core.dart';
4 | import 'package:cloudbase_auth/cloudbase_auth.dart';
5 |
6 | void main() {
7 | // 初始化 CloudBase
8 | CloudBaseCore core = CloudBaseCore.init({
9 | // 填写你的云开发 env
10 | 'env': 'bookerzhao-fid9t',
11 | });
12 |
13 | // 获取登录状态
14 | CloudBaseAuth auth = CloudBaseAuth(core);
15 | CloudBaseAuthState authState = await auth.getAuthState();
16 |
17 | // 唤起匿名登录
18 | if (authState == null) {
19 | await auth.signInAnonymously().then((success) {
20 | // 登录成功
21 | print(success);
22 | }).catchError((err) {
23 | // 登录失败
24 | print(err);
25 | });
26 | }
27 |
28 | CloudBaseFunction cloudbase = CloudBaseFunction(core);
29 |
30 | // 请求参数
31 | Map data = {'type': 'story';
32 |
33 | CloudBaseResponse res = await cloudbase.callFunction('"hackernews-api', data);
34 | print(res.data) // { sum: 3 }
35 | runApp(MyApp());
36 | }
37 |
38 | class MyApp extends StatelessWidget {
39 | // This widget is the root of your application.
40 | @override
41 | Widget build(BuildContext context) {
42 | return MaterialApp(
43 | title: 'Flutter Demo',
44 | theme: ThemeData(
45 | // This is the theme of your application.
46 | //
47 | // Try running your application with "flutter run". You'll see the
48 | // application has a blue toolbar. Then, without quitting the app, try
49 | // changing the primarySwatch below to Colors.green and then invoke
50 | // "hot reload" (press "r" in the console where you ran "flutter run",
51 | // or simply save your changes to "hot reload" in a Flutter IDE).
52 | // Notice that the counter didn't reset back to zero; the application
53 | // is not restarted.
54 | primarySwatch: Colors.blue,
55 | // This makes the visual density adapt to the platform that you run
56 | // the app on. For desktop platforms, the controls will be smaller and
57 | // closer together (more dense) than on mobile platforms.
58 | visualDensity: VisualDensity.adaptivePlatformDensity,
59 | ),
60 | home: MyHomePage(title: 'Flutter Demo Home Page'),
61 | );
62 | }
63 | }
64 |
65 | class MyHomePage extends StatefulWidget {
66 | MyHomePage({Key key, this.title}) : super(key: key);
67 |
68 | // This widget is the home page of your application. It is stateful, meaning
69 | // that it has a State object (defined below) that contains fields that affect
70 | // how it looks.
71 |
72 | // This class is the configuration for the state. It holds the values (in this
73 | // case the title) provided by the parent (in this case the App widget) and
74 | // used by the build method of the State. Fields in a Widget subclass are
75 | // always marked "final".
76 |
77 | final String title;
78 |
79 | @override
80 | _MyHomePageState createState() => _MyHomePageState();
81 | }
82 |
83 | class _MyHomePageState extends State {
84 | int _counter = 0;
85 |
86 | void _incrementCounter() {
87 | setState(() {
88 | // This call to setState tells the Flutter framework that something has
89 | // changed in this State, which causes it to rerun the build method below
90 | // so that the display can reflect the updated values. If we changed
91 | // _counter without calling setState(), then the build method would not be
92 | // called again, and so nothing would appear to happen.
93 | _counter++;
94 | });
95 | }
96 |
97 | @override
98 | Widget build(BuildContext context) {
99 | // This method is rerun every time setState is called, for instance as done
100 | // by the _incrementCounter method above.
101 | //
102 | // The Flutter framework has been optimized to make rerunning build methods
103 | // fast, so that you can just rebuild anything that needs updating rather
104 | // than having to individually change instances of widgets.
105 | return Scaffold(
106 | appBar: AppBar(
107 | // Here we take the value from the MyHomePage object that was created by
108 | // the App.build method, and use it to set our appbar title.
109 | title: Text(widget.title),
110 | ),
111 | body: Center(
112 | // Center is a layout widget. It takes a single child and positions it
113 | // in the middle of the parent.
114 | child: Column(
115 | // Column is also a layout widget. It takes a list of children and
116 | // arranges them vertically. By default, it sizes itself to fit its
117 | // children horizontally, and tries to be as tall as its parent.
118 | //
119 | // Invoke "debug painting" (press "p" in the console, choose the
120 | // "Toggle Debug Paint" action from the Flutter Inspector in Android
121 | // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
122 | // to see the wireframe for each widget.
123 | //
124 | // Column has various properties to control how it sizes itself and
125 | // how it positions its children. Here we use mainAxisAlignment to
126 | // center the children vertically; the main axis here is the vertical
127 | // axis because Columns are vertical (the cross axis would be
128 | // horizontal).
129 | mainAxisAlignment: MainAxisAlignment.center,
130 | children: [
131 | Text(
132 | 'You have pushed the button this many times:',
133 | ),
134 | Text(
135 | '$_counter',
136 | style: Theme.of(context).textTheme.headline4,
137 | ),
138 | ],
139 | ),
140 | ),
141 | floatingActionButton: FloatingActionButton(
142 | onPressed: _incrementCounter,
143 | tooltip: 'Increment',
144 | child: Icon(Icons.add),
145 | ), // This trailing comma makes auto-formatting nicer for build methods.
146 | );
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/flutter_hackernews/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_hackernews
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `pub publish`. This is preferred for private packages.
6 | publish_to: "none" # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.7.0 <3.0.0"
22 |
23 | dependencies:
24 | flutter:
25 | sdk: flutter
26 | cloudbase_core: ^0.0.4
27 | cloudbase_auth: ^0.0.4
28 |
29 | # The following adds the Cupertino Icons font to your application.
30 | # Use with the CupertinoIcons class for iOS style icons.
31 | cupertino_icons: ^0.1.3
32 |
33 | dev_dependencies:
34 | flutter_test:
35 | sdk: flutter
36 |
37 | # For information on the generic Dart part of this file, see the
38 | # following page: https://dart.dev/tools/pub/pubspec
39 |
40 | # The following section is specific to Flutter.
41 | flutter:
42 | # The following line ensures that the Material Icons font is
43 | # included with your application, so that you can use the icons in
44 | # the material Icons class.
45 | uses-material-design: true
46 | # To add assets to your application, add an assets section, like this:
47 | # assets:
48 | # - images/a_dot_burr.jpeg
49 | # - images/a_dot_ham.jpeg
50 | # An image asset can refer to one or more resolution-specific "variants", see
51 | # https://flutter.dev/assets-and-images/#resolution-aware.
52 | # For details regarding adding assets from package dependencies, see
53 | # https://flutter.dev/assets-and-images/#from-packages
54 | # To add custom fonts to your application, add a fonts section here,
55 | # in this "flutter" section. Each entry in this list should have a
56 | # "family" key with the font family name, and a "fonts" key with a
57 | # list giving the asset and other descriptors for the font. For
58 | # example:
59 | # fonts:
60 | # - family: Schyler
61 | # fonts:
62 | # - asset: fonts/Schyler-Regular.ttf
63 | # - asset: fonts/Schyler-Italic.ttf
64 | # style: italic
65 | # - family: Trajan Pro
66 | # fonts:
67 | # - asset: fonts/TrajanPro.ttf
68 | # - asset: fonts/TrajanPro_Bold.ttf
69 | # weight: 700
70 | #
71 | # For details regarding fonts from package dependencies,
72 | # see https://flutter.dev/custom-fonts/#from-packages
73 |
--------------------------------------------------------------------------------
/flutter_hackernews/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:flutter_hackernews/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tcb-hacker-news",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "cloudbaserc.js",
6 | "scripts": {
7 | "dev:h5": "cd client && OUTPUT_ROOT=build npm run dev:h5",
8 | "dev:weapp": "cd client && npm run dev:weapp",
9 | "build:h5": "cd client && OUTPUT_ROOT=build npm run build:h5",
10 | "build:weapp": "cd client && npm run build:weapp",
11 | "dev": "npm run dev:h5 && npm run dev:weapp",
12 | "build": "npm run build:h5 && npm run build:weapp",
13 | "deploy": "echo y | npm run deploy:function && npm run deploy:static",
14 | "deploy:function": "cloudbase functions:deploy --force",
15 | "deploy:static": "cloudbase hosting:deploy client/build"
16 | },
17 | "repository": {
18 | "type": "git",
19 | "url": "git+https://github.com/binggg/tcb-hackernews.git"
20 | },
21 | "keywords": [],
22 | "author": "",
23 | "license": "ISC",
24 | "bugs": {
25 | "url": "https://github.com/binggg/tcb-hackernews/issues"
26 | },
27 | "homepage": "https://github.com/binggg/tcb-hackernews#readme",
28 | "devDependencies": {
29 | "@cloudbase/cli": "^0.7.3"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "miniprogramRoot": "client/dist/",
3 | "cloudfunctionRoot": "cloud/functions/",
4 | "projectname": "tcb-hacker-news",
5 | "description": "云开发 Hacker News 项目( 小程序+Web)",
6 | "appid": "wxbfac283b56046ad9",
7 | "setting": {
8 | "urlCheck": true,
9 | "es6": false,
10 | "postcss": false,
11 | "minified": false
12 | },
13 | "compileType": "miniprogram",
14 | "simulatorType": "wechat",
15 | "simulatorPluginLibVersion": {},
16 | "cloudfunctionTemplateRoot": "cloudfunctionTemplate",
17 | "condition": {}
18 | }
--------------------------------------------------------------------------------