上一页 1 ··· 60 61 62 63 64 65 66 67 68 ··· 186 下一页
摘要: 一,代码: tabbar: import 'package:flutter/material.dart'; import '../tabpages/MyHomePage.dart'; import '../tabpages/ProfilePage.dart'; class MyTabBar exte 阅读全文
posted @ 2025-03-22 10:31 刘宏缔的架构森林 阅读(188) 评论(0) 推荐(0)
摘要: 一,代码: tabbar页面: import 'package:flutter/material.dart'; import '../tabpages/MyHomePage.dart'; import '../tabpages/ProfilePage.dart'; class MyTabBar ex 阅读全文
posted @ 2025-03-22 10:31 刘宏缔的架构森林 阅读(97) 评论(0) 推荐(0)
摘要: 一,代码: import 'package:flutter/material.dart'; class HomePage extends StatefulWidget { @override State<HomePage> createState() => _HomePageState(); } c 阅读全文
posted @ 2025-03-22 10:31 刘宏缔的架构森林 阅读(125) 评论(0) 推荐(0)
摘要: 一,代码: main.dart import 'package:flutter/material.dart'; import 'pages/HomePage.dart'; import 'pages/DetailPage.dart'; void main() { //const runApp(MyA 阅读全文
posted @ 2025-03-22 10:31 刘宏缔的架构森林 阅读(26) 评论(0) 推荐(0)
摘要: 一,下载: 官网: https://flutter.dev/ 下载页面: https://docs.flutter.dev/get-started/install/macos/mobile-android 如图: 选择对应自己电脑cpu的版本下载 二,下载完成后安装 1,解压后移动到相应的目录下 2 阅读全文
posted @ 2025-03-22 10:31 刘宏缔的架构森林 阅读(299) 评论(0) 推荐(0)
摘要: 一,执行顺序: 先进后出,类似于栈的特性 1,代码: func deferAndPanic() { defer func() { fmt.Println("defer1") }() defer func() { fmt.Println("defer2") }() defer func() { fmt 阅读全文
posted @ 2025-03-15 15:15 刘宏缔的架构森林 阅读(33) 评论(0) 推荐(0)
摘要: 一,如果直接用header("Location")会无效 代码: header('Location: https://baidu.com'); return false; 无效: 页面不会跳转 二,解决方法: 代码:在controller中 return redirect('https://baid 阅读全文
posted @ 2025-03-15 15:14 刘宏缔的架构森林 阅读(82) 评论(1) 推荐(1)
摘要: 一,代码: // 入口函数 func main() { lock:=sync.Mutex{} go func() { lock.Lock() defer lock.Unlock() for i:=1; i<=5; i++ { time.Sleep(time.Millisecond) fmt.Prin 阅读全文
posted @ 2025-03-09 15:10 刘宏缔的架构森林 阅读(31) 评论(0) 推荐(0)
摘要: 一,代码: //实现单例的数据结构 type SingleObject struct { } //最终获得的单例对象 var instance *SingleObject //变量one是一个sync.Once的实例 var one sync.Once //方法:得到单例对象 func getIns 阅读全文
posted @ 2025-03-09 13:46 刘宏缔的架构森林 阅读(72) 评论(0) 推荐(0)
摘要: 一,代码: // 入口函数 func main() { //无缓冲的channel ch:=make(chan int) go func() { //<-ch for i:=1; i<=5; i++ { time.Sleep(time.Millisecond) fmt.Println(i) } ch 阅读全文
posted @ 2025-03-09 13:21 刘宏缔的架构森林 阅读(36) 评论(0) 推荐(0)
上一页 1 ··· 60 61 62 63 64 65 66 67 68 ··· 186 下一页