【Flutter入门到进阶】Flutter基础篇---基础组件

news2024/9/29 15:28:30

1 Container容器组件

1.1 属性说明

1.1.1 alignment

        topCenter:顶部居中对齐

        topLeft:顶部左对齐

        topRight:顶部右对齐

        center:水平垂直居中对齐

        centerLeft:垂直居中水平居左对齐

        centerRight:垂直居中水平居右对齐

        bottomCenter底部居中对齐

        bottomLeft:底部居左对齐

        bottomRight:底部居右对齐

1.1.2 decoration

        margin:属性是表示Container与外部其他组件的距离。   EdgeInsets.all(20.0),

        padding:就是Container的内边距,指Container边缘与Child之间的距离 padding:EdgeInsets.all(10.0)

        transform:让Container容易进行一些旋转之类的transform: Matrix4.rotationZ(0.2)

        height:容器高度

        width:容器宽度

        child:容器子元素

示例代码01

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: const Text("你好Flutter")),
      body: const MyApp(),
    ),
  ));
}



// 容器组件
class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        alignment: Alignment.center,
        height: 200,
        width: 200,
        decoration: const BoxDecoration(
          color: Colors.yellow,
        ),
        child: const Text(
          "你好Flutter",
          style: TextStyle(fontSize: 20),
        ),
      ),
    );
  }
}

示例代码02

//代码块 importM
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: const Text("你好Flutter")),
      body: const MyApp(),
    ),
  ));
}

// 代码块  statelessW
class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        alignment: Alignment.center,
        height: 200,
        width: 200,
        decoration:  BoxDecoration(
            color: Colors.yellow,
            gradient: const LinearGradient(
              //LinearGradient 背景线性渐变   RadialGradient径向渐变
              colors: [Colors.red, Colors.orange],
            ),
            boxShadow:const [
              //卡片阴影
              BoxShadow(
                color: Colors.blue,
                offset: Offset(2.0, 2.0),
                blurRadius: 10.0,
              )
            ],
            border: Border.all(
                color: Colors.black,
                width: 1
            )
        ),
        transform:Matrix4.rotationZ(0.2),
        child: const Text(
          "你好Flutter",
          style: TextStyle(fontSize: 20),
        ),

      ),
    );
  }
}

示例代码03

//代码块 importM
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: const Text("你好Flutter")),
      body: const MyApp(),
    ),
  ));
}

// 代码块  statelessW
class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Center(

      // child: Container(
      //   margin: EdgeInsets.all(20.0), //容器外补白
      //   color: Colors.orange,
      //   child: Text("Hello world !"),
      // ),
      // child: Container(
      //   padding: EdgeInsets.all(20.0), //容器内补白
      //   color: Colors.orange,
      //   child: Text("Hello world !"),
      // ),
      child: Container(
        alignment: Alignment.center,
        height: 40,
        width: 200,
        decoration:  BoxDecoration(
            color: Colors.blue,
            borderRadius: BorderRadius.circular(15)
        ),
        child: const Text(
          "按钮",
          style: TextStyle(fontSize: 20),
        ),
      ),
    );
  }
}

2 Text组件详解

2.1 属性说明

2.1.1 textAlign

        文本对齐方式(center居中,  left左对齐,  right右对齐,  justfy两端对齐)

2.1.2 textDirection

        文本方向(ltr从左至右,  rtl从右至左)

2.1.3 overflow

        文字超出屏幕之后的处理方式(clip裁剪,  fade渐隐,  ellipsis省略号)

2.1.4 textScaleFactor

        字体显示倍率

2.1.5 maxLines

        文字显示最大行数

2.1.6 style

        字体的样式设置

2.2 TextStyle 的参数

2.2.1 decoration

        文字装饰线(none没有线,  lineThrough删除线,  overline上划线, underline下划线)

2.2.2 decorationColor

        文字装饰线颜色

2.2.3 decorationStyle

        文字装饰线风格([dashed,dotted]虚线,  double两根线,  solid一根实线, wavy波浪线)

2.2.4 wordSpacing

        单词间隙(如果是负值,会让单词变得更紧凑

2.2.5 letterSpacing

        字母间隙(如果是负值,会让字母变得更紧凑)

2.2.6 fontStyle

        文字样式(italic斜体,  normal正常体)

2.2.7 fontSize

        文字大小

2.2.8 color

        文字颜色

2.2.9 fontWeight

        字体粗细(bold粗体,  normal正常体)

2.2.10 更多参数

        https://docs.flutter.io/flutter/painting/TextStyle-class.html

2.3 示例代码

//代码块 importM
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: const Text("你好Flutter")),
      body: const MyApp(),
    ),
  ));
}

