Flutter學習筆記(20)--FloatingActionButton、PopupMenuButton、SimpleDialog、AlertDialog、SnackBar

来源:https://www.cnblogs.com/upwgh/archive/2019/08/21/11386530.html
-Advertisement-
Play Games

如需轉載,請註明出處:Flutter學習筆記(20)--FloatingActionButton、PopupMenuButton、SimpleDialog、AlertDialog、SnackBar FloatingActionButton FloatingActionButton FloatingA ...


如需轉載,請註明出處:Flutter學習筆記(20)--FloatingActionButton、PopupMenuButton、SimpleDialog、AlertDialog、SnackBar

  • FloatingActionButton

FloatingActionButton對應一個圓形圖標按鈕,懸停在內容之上,以展示對應程式中的主要動作,所以非常醒目,類似於iOS系統里的小白點按鈕。

FloatingActionButton組件屬性及描述如下:

  1. child:child一般為icon,不推薦使用文字
  2. tooltip:按鈕提示文字
  3. foregroundColor:前景色
  4. backgroundColor:背景色
  5. elevation:未點擊時陰影值,預設6.0
  6. hignlightElevation:點擊時陰影值
  7. onPressed:點擊事件回調
  8. shape:定義按鈕的shape,設置shape時,預設的elevation將會失效,預設為CircleBorder
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

void main() => runApp(DemoApp());

class DemoApp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new MaterialApp(
      title: 'FloatingButton Demo',
      debugShowCheckedModeBanner: false,
      home: new Scaffold(
        appBar: AppBar(
          title: new Text('FloatingButton Demo'),
        ),
        drawer: Drawer(
          child: ListView(
            children: <Widget>[
              UserAccountsDrawerHeader(
                  accountName: new Text('FloatingButton Demo'),
                  accountEmail: new Text('www.baidu.com'),
                  currentAccountPicture: new CircleAvatar(
                    backgroundImage: AssetImage('images/user.jpeg'),
                  ),
              ),
              ListTile(
                title: new Text('我是主標題'),
                leading: Icon(Icons.add_circle_outline),
                subtitle: new Text('我是副標題'),
              ),
              ListTile(
                title: new Text('我是主標題'),
                leading: Icon(Icons.add_circle_outline),
                subtitle: new Text('我是副標題'),
              ),
              ListTile(
                title: new Text('我是主標題'),
                leading: Icon(Icons.add_circle_outline),
                subtitle: new Text('我是副標題'),
              ),
              ListTile(
                title: new Text('我是主標題'),
                leading: Icon(Icons.add_circle_outline),
                subtitle: new Text('我是副標題'),
              )
            ],
          ),
        ),
        floatingActionButton: new Builder(builder: (BuildContext context){
          return new FloatingActionButton(
              child: Icon(Icons.album),
              foregroundColor: Colors.amberAccent,
              backgroundColor: Colors.deepPurple,
              elevation: 10.0,
              highlightElevation: 20.0,
              mini: false,
              onPressed: (){
                Scaffold.of(context).showSnackBar(new SnackBar(content: new Text('點擊了FloatingButton')));
              }
          );
        }),
        floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
      ),
    );
  }

}

 

 

  • PopupMenuButton

構造方法:

  const PopupMenuButton({
    Key key,
    @required this.itemBuilder,//item子項,可以為任意類型
    this.initialValue,//初始值
    this.onSelected,//選中其中一項時回調
    this.onCanceled,//點擊空白處,不選擇時回調
    this.tooltip,//提示
    this.elevation = 8.0,//陰影大小
    this.padding = const EdgeInsets.all(8.0),//padding
    this.child,
    this.icon,
    this.offset = Offset.zero,
  }) : assert(itemBuilder != null),
        assert(offset != null),
        assert(!(child != null && icon != null)), // fails if passed both parameters
        super(key: key);

 

demo示例:

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

void main() => runApp(DemoApp());

