Giter Club home page Giter Club logo

web-conf's People

Contributors

jiahao-in-thoughtworks avatar jiangyuzhen avatar techquery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web-conf's Issues

报错 /Web-Conf/node_modules/web-cell/source/renderer.ts:39:21: Cannot resolve dependency 'snabbdom/build/package/init'

是否还要安装对应的 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".

@TechQuery

How to call items from JSON API and added to TabBar - Flutter

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;
                                  })),
                    ],
                  ),
                ),
              ),
            ),

          ],
        ),
      ),
      ),),

    );
  }
}

报错 ` Browser scripts cannot have imports or exports.`

系统 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

@TechQuery

主持人

  • 本身是一线程序员
  • 事先了解各位讲师的逸闻、主题的概况
  • 抖得了包袱、接得住梗
  • 女生优先
  • 可以女装、汉服

外地讲师接待

  • 酒店统一预订,舒适、方便的同时力求折扣
  • 统一接受各讲师书童在行程方面的咨询
  • 原则上不超过¥400/日/间,会场附近
  • 可以“讲师商旅独家合作”的名义谈合作,给予 logo 露出、主持人口播等权益

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.