// 代码块  statelessW
class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        alignment: Alignment.center,
        height: 200,
        width: 200,
        decoration: BoxDecoration(
            color: Colors.yellow,
            gradient: const LinearGradient(
              //LinearGradient 背景线性渐变   RadialGradient径向渐变
              colors: [Colors.red, Colors.orange],
            ),
            boxShadow: const [
              //卡片阴影
              BoxShadow(
                color: Colors.blue,
                offset: Offset(2.0, 2.0),
                blurRadius: 10.0,
              )
            ],
            border: Border.all(color: Colors.black, width: 1)),
        transform: Matrix4.rotationZ(.2),
        child: const Text('各位同学大家好',
            textAlign: TextAlign.left,
            overflow: TextOverflow.ellipsis,
            // overflow:TextOverflow.fade ,
            maxLines: 2,
            textScaleFactor: 1.8,
            style: TextStyle(
                fontSize: 16.0,
                color: Colors.black,
                // color:Color.fromARGB(a, r, g, b)
                fontWeight: FontWeight.w800,
                fontStyle: FontStyle.italic,
                decoration: TextDecoration.lineThrough,
                decorationColor: Colors.white,
                decorationStyle: TextDecorationStyle.dashed,
                letterSpacing: 5.0)),
      ),
    );
  }
}

3 图片组件详解

3.1 说明

        Flutter 中,我们可以通过 Image组件来加载并显示图片 Image 的数据源可以是asset、文件、内存以 及网络 。

        Image.asset  本地图片

        Image.network  远程图片

3.2 属性说明

        更多属性参考https://api.flutter.dev/flutter/widgets/Image-class.html

3.3 加载本地图片

3.3.1 项目根目录新建images文件夹,images中新建2.x  3.x对应的文件

3.3.2 然后,打开pubspec.yaml 声明一下添加的图片文件,   注意: 空格

3.3.3 使用

import 'package:flutter/material.dart';

//本地图片
void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: const Text("你好Flutter")),
      body: const MyApp(),
    ),
  ));
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Image.asset(
          "images/2.jpg",
          width: 150.0,
          height: 150.0,
          fit: BoxFit.cover),
    );
  }
}

3.4 加载远程图片

import 'package:flutter/material.dart';

//图片路径 https://pics6.baidu.com/feed/43a7d933c895d1431790def92fe644055baf0727.jpeg@f_auto?token=18bdda8ca14969d4351c53a482c2b2ca&s=5BB105C154B1499472A1215B03001013
//远程图片
void main(){
  runApp(
      MaterialApp(
        home: Scaffold(
            appBar: AppBar(title: const Text("你好Flutter")),
            body: const MyApp()
        ),
      )
  );
}
class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Image.network(
          "https://pics2.baidu.com/feed/b7003af33a87e9502b64d86f4c2e9544fbf2b45b.jpeg@f_auto?token=8c6557279177a75d44029840f0db0daa&s=C8AA67D91C0090457095310903005057",
          // "https://pics6.baidu.com/feed/43a7d933c895d1431790def92fe644055baf0727.jpeg@f_auto?token=18bdda8ca14969d4351c53a482c2b2ca&s=5BB105C154B1499472A1215B03001013",
          width: 150.0,
          height: 150.0,
          fit: BoxFit.cover),
    );
  }
}

3.5 原型图片

3.5.1 Container实现圆形图片

3.5.2 ClipOval实现圆形图片

3.5.3 CircleAvatar实现圆形图片

3.5.4 示例

import 'package:flutter/material.dart';



void main() {

  runApp(MaterialApp(

    home: Scaffold(

        appBar: AppBar(title: const Text("你好Flutter")),

        // body: const MyApp()

        // body: const MyApp2()

        body: const MyApp3()

    ),

  ));

}



const String URL = "https://pics2.baidu.com/feed/b7003af33a87e9502b64d86f4c2e9544fbf2b45b.jpeg@f_auto?token=8c6557279177a75d44029840f0db0daa&s=C8AA67D91C0090457095310903005057";



//Container实现圆形图片

class MyApp extends StatelessWidget {

  const MyApp({Key? key}) : super(key: key);



  @override

