發表文章

目前顯示的是 4月, 2021的文章

寫APP,然後感到心累...

圖片
三件煩事:   1.因為在學習Flutter導致整個研發速度停滯 最近寫APP改用Flutter. 寫了一個多月了,還是在基礎的元件的使用,拖累了我整個研發速度. 而且flutter在一開始app在載入時會有0.5秒到1秒的效能delay, 跟原先使用native android or ios swift速度比起來可以隨意發揮的速度比起來,對目前狀況感到很灰心. 2.創業基地內人際關係的壓力 陌生人的談話的影響.今天中午時來到這,空間內遇到兩個人,一個是天蠍座的,一個是剛進來的陌生人. 他們正聊得正開心,他們看我一進來,就馬上停止了對話,還馬上離開這. 獨留下我一人. 這情境給我感覺很不好,好像我是有毒的人一樣,見到我就趨之若鶩逃走. 其實這位天蠍座的創業家也不是第一次這樣對我, 常有人當我面跟我說,這天蠍座的人常常背後說我壞話. 並提醒我要小心他. 然後這件事就搞得我心好累,其實我跟那人根本沒講過幾句話,為何要這樣對我呢?  也許有旁人在他們不方便說,所以這樣做,馬上結束對話然後離開,但他們的態度轉變實在太大.... 心情就這樣被陌生人影響...真是不值得. 嘆氣~其實寫app才是我最急迫要做的事,心累... 各位程式設計師朋友們, 其實我們不用害怕,這種事在職場上常常發生, 這些路人甲乙丙不是我們的老闆,也沒付我們一毛錢,實在沒必要因為他們的一舉一動就影響了我們的心情. 深呼吸一下,好好繼續寫程式吧.... 3.Android 11 中onedrive的「清理空間」功能無法工作   問題: 使用 Android 11 版 OneDrive App 的客戶無法使用「清理您裝置上的空間」功能。 已上傳的檔案不會從行動裝置中移除。 因應措施  檔案上傳至 OneDrive 後,就可以從裝置手動刪除。 檢查 您的 OneDrive 相片 或其他檔案資料夾,以確保已上傳最新的圖片或檔案。 從行動裝置中刪除它們。   OneDrive 實在很好用,比 google

Flutter: Future delay, async + await

第一種: future 當delay用" code 1: Future<String> future = Future.delayed(     Duration(seconds: 5),     () => "Latest News",   );   future.then((news) {     print(news);   }); result: (after 5 sec) Latest News   -----    Future<void> asyncAwait() async{     print('Started');     try{       await Future.delayed(Duration(seconds: 5));       print('Completed first');       await Future.delayed(Duration(seconds: 1));       print('Completed second');     }catch(e){       print('failed: ${e.toString()}');     }   }    asyncAwait();     Result: Started (after 5 sec)  Completed first (after 1 sec)  Completed second       ----- 簡單講, dart 的 future 就有點像是android中的handler post delay. void _do_something1 () { /// 買披薩 Future < void > getPizza () { return Future . delayed ( Duration ( seconds: 5 ) , () => print ( 'Bacon Pizza' )) ; } getPizza () ; print ( 'Baking~' ) ; }  向上圖程式碼: output Baking~ (after

Flutter: infinite list example

圖片
這是一個flutter infinite list example:  https://github.com/flutter/samples/tree/master/infinite_list 看不太懂,目前還在研究中... void main () { runApp ( MyApp ()) ; } class MyApp extends StatelessWidget { @override Widget build ( BuildContext context ) { return ChangeNotifierProvider < Catalog >( create: ( context ) => Catalog () , child: MaterialApp ( title: 'Infinite List Sample' , home: MyHomePage () , ) , ) ; } } class MyHomePage extends StatelessWidget { @override Widget build ( BuildContext context ) { return Scaffold ( appBar: AppBar ( title: Text ( 'Infinite List Sample' ) , ) , body: Selector < Catalog, int? >( // Selector is a widget from package:provider. It allows us to listen // to only one aspect of a provided value. In this case, we are only // listening to the catalog's `itemCount`, because that's all we need // at this level.