class DemoApp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new MaterialApp(
      title: 'FloatingButton Demo',
      debugShowCheckedModeBanner: false,
      home: new Scaffold(
        body: new Center(
          child: _showPopupMenuButton(),
        ),
        appBar: AppBar(
          title: new Text('FloatingButton Demo'),
        ),
        drawer: Drawer(
          child: ListView(
            children: <Widget>[
              UserAccountsDrawerHeader(
                  accountName: new Text('FloatingButton Demo'),
                  accountEmail: new Text('www.baidu.com'),
                  currentAccountPicture: new CircleAvatar(
                    backgroundImage: AssetImage('images/user.jpeg'),
                  ),
              ),
              ListTile(
                title: new Text('我是主標題'),
                leading: Icon(Icons.add_circle_outline),
                subtitle: new Text('我是副標題'),
              ),
              ListTile(
                title: new Text('我是主標題'),
                leading: Icon(Icons.add_circle_outline),
                subtitle: new Text('我是副標題'),
              ),
              ListTile(
                title: new Text('我是主標題'),
                leading: Icon(Icons.add_circle_outline),
                subtitle: new Text('我是副標題'),
              ),
              ListTile(
                title: new Text('我是主標題'),
                leading: Icon(Icons.add_circle_outline),
                subtitle: new Text('我是副標題'),
              )
            ],
          ),
        ),
        floatingActionButton: new Builder(builder: (BuildContext context){
          return new FloatingActionButton(
              child: Icon(Icons.album),
              foregroundColor: Colors.amberAccent,
              backgroundColor: Colors.deepPurple,
              elevation: 10.0,
              highlightElevation: 20.0,
              mini: false,
              onPressed: (){
              },
          );
        }),
        floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
      ),
    );
  }

  PopupMenuButton _showPopupMenuButton() {
    return PopupMenuButton(
      icon: Icon(Icons.menu),
        itemBuilder: (BuildContext context) => <PopupMenuEntry>[
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton1"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton2"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton3"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton4"),
            ),
          ),
        ]
    );
  }
}

 

效果截圖:

   

  • SimpleDialog

 

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

void main() => runApp(DemoApp());

class DemoApp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'FloatingButton Demo',
      debugShowCheckedModeBanner: false,
      home: mHomePage(),
    );
  }
}

class mHomePage extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _mHomePage();
  }
}

class _mHomePage extends State {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new Scaffold(
      body: new Center(
        child: _showPopupMenuButton(),
      ),
      appBar: AppBar(
        title: new Text('FloatingButton Demo'),
      ),
      drawer: Drawer(
        child: ListView(
          children: <Widget>[
            UserAccountsDrawerHeader(
              accountName: new Text('FloatingButton Demo'),
              accountEmail: new Text('www.baidu.com'),
              currentAccountPicture: new CircleAvatar(
                backgroundImage: AssetImage('images/user.jpeg'),
              ),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            )
          ],
        ),
      ),
      floatingActionButton: new FloatingActionButton(
        child: Icon(Icons.album),
        foregroundColor: Colors.amberAccent,
        backgroundColor: Colors.deepPurple,
        elevation: 10.0,
        highlightElevation: 20.0,
        mini: false,
        onPressed: (){
            _showSimpleDialog(context);
        },
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
    );
  }

  PopupMenuButton _showPopupMenuButton() {
    return PopupMenuButton(
        icon: Icon(Icons.menu),
        itemBuilder: (BuildContext context) => <PopupMenuEntry>[
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton1"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton2"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton3"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton4"),
            ),
          ),
        ]
    );
  }

  void _showSimpleDialog(BuildContext context) {
    showDialog(
        context: context,
        builder: (BuildContext context){
          return SimpleDialog(
            title: new Text('SimpleDialog Demo'),
            children: <Widget>[
              SimpleDialogOption(
                child: Text('選項1'),
              ),
              SimpleDialogOption(
                child: Text('選項2'),
                onPressed: (){
                  Navigator.pop(context);
                },
              ),
            ],
          );
        }
    );
  }
}

 

效果截圖:

  • AlertDialog

AlertDialog常用屬性:

  const AlertDialog({
    Key key,
    this.title,//對話框頂部提示文案
    this.titlePadding,
    this.titleTextStyle,//對話框頂部提示文案字體樣式
    this.content,//內容部分,對話框的提示內容,通常為文字
    this.contentPadding = const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0),
    this.contentTextStyle,//對話框提示內容的字體樣式
    this.actions,//對話框底部操作按鈕
    this.backgroundColor,//對話框背景色
    this.elevation,
    this.semanticLabel,
    this.shape,
  }) : assert(contentPadding != null),
       super(key: key);

 

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