  Widget build(BuildContext context) {

    return Center(

      child: Container(

        width: 150,

        height: 150,

        decoration: BoxDecoration(

            color: Colors.yellow,

            borderRadius: BorderRadius.circular(75),

            image: const DecorationImage(

                image: NetworkImage(URL),

                fit: BoxFit.cover)),

      ),

    );

  }

}



//ClipOval实现圆形图片

class MyApp2 extends StatelessWidget {

  const MyApp2({Key? key}) : super(key: key);

  @override

  Widget build(BuildContext context) {

    return Center(

      child: ClipOval(

        child: Image.network(

            URL,

            width: 150.0,

            height: 150.0,

            fit: BoxFit.cover),

      ),

    );

  }

}

//CircleAvatar实现圆形图片

class MyApp3 extends StatelessWidget {

  const MyApp3({Key? key}) : super(key: key);

  @override

  Widget build(BuildContext context) {

    return const CircleAvatar(

        radius: 110,

        backgroundColor: Color(0xffFDCF09),

        child: CircleAvatar(

          radius: 100,

          backgroundImage:

          NetworkImage(URL),

        )

    );

  }

}

4 图标组件

4.1 使用Flutter官方Icons图标

        Material Design所有图标可以在其官网查看:  https://material.io/tools/icons/

案例

import 'package:flutter/material.dart';

//使用Flutter官方Icons图标
//图标库:https://material.io/tools/icons/
void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: const Text("你好Flutter")),
      body: const MyApp(),
    ),
  ));
}



class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Center(
        child: Column(
          children: const [
            Icon(Icons.search,color: Colors.red),
            Icon(Icons.home,color: Colors.cyan),
            Icon(Icons.category),
            Icon(Icons.shop),
          ]
        )
    );
  }
}

4.2 Flutter中借助阿里巴巴图标库自定义字体图标

4.2.1 使用自定义字体图标。

        阿里巴巴图标库官网 iconfont.cn上有很多字体图标素材,我们可以 选择自己需要的图标打包下载后,会生成一些不同格式的字体文件,在Flutter中,我们使用ttf格式即可。

4.2.2 假设我们项目中需要使用一个书籍图标和微信图标,我们打包下载后导入:

1. 导入字体图标文件;这一步和导入字体文件相同,假设我们的字体图标文件保存在项目根目录下, 路径为"fonts/iconfont.ttf":

fonts:
    - family: myIcon  #指定一个字体名
      fonts:
        - asset: fonts/iconfont.ttf

4.2.3 也可以配置多个字体文件

fonts:
    - family: myIcon  #指定一个字体名
      fonts:
        - asset: fonts/iconfont.ttf
    - family: myIcon  #指定一个字体名
      fonts:
        - asset: fonts/iconfont.ttf
    - family: myIcon  #指定一个字体名
      fonts:
        - asset: fonts/iconfont.ttf

4.2.4 定义一个 MyIcons类

        功能和 Icons类一样:将字体文件中的所有图标都定义 成静态变量:

import 'package:flutter/material.dart'; 
class MyIcons{   
    // 设置图标   
    static const IconData set = IconData(0xe601,fontFamily: 'myIcon', matchTextDirection: true); 
}

示例

import 'package:flutter/material.dart';

import 'package:flutter_chaper_01/src/asset/font.dart';


//使用阿里图标库支持

//图标库:https://material.io/tools/icons/

void main() {

  runApp(MaterialApp(

    home: Scaffold(

      appBar: AppBar(title: const Text("你好Flutter")),

      body: const MyApp(),

    ),

  ));

}


class MyApp extends StatelessWidget {

  const MyApp({Key? key}) : super(key: key);

  @override

  Widget build(BuildContext context) {

    return Center(

        child: Column(

          children: const [

            Icon(MyIcons.set,color: Colors.red),

            Icon(Icons.home,color: Colors.cyan),

            Icon(Icons.category),

            Icon(Icons.shop),

          ]

        )

    );

  }

}

5 Flutter 列表组件

5.1 列表布局是我们项目开发中最常用的一种布局方式

        Flutter中我们可以通过ListView来定义列表项,支 持垂直和水平方向展示。通过一个属性就可以控制列表的显示方向。

5.2 列表有以下分类

5.2.1 垂直列表

5.2.2 垂直图文列表

5.2.3 水平列表

5.2.4 动态列表

5.3 列表组件常用参数

5.4 示例

5.4.1 垂直列表

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: const Text("你好Flutter")),
// body: const VerticalList(),
// body: const VerticalIconList(),
      body: const VerticalPicList(),
    ),
  ));
}

