上一页 1 ··· 88 89 90 91 92 93 94 95 96 ··· 214 下一页
摘要: 一,代码: tabbar: import 'package:flutter/material.dart'; import '../tabpages/MyHomePage.dart'; import '../tabpages/ProfilePage.dart'; class MyTabBar exte 阅读全文
posted @ 2025-03-22 10:31 刘宏缔的架构森林 阅读(228) 评论(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 刘宏缔的架构森林 阅读(117) 评论(0) 推荐(0)
摘要: 一,代码: import 'package:flutter/material.dart'; class HomePage extends StatefulWidget { @override State<HomePage> createState() => _HomePageState(); } c 阅读全文
posted @ 2025-03-22 10:31 刘宏缔的架构森林 阅读(152) 评论(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 刘宏缔的架构森林 阅读(36) 评论(0) 推荐(0)
摘要: 一,下载: 官网: https://flutter.dev/ 下载页面: https://docs.flutter.dev/get-started/install/macos/mobile-android 如图: 选择对应自己电脑cpu的版本下载 二,下载完成后安装 1,解压后移动到相应的目录下 2 阅读全文
posted @ 2025-03-22 10:31 刘宏缔的架构森林 阅读(351) 评论(0) 推荐(0)
摘要: 一,执行顺序: 先进后出,类似于栈的特性 1,代码: func deferAndPanic() { defer func() { fmt.Println("defer1") }() defer func() { fmt.Println("defer2") }() defer func() { fmt 阅读全文
posted @ 2025-03-15 15:15 刘宏缔的架构森林 阅读(48) 评论(0) 推荐(0)
摘要: 一,如果直接用header("Location")会无效 代码: header('Location: https://baidu.com'); return false; 无效: 页面不会跳转 二,解决方法: 代码:在controller中 return redirect('https://baid 阅读全文
posted @ 2025-03-15 15:14 刘宏缔的架构森林 阅读(110) 评论(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 刘宏缔的架构森林 阅读(42) 评论(0) 推荐(0)
摘要: 一,代码: //实现单例的数据结构 type SingleObject struct { } //最终获得的单例对象 var instance *SingleObject //变量one是一个sync.Once的实例 var one sync.Once //方法:得到单例对象 func getIns 阅读全文
posted @ 2025-03-09 13:46 刘宏缔的架构森林 阅读(90) 评论(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 刘宏缔的架构森林 阅读(50) 评论(0) 推荐(0)
上一页 1 ··· 88 89 90 91 92 93 94 95 96 ··· 214 下一页