void main() => runApp(DemoApp());

class DemoApp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'FloatingButton Demo',
      debugShowCheckedModeBanner: false,
      home: mHomePage(),
    );
  }
}

class mHomePage extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _mHomePage();
  }
}

class _mHomePage extends State {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new Scaffold(
      body: new Center(
        child: _showPopupMenuButton(),
      ),
      appBar: AppBar(
        title: new Text('FloatingButton Demo'),
      ),
      drawer: Drawer(
        child: ListView(
          children: <Widget>[
            UserAccountsDrawerHeader(
              accountName: new Text('FloatingButton Demo'),
              accountEmail: new Text('www.baidu.com'),
              currentAccountPicture: new CircleAvatar(
                backgroundImage: AssetImage('images/user.jpeg'),
              ),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            )
          ],
        ),
      ),
      floatingActionButton: new FloatingActionButton(
        child: Icon(Icons.album),
        foregroundColor: Colors.amberAccent,
        backgroundColor: Colors.deepPurple,
        elevation: 10.0,
        highlightElevation: 20.0,
        mini: false,
        onPressed: (){
//            _showSimpleDialog(context);
          _showAlertDialog(context);
        },
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
    );
  }

  PopupMenuButton _showPopupMenuButton() {
    return PopupMenuButton(
        icon: Icon(Icons.menu),
        itemBuilder: (BuildContext context) => <PopupMenuEntry>[
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton1"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton2"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton3"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton4"),
            ),
          ),
        ]
    );
  }

  void _showSimpleDialog(BuildContext context) {
    showDialog(
        context: context,
        builder: (BuildContext context){
          return SimpleDialog(
            title: new Text('SimpleDialog Demo'),
            children: <Widget>[
              SimpleDialogOption(
                child: Text('選項1'),
              ),
              SimpleDialogOption(
                child: Text('選項2'),
                onPressed: (){
                  Navigator.pop(context);
                },
              ),
            ],
          );
        }
    );
  }

  void _showAlertDialog(BuildContext context) {
    showDialog(
      context: context,
      builder: (BuildContext context){
        return AlertDialog(
          title: new Text('提示'),
          content: new Text('這是提示框的內容'),
          actions: <Widget>[
            FlatButton(onPressed: null, child: new Text('確定'),disabledTextColor: Colors.blueAccent,),
            FlatButton(onPressed: null, child: new Text('取消'),disabledColor: Colors.deepPurple,),
          ],
        );
      }
    );
  }
}

 

效果截圖:

  • SnackBar

SnackBar是一個輕量級消息提示組件,在屏幕的底部顯示,SnackBar常用屬性如下:

  const SnackBar({
    Key key,
    @required this.content,//提示內容
    this.backgroundColor,//背景色
    this.action,
    this.duration = _kSnackBarDisplayDuration,//提示時常
    this.animation,//彈出動畫
  }) : assert(content != null),
       assert(duration != null),
       super(key: key);

 

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

void main() => runApp(DemoApp());

class DemoApp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'FloatingButton Demo',
      debugShowCheckedModeBanner: false,
      home: mHomePage(),
    );
  }
}

class mHomePage extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _mHomePage();
  }
}

class _mHomePage extends State {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new Scaffold(
      body: new Center(
        child: _showPopupMenuButton(),
      ),
      appBar: AppBar(
        title: new Text('FloatingButton Demo'),
        actions: <Widget>[
          IconButton(icon: Icon(Icons.search), onPressed: (){
            Scaffold.of(context).showSnackBar(new SnackBar(content: new Text('SnackBar')));
          })
        ],
      ),
      drawer: Drawer(
        child: ListView(
          children: <Widget>[
            UserAccountsDrawerHeader(
              accountName: new Text('FloatingButton Demo'),
              accountEmail: new Text('www.baidu.com'),
              currentAccountPicture: new CircleAvatar(
                backgroundImage: AssetImage('images/user.jpeg'),
              ),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            ),
            ListTile(
              title: new Text('我是主標題'),
              leading: Icon(Icons.add_circle_outline),
              subtitle: new Text('我是副標題'),
            )
          ],
        ),
      ),
      floatingActionButton: new FloatingActionButton(
        child: Icon(Icons.album),
        foregroundColor: Colors.amberAccent,
        backgroundColor: Colors.deepPurple,
        elevation: 10.0,
        highlightElevation: 20.0,
        mini: false,
        onPressed: (){
//            _showSimpleDialog(context);
          _showAlertDialog(context);
        },
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
    );
  }