//垂直列表
class VerticalList extends StatelessWidget {
  const VerticalList({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: const <Widget>[
        ListTile(
          title: Text("我是一个标题"),
        ),
        ListTile(
          title: Text("我是一个标题"),
        ),
        ListTile(
          title: Text("我是一个标题"),
        ),
        ListTile(
          title: Text("我是一个标题"),
        ),
        ListTile(
          title: Text("我是一个标题"),
        ),
        ListTile(
          title: Text("我是一个标题"),
        ),
        ListTile(
          title: Text("我是一个标题"),
        ),
      ],
    );
  }
}

//垂直图标列表
class VerticalIconList extends StatelessWidget {
  const VerticalIconList({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: const <Widget>[
        ListTile(
          leading: Icon(Icons.assignment, color: Colors.red),
          title: Text("全部订单"),
        ),
        Divider(),
        ListTile(
          leading: Icon(Icons.payment, color: Colors.green),
          title: Text("待付款"),
        ),
        Divider(),
        ListTile(
          leading: Icon(Icons.local_car_wash, color: Colors.orange),
          title: Text("待收货"),
        ),
        ListTile(
          leading: Icon(Icons.favorite, color: Colors.lightGreen),
          title: Text("我的收藏"),
        ),
        Divider(),
        ListTile(
          leading: Icon(Icons.people, color: Colors.black54),
          title: Text("在线客服"),
        ),
        Divider(),
      ],
    );
  }
}

//垂直图文列表
class VerticalPicList extends StatelessWidget {
  const VerticalPicList({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: <Widget>[
        ListTile(
          leading: Image.asset("images/1.png"),
          title: const Text('华北黄淮高温雨今起强势登场'),
          subtitle: const Text("中国天气网讯 21日开始,华北黄淮高温雨今起强势登场"),
        ),
        const Divider(),
        ListTile(
          leading: Image.asset("images/2.png"),
          title: const Text('保监局50天开32罚单 “断供”违规资金为房市降温'),
          subtitle: const Text(
            "中国天气网讯 保监局50天开32罚单 “断供”违规资金为房市降",
          ),
        ),
        const Divider(),
        ListTile(
            title: const Text('华北黄淮高温雨今起强势登场'),
            subtitle: const Text("中国天气网讯 21日开始,华北黄淮高温雨今起强势登场"),
            trailing: Image.asset("images/3.png")),
        const Divider(),
        ListTile(
          leading: Image.asset("images/4.png"),
          title: const Text('普京现身俄海军节阅兵:乘艇检阅军舰'),
        ),
        const Divider(),
        ListTile(
          leading: Image.asset("images/5.png"),
          title: const Text('鸿星尔克捐1个亿帮助困难残疾群体 网友:企业有担当'),
        ),
        const Divider(),
        ListTile(
          leading: Image.asset("images/6.png"),
          title: const Text('行业冥灯?老罗最好祈祷苹果的AR能成'),
        ),
      ],
    );
  }
}

5.4.2 水平列表 可以左右滑动

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: const Text("你好Flutter")),
      body: const HorizontalList(),
    ),
  ));
}

class HorizontalList extends StatelessWidget {
  const HorizontalList({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 180,
      child: ListView(
        scrollDirection: Axis.horizontal,
        children: <Widget>[
          Container(
            width: 180.0,
            color: Colors.red,
          ),
          Container(
            width: 180.0,
            color: Colors.orange,
            child: Column(
              children: <Widget>[
                Image.asset("images/1.png"),
                const Text('我是一个文本')
              ],
            ),
          ),
          Container(
            width: 180.0,
            color: Colors.blue,
          ),
          Container(
            width: 180.0,
            color: Colors.deepOrange,
          ),
          Container(
            width: 180.0,
            color: Colors.deepPurpleAccent,
          ),
        ],
      ),
    );
  }
}

5.4.3 ListView动态列表组件 以及循环动态数据

import 'package:flutter/material.dart';

//列表数据动态化
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.yellow,
      ),
      home: Scaffold(
        appBar: AppBar(title: const Text("Flutter ICON")),
        body: const MyHomePage(),
      ),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  List<Widget> _initListView() {
    List<Widget> list = [];
    for (var i = 0; i < 100; i++) {
      list.add(const ListTile(
        title: Text("我是一个列表"),
      ));
    }
    return list;
  }

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: _initListView(),
    );
  }
}

