freecodecamp-chengdu / web-conf Goto Github PK
View Code? Open in Web Editor NEW成都 Web 前端交流大会
Home Page: https://web-conf.dev/
License: GNU Affero General Public License v3.0
成都 Web 前端交流大会
Home Page: https://web-conf.dev/
License: GNU Affero General Public License v3.0
展架的尺寸和个数
纸质票数量
自拍场景板位置
易拉宝位置
是否还要安装对应的 type 文件?
运行 pnpm start 出现如上报错。
详细报错信息
系统 Ubuntu 22.04
node 版本 16.19.0
npm 版本 8.19.3
npm start
> [email protected] start
> parcel source/index.html --open
Server running at http://localhost:1234
🚨 /home/luo/nodeWork/Web-Conf/node_modules/web-cell/source/renderer.ts:39:21: Cannot resolve dependency 'snabbdom/build/package/init'
at Resolver.resolve (/home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Resolver.js:71:17)
at async Bundler.resolveAsset (/home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:433:18)
at async Bundler.resolveDep (/home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:484:14)
at async /home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:608:26
at async Promise.all (index 2)
at async Bundler.loadAsset (/home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:599:21)
at async /home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:610:13
at async Promise.all (index 3)
at async Bundler.loadAsset (/home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:599:21)
at async /home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:610:13
at async Promise.all (index 4)
at async Bundler.loadAsset (/home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:599:21)
at async /home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:610:13
at async Promise.all (index 2)
at async Bundler.loadAsset (/home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:599:21)
at async Bundler.processAsset (/home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/Bundler.js:557:5)
at async PromiseQueue._runJob (/home/luo/nodeWork/Web-Conf/node_modules/.pnpm/[email protected]/node_modules/parcel-bundler/src/utils/PromiseQueue.js:48:7)
⚠️ Could not load source file "../src/index.ts" in source map of "../node_modules/html-to-image/es/index.js".
⚠️ Could not load source file "../src/clone-node.ts" in source map of "../node_modules/html-to-image/es/clone-node.js".
⚠️ Could not load source file "../src/embed-images.ts" in source map of "../node_modules/html-to-image/es/embed-images.js".
⚠️ Could not load source file "../src/apply-style.ts" in source map of "../node_modules/html-to-image/es/apply-style.js".
⚠️ Could not load source file "../src/embed-webfonts.ts" in source map of "../node_modules/html-to-image/es/embed-webfonts.js".
⚠️ Could not load source file "../src/util.ts" in source map of "../node_modules/html-to-image/es/util.js".
⚠️ Could not load source file "../src/clone-pseudos.ts" in source map of "../node_modules/html-to-image/es/clone-pseudos.js".
⚠️ Could not load source file "../src/mimes.ts" in source map of "../node_modules/html-to-image/es/mimes.js".
⚠️ Could not load source file "../src/dataurl.ts" in source map of "../node_modules/html-to-image/es/dataurl.js".
⚠️ Could not load source file "../src/embed-resources.ts" in source map of "../node_modules/html-to-image/es/embed-resources.js".
I want to create (News App), I have a list of category in the website, I followed this documentation, so I need to add website's category to my TabBar, exactly like this image.
How can I do that with reverse tabs from left to right to right to left?
And I want to change direction from left to right to from right to left, How can I do that?
Code:
Category Class:
import 'dart:async';
import 'dart:convert';
import 'package:http/http.dart' as http;
Future<Category> fetchCatgeory() async {
final response = await http.get("url");
if (response.statusCode == 200) {
return Category.fromJson(json.decode(response.body));
} else {
throw Exception('Failed to load category');
}
}
class Category {
final int id;
final String title;
Category({this.id, this.title});
factory Category.fromJson(Map<String, dynamic> json) {
return Category (
id: json['id'],
title: json['title'],
);
}
}
HomePage Class:
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:munaw3_news/extra/json_file.dart';
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
final Future<Category> catg;
HomePage({Key key, this.catg}) : super(key: key);
}
class _HomePageState extends State<HomePage> {
_HomePageState();
int a = 0;
Future<Category> catg;
@override
void initState() {
// TODO: implement initState
super.initState();
catg = fetchCatgeory();
}
bool isPressed = false;
_pressed() {
var newVal = true;
if(isPressed) {
newVal = false;
} else {
newVal = true;
}
setState((){
isPressed = newVal;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: DefaultTabController(
length: catg.toString().length,
child: Scaffold(
appBar: AppBar(
title: Image.asset('assets/logo.png', fit: BoxFit.cover,),
centerTitle: true,
backgroundColor: Colors.grey[900],
bottom: TabBar(
tabs: [
// Tab(text: catg[0],),
// Tab(text: catg[1],),
// Tab(text: catg[2],),
// Tab(text: catg[3],)
],
),
),
body: TabBarView(
children: [
// Tab(text: catg[0],),
// Tab(text: catg[1],),
// Tab(text: catg[2],),
// Tab(text: catg[3],)
],
),
bottomNavigationBar: BottomAppBar(
clipBehavior: Clip.antiAlias,
elevation: 0,
color: Colors.grey[900],
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
height: 5,
width: double.infinity,
color: Colors.grey[900],
),
Padding(
padding: const EdgeInsets.only(left: 8, right: 8),
child: Container(
height: 60,
child: Align(
alignment: FractionalOffset.center,
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
IconButton(icon: Icon(Icons.info), color: Colors.grey[600], iconSize: 30,
disabledColor: Colors.white,
onPressed: a==3 ? null : () => setState(() {
a=3;
})),
IconButton(icon: Icon(Icons.local_mall), color: Colors.grey[600], iconSize: 30,
disabledColor: Colors.white,
onPressed: a==2 ? null : () => setState(() {
a=2;
})),
IconButton(icon: Icon(Icons.bookmark), color: Colors.grey[600], iconSize: 30,
disabledColor: Colors.white,
onPressed: a==1 ? null : () => setState(() {
a=1;
})),
IconButton(icon: Icon(Icons.home), color: Colors.grey[600], iconSize: 30,
disabledColor: Colors.white,
onPressed: a==0 ? null : () => setState(() {
a=0;
})),
],
),
),
),
),
],
),
),
),),
);
}
}
系统 Ubuntu 22.04
node 版本 16.19.0
npm 版本 8.19.3
运行 npm start
🚨 Build failed.
@parcel/transformer-js: Browser scripts cannot have imports or exports.
/home/luo/nodeWork/Web-Conf/source/index.tsx:1:1
> 1 | import { auto } from 'browser-unhandled-rejection';
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | import { serviceWorkerUpdate } from 'web-utility/source/event';
3 | import { render, createCell, documentReady } from 'web-cell';
/home/luo/nodeWork/Web-Conf/source/index.html:19:9
18 | <link rel="manifest" href="index.webmanifest" />
> 19 | <script src="https://cdn.jsdelivr.net/npm/[email protected]/pwacompat.min.js"></script>
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The environment was originally created here
20 | <link
21 | rel="stylesheet"
💡 Add the type="module" attribute to the <script> tag.
📝 Learn more: https://parceljs.org/languages/javascript/#classic-scripts
期间尝试把 jsderliver 相关cdn 换成 国内的 https://staticfile.org/ 还是有 The environment was originally created here
报错
尝试过 , 给cdn的js 添加 type="module"
还是一样的报错,
不过看了parceljs 文档 像是针对 parcejs 2 的, 本项目安装的是 parcel 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.