  PopupMenuButton _showPopupMenuButton() {
    return PopupMenuButton(
        icon: Icon(Icons.menu),
        itemBuilder: (BuildContext context) => <PopupMenuEntry>[
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton1"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton2"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton3"),
            ),
          ),
          const PopupMenuItem(
            child: ListTile(
              leading: Icon(Icons.add_circle_outline),
              title: Text("popupMenuButton4"),
            ),
          ),
        ]
    );
  }

  void _showSimpleDialog(BuildContext context) {
    showDialog(
        context: context,
        builder: (BuildContext context){
          return SimpleDialog(
            title: new Text('SimpleDialog Demo'),
            children: <Widget>[
              SimpleDialogOption(
                child: Text('選項1'),
              ),
              SimpleDialogOption(
                child: Text('選項2'),
                onPressed: (){
                  Navigator.pop(context);
                },
              ),
            ],
          );
        }
    );
  }

  void _showAlertDialog(BuildContext context) {
    showDialog(
      context: context,
      builder: (BuildContext context){
        return AlertDialog(
          title: new Text('提示'),
          content: new Text('這是提示框的內容'),
          actions: <Widget>[
            FlatButton(onPressed: null, child: new Text('確定'),disabledTextColor: Colors.blueAccent,),
            FlatButton(
              onPressed: (){
                Navigator.pop(context);
                Scaffold.of(context).showSnackBar(new SnackBar(content: new Text('SnackBar')));
              },
              child: new Text('取消'),disabledColor: Colors.deepPurple,),
          ],
          backgroundColor: Colors.amberAccent,
        );
      }
    );
  }
}

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 小馬哥博客:https://www.cnblogs.com/majj/p/9179218.html 一、創建用戶 1.root用戶(管理員)登錄,進入mysql資料庫 2.創建用戶 3.為用戶授權 4.用戶登錄 ...
  • 重啟RAC時發現32004,後來才發現DG已經不存在了standby_archive_dest還在生效中,而background_dump_dest和user_dump_dest並沒在pfile中出現,最後註釋了standby_archive_destOK了糾結了一段時間,遇到問題多嘗試一下是必要的 ...
  • 下載 https://dev.mysql.com/downloads/mysql/5.7.html#downloads 參考鏈接 https://blog.csdn.net/qq_41307443/article/details/79839558 https://blog.csdn.net/wu_j ...
  • 1.數字註入 2.字元串註入 3. #後邊全部為註釋,字元串拼裝後繞過密碼驗證。 4. 同樣繞過密碼驗證 ...
  • 1.sql註入是怎麼產生的 2.如何尋找sql註入漏洞 在地址欄輸入單雙引號造成sql執行異常(get) post請求,在標題後輸入單引號,造成sql執行異常。 ...
  • 1.什麼是sql註入 sql註入是一種將sql代碼添加到輸入參數中,傳遞到sql伺服器解析並執行的一種攻擊手法。 2.正常行為,比如拿到id獲取文章的內容(案例) 3. 在瀏覽器中人為加入參數 or 1=1(永遠為真);這就產生了意想之外的行為,人為的獲取了整張表的內容,達到了攻擊的目的。 輸入參數 ...
  • 轉自: http://www.maomao365.com/?p=9336 摘要: 下文講述mssql中時間戳和時間格式的轉換方法,如下所示: 實驗環境:sql server 2008 R2 時間戳簡介:時間戳是linux下一種表示時間的方式。 時間戳是從 從格林威治時間1970年01月01日00時0 ...
  • 在Windows伺服器上確認伺服器和mysql都是正常運行,但就是連接不上。搜了一下別人的解決方案, 參考這篇https://blog.csdn.net/langren697/article/details/38422055的說法,問題就出在動態連接數上。給出的解決方案是在註冊表自定義最大連接數: ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...