class MyHomePage2 extends StatelessWidget {
  List list = [];

  MyHomePage2({Key? key}) : super(key: key) {
    for (var i = 0; i < 10; i++) {
      list.add("我是一个列表--$i");
    }
  }

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
        itemCount: list.length,
        itemBuilder: (context, index) {
          return ListTile(
            title: Text("${list[index]}"),
          );
        });
  }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/381277.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

python自学之《21天学通Python》(17)——第20章 案例1 做一个Windows 上的360工具

Python的语法简洁而清晰&#xff0c;具有丰富和强大的类库及第三方库。它能够很轻松地将各种语言模块联结在一起&#xff0c;所以被称为“胶水”语言。当然&#xff0c;Python也能够方便快捷地编写一些常用的工具程序&#xff0c;而用其他程序设计语言需要编写很复杂的代码来完…

算法训练营 day60 动态规划 回文子串 最长回文子序列

算法训练营 day60 动态规划 回文子串 最长回文子序列 回文子串 647. 回文子串 - 力扣&#xff08;LeetCode&#xff09; 给你一个字符串 s &#xff0c;请你统计并返回这个字符串中 回文子串 的数目。 回文字符串 是正着读和倒过来读一样的字符串。 子字符串 是字符串中的…

DIY-BETAFPV和DIY(ESP-01F+E19-900M20S2模块)915MHz信号测试对比

DIY-BETAFPV和DIY&#xff08;ESP-01FE19-900M20S2模块&#xff09;915MHz信号测试对比1. 前提条件2. 实测效果2.1 起点附近&#xff08;距离3m左右&#xff09;2.2 30m米距离&#xff08;树梢&#xff09;2.3 80米距离3. 整体比较4. PCBA分析4.1 DIY-BETAFPV4.2 DIY&#xff0…

node的多版本控制器,nvm,nvm使用,nvm安装

缘起 拿到新项目&#xff0c;第一步当然是启动项目&#xff0c;对于超大型项目&#xff0c;一个npm install 成功与失败&#xff0c;就是五五开。 原因如下&#xff1a; karma1.7.1: wanted: {"node":"0.10 || 0.12 || 4 || 5 || 6 || 7 || 8"} (curren…

rewrite 复现细节以及相关配置

github链接:https://github.com/kaonashi-tyc/Rewrite 网络的结构框架以及相关参数: 每个卷积层后面是一个批处理归一化层,然后是一个ReLu层,一直到零填充。 正如Erik的博客中提到的,该网络针对预测输出和地面真相之间的像素级MAE(平均绝对误差)最小化,而不是更常用的M…

Spring boot ResponseBodyAdvice接口全局统一返回控制,Api返回值是String 类型时异常

ResponseBodyAdvice简介在大部分前后端分离项目中&#xff0c;后端的返回值基本都需要包装成一个GlobalResponse&#xff0c;其中属性有code、message、data等&#xff0c;来供前端使用。这样就导致大部分Api写完后都需要手动构建一个GlobalResponse对象并填充属性返回&#xf…

如何使用BWASP对Web应用程序进行安全漏洞手工分析

关于BWASP BWASP是一款针对Web应用程序安全的开源工具&#xff0c;在该工具的帮助下&#xff0c;广大研究人员可以通过手工方式对Web应用程序进行漏洞分析。 BWASP工具可以通过对漏洞的分析来给广大研究人员提供预测信息&#xff0c;而无需对目标执行实际的渗透测试。 BWASP…

【STM32】cmsis-dap调试器-OpenOCD功能集成进CubeIDE中

前言 被自己买的Jlink真是要整烦了 一下连不上&#xff0c;一下固件掉升级&#xff0c;一下说是D版不给调试 于是乎决定&#xff0c;我买了个CMSIS-DAP调试器&#xff0c;决定放弃JLink这等#$%^&货… CMSIS-DAP 调试器 这个是开源调试器&#xff0c;硬件软件开源&#x…

Vue项目如何进行部署?是否有遇到部署服务后刷新404问题?

一、如何部署 前后端分离开发模式下&#xff0c;前后端是独立部署的&#xff0c;前端只需要将最后的构建物上传至目标服务器的Web容器指定的的静态目录下即可 我们知道vue项目在构建后&#xff0c;是生成一系列的静态文件 常规布署我们只需要将这个目录上传至目标服务器即可…

【Java】StringBuffer、StringBuilder

1. StringBuffer、StringBuilder、String对比 String&#xff1a;不可变的字符序列&#xff1b;对于增删改效率最低StringBuffer&#xff1a;可变的字符序列&#xff1b;jdk1.0声明&#xff1b;线程安全&#xff08;使用了synchronized同步方法&#xff09;&#xff0c;所以效…

什么是工业物联网(IIoT)?

什么是工业物联网(IIoT)?工业物联网(IIoT) 被定义为一组设备和应用&#xff0c;允许大企业创建从核心到边缘的端到端连接环境。其还包括传统的物理基础设施&#xff0c;如集装箱和物流卡车&#xff0c;以收集数据&#xff0c;对事件做出反应&#xff0c;并在智能设备的帮助下做…

2023中国绿色铝业国际峰会 演讲嘉宾确认

2023中国绿色铝业国际峰会将以“双碳”目标下的铝业发展为主题&#xff0c;结合最佳案例和实践分享&#xff0c;探讨绿色铝业发展路径和最新技术&#xff0c;致力于打造一个绿色可持续的铝行业&#xff0c;助力中国实现“碳中和”目标。 会议时间/地点/主办方 2023年3月23日-…

JavaSE14-面向对象-修饰符

文章目录一、权限修饰符和包1.权限修饰符2.包二、static1.静态成员的调用格式2.注意事项3.static内存图4.使用场景三、final一、权限修饰符和包 1.权限修饰符 使用权限修饰符来控制被修饰的成员&#xff08;如成员变量&#xff09;的使用权限Java中有四种权限修饰符&#xff…

zabbix中的JMX监控、集成告警平台、分布式监控

文章目录前言一、zabbix中的JMX监控二、集成告警平台&#xff1a;zabbix监控结合睿象云报警三、分布式监控1.agent端主动回传数据2.proxy代理前言 一、zabbix中的JMX监控 JMX介绍&#xff1a; Jmx&#xff08;Java Management Extensions&#xff09;java管理拓展 JMX特点&…

linux代码库生成-make示例

1、add.c代码实现加法运算&#xff1a; int add(int a,int b) { return ab; } 2、头文件add.h #ifndef ADD_H #define ADD_H int add(int a,int b); #endif 3、CMakeLists.txt编写 cmake_minimum_required(VERSION 2.6) set(CMAKE_C_FLAGS -m32) project(test_add) include_dir…

OpenMLDB 社区月报 | 2023 年 2 月

导言 OpenMLDB 社区每个月都会发布一版社区月报&#xff0c;总结一个月以来的产品动态、社区活动、内容发布等&#xff0c;让大家对我们社区的发展有更加清晰的了解。如果您对我们的社区有任何建议&#xff0c;欢迎在 GitHub 上提 Issues 或 PR &#xff0c;共同参与社区的建设…

统计学 假设检验

文章目录假设检验假设检验的基本原理提出假设作出决策表述决策结果一个总体参数的检验总体均值的检验总体比例的检验总体方差的检验两个总体参数的检验两个总体均值之差的检验两个总体比例之差的检验两个总体方差比的检验总体分布的检验正态性检验的图示法Shapiro-Wilk 和 K-S …

Vue3 企业级项目实战:通关 Vue3 企业级项目开发,升职加薪快人一步

Vue3 企业级项目实战 - 程序员十三 - 掘金小册Vue3 Element Plus Spring Boot 企业级项目开发&#xff0c;升职加薪&#xff0c;快人一步。。「Vue3 企业级项目实战」由程序员十三撰写&#xff0c;2744人购买https://s.juejin.cn/ds/S2RkR9F/ 课程介绍 很高兴为大家介绍这个…

LeetCode 1326. Minimum Number of Taps to Open to Water a Garden【贪心,桶排序】

本文属于「征服LeetCode」系列文章之一&#xff0c;这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁&#xff0c;本系列将至少持续到刷完所有无锁题之日为止&#xff1b;由于LeetCode还在不断地创建新题&#xff0c;本系列的终止日期可能是永远。在这一系列刷题文章…

路由网络的构建与配置

Part.1 ⑴ 需求分析 在构建的局域网中&#xff0c;通过路由器间配置静态路由&#xff0c;实现PC1和PC2主机直接连通&#xff0c;主机网段不能与路由器直接互联网段通信。 ⑵ 环境要求 配置虚拟网卡的计算机&#xff0c;安装华为eNSP模拟软件。 规划拓扑 Part.2 ⑴ 拓扑描述…