<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[SooXT]]></title><description><![CDATA[Code my Life]]></description><link>https://sooxt98.space/</link><image><url>https://sooxt98.space/favicon.png</url><title>SooXT</title><link>https://sooxt98.space/</link></image><generator>Ghost 3.37</generator><lastBuildDate>Tue, 19 May 2026 05:06:44 GMT</lastBuildDate><atom:link href="https://sooxt98.space/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[The most codeless way to write Rest API in Flutter (Retrofit + Freezed)]]></title><description><![CDATA[<!--kg-card-begin: markdown--><blockquote>
<p>What you get from here? Reduced code and autocomplete from model</p>
</blockquote>
<p>First, i have an API <a href="https://yourawesomeurl.com/user">https://yourawesomeurl.com/user</a> that returns the following result, so lets make it useable in flutter;</p>
<pre><code class="language-json">{
    &quot;status&quot;: 200,
    &quot;message&quot;: &quot;fetch successfully!&quot;,
    &quot;data&quot;: {
        &quot;name&quot;: &quot;</code></pre>]]></description><link>https://sooxt98.space/the-most-codeless-way-to-write-flutter-api/</link><guid isPermaLink="false">60508fea8f90c303918298ad</guid><dc:creator><![CDATA[Sheldon Soo]]></dc:creator><pubDate>Tue, 16 Mar 2021 11:06:32 GMT</pubDate><media:content url="https://sooxt98.space/content/images/2021/03/retrofit_flutter.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><blockquote>
<img src="https://sooxt98.space/content/images/2021/03/retrofit_flutter.png" alt="The most codeless way to write Rest API in Flutter (Retrofit + Freezed)"><p>What you get from here? Reduced code and autocomplete from model</p>
</blockquote>
<p>First, i have an API <a href="https://yourawesomeurl.com/user">https://yourawesomeurl.com/user</a> that returns the following result, so lets make it useable in flutter;</p>
<pre><code class="language-json">{
    &quot;status&quot;: 200,
    &quot;message&quot;: &quot;fetch successfully!&quot;,
    &quot;data&quot;: {
        &quot;name&quot;: &quot;Sheldon&quot;,
        &quot;age&quot;: 12
    }
}
</code></pre>
<h2 id="settingup">Setting Up</h2>
<pre><code class="language-yaml">dependencies:
  freezed_annotation: ^0.14.1
  retrofit: ^1.3.4+1
  json_annotation: ^4.0.0
  dio: ^4.0.0-beta7
  equatable: ^2.0.0

dev_dependencies:
  build_runner: ^1.11.5
  freezed: ^0.14.1
  json_serializable: ^4.0.2
  retrofit_generator: ^1.4.1+3
</code></pre>
<h2 id="template">Template</h2>
<p>base_response.dart</p>
<pre><code class="language-dart">import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';

part 'base_response.g.dart';

@JsonSerializable(genericArgumentFactories: true)
class BaseResponse&lt;T&gt; extends Equatable {
  final String status;
  final T data;
  final String message;

  const BaseResponse({
    this.status,
    this.data,
    this.message,
  });

  factory BaseResponse.fromJson(
    Map&lt;String, dynamic&gt; json,
    T Function(Object json) fromJsonT,
  ) {
    return _$BaseResponseFromJson&lt;T&gt;(json, fromJsonT);
  }

  Map&lt;String, dynamic&gt; toJson(
    Map&lt;String, dynamic&gt; Function(T value) toJsonT,
  ) {
    return _$BaseResponseToJson&lt;T&gt;(this, toJsonT);
  }

  @override
  List&lt;Object&gt; get props =&gt; [
        status,
        data,
        message,
      ];
}
</code></pre>
<p>user_model.dart</p>
<pre><code class="language-dart">import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:flutter/foundation.dart';

part 'user_model.freezed.dart';
part 'user_model.g.dart';

@freezed
class UserModel with _$UserModel {
  const factory UserModel({required String name, required int age}) =
      _UserModel;

  factory UserModel.fromJson(Object? json) =&gt;
      _$UserModelFromJson(json as Map&lt;String, dynamic&gt;);
}
</code></pre>
<p>api.dart</p>
<pre><code class="language-dart">import 'package:dio/dio.dart';
import 'package:yourawesomeproject/models/user_model.dart';
import 'package:retrofit/retrofit.dart';

import 'api_response.dart';

part 'api.g.dart';

@RestApi(baseUrl: &quot;https://yourawesomeurl.com&quot;)
abstract class RestClient {
  factory RestClient(Dio dio, {String baseUrl}) = _RestClient;

  @GET(&quot;/user&quot;)
  Future&lt;ApiResponse&lt;UserModel&gt;&gt; getUser();
}
</code></pre>
<h2 id="usage">Usage</h2>
<p>Run this command to generate all the codes</p>
<pre><code class="language-console">&gt; flutter pub run build_runner build
</code></pre>
<pre><code class="language-dart">void main() async {
  final dio = Dio();
  
  // Optional: Due to self sign cert issue
  (dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
      (HttpClient client) {
    client.badCertificateCallback =
        (X509Certificate cert, String host, int port) =&gt; true;
    return client;
  };

  final client = RestClient(dio);

  client.getUser().then((it) =&gt; print(it.data!.name));

  runApp(MyApp());
}
</code></pre>
<p>That's it, it will print out <code>Sheldon</code></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Custom flutter material colors]]></title><description><![CDATA[<!--kg-card-begin: markdown--><pre><code class="language-dart">import 'dart:ui';
import 'package:flutter/material.dart';

MaterialColor createMaterialColor(Color color) {
  List strengths = &lt;double&gt;[.05];
  Map&lt;int, Color&gt; swatch = {};
  final int r = color.red, g = color.green, b = color.blue;

  for (int i = 1; i &lt; 10; i++) {
    strengths.add(0.1 * i);
  }
  strengths.forEach(</code></pre>]]></description><link>https://sooxt98.space/custom-flutter-material-colors/</link><guid isPermaLink="false">5fa17a49159ae81545282d27</guid><category><![CDATA[Flutter]]></category><category><![CDATA[Coding]]></category><dc:creator><![CDATA[Sheldon Soo]]></dc:creator><pubDate>Thu, 13 Aug 2020 18:26:07 GMT</pubDate><media:content url="https://sooxt98.space/content/images/2020/08/gradient-design.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><pre><code class="language-dart">import 'dart:ui';
import 'package:flutter/material.dart';

MaterialColor createMaterialColor(Color color) {
  List strengths = &lt;double&gt;[.05];
  Map&lt;int, Color&gt; swatch = {};
  final int r = color.red, g = color.green, b = color.blue;

  for (int i = 1; i &lt; 10; i++) {
    strengths.add(0.1 * i);
  }
  strengths.forEach((strength) {
    final double ds = 0.5 - strength;
    swatch[(strength * 1000).round()] = Color.fromRGBO(
      r + ((ds &lt; 0 ? r : (255 - r)) * ds).round(),
      g + ((ds &lt; 0 ? g : (255 - g)) * ds).round(),
      b + ((ds &lt; 0 ? b : (255 - b)) * ds).round(),
      1,
    );
  });
  return MaterialColor(color.value, swatch);
}
</code></pre>
<!--kg-card-end: markdown--><h2 id="usage">Usage</h2><!--kg-card-begin: markdown--><pre><code class="language-dart">class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: createMaterialColor(Color(0xFF223344)),
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[VR Hackathon (Smart Factory)]]></title><description><![CDATA[<p>The most crowded hackathon I had ever attend. </p><p>Although we did not get into Top3, it was fun. I had learned how to corporate &amp; distribute tasks among my three team members and come up with a working MVP in just two days half. Our project is set up and</p>]]></description><link>https://sooxt98.space/vr-hackathon-smart-factory/</link><guid isPermaLink="false">5fa17a49159ae81545282d26</guid><dc:creator><![CDATA[Sheldon Soo]]></dc:creator><pubDate>Fri, 11 Jan 2019 19:16:18 GMT</pubDate><media:content url="https://sooxt98.space/content/images/2019/01/IMG_7833.JPG" medium="image"/><content:encoded><![CDATA[<img src="https://sooxt98.space/content/images/2019/01/IMG_7833.JPG" alt="VR Hackathon (Smart Factory)"><p>The most crowded hackathon I had ever attend. </p><p>Although we did not get into Top3, it was fun. I had learned how to corporate &amp; distribute tasks among my three team members and come up with a working MVP in just two days half. Our project is set up and display in MMU Centre For Digital. Home.</p><h3 id="pitch-deck">Pitch Deck</h3><!--kg-card-begin: html--><div class="ratio-16-9">
	<iframe class="ratio-inner" src="https://sooxt98.space/uploads/SmartFactoryJamta.pdf#toolbar=0" allowfullscreen></iframe></div><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[ErRUNd]]></title><description><![CDATA[<p>Another FoodPanda clone + community feature.</p><blockquote>This is not my idea. But this is my MVP!</blockquote><p>ErRUNd is an app that provides a platform for people to offer help and request help. Whether you’re a teacher, a student, a stay-at-home mum or an office worker, you can always ask someone</p>]]></description><link>https://sooxt98.space/errund/</link><guid isPermaLink="false">5fa17a49159ae81545282d25</guid><category><![CDATA[Projects]]></category><dc:creator><![CDATA[Sheldon Soo]]></dc:creator><pubDate>Fri, 11 Jan 2019 19:16:12 GMT</pubDate><media:content url="https://sooxt98.space/content/images/2019/01/Screenshot-2019-01-12-at-3.04.20-AM.png" medium="image"/><content:encoded><![CDATA[<img src="https://sooxt98.space/content/images/2019/01/Screenshot-2019-01-12-at-3.04.20-AM.png" alt="ErRUNd"><p>Another FoodPanda clone + community feature.</p><blockquote>This is not my idea. But this is my MVP!</blockquote><p>ErRUNd is an app that provides a platform for people to offer help and request help. Whether you’re a teacher, a student, a stay-at-home mum or an office worker, you can always ask someone to run errands for you, or be the one to help! That means, people switch roles in building up this community. <br><br>We believe that by offering a little help to each other, we can create a better Malaysia, a better place to live in.</p><!--kg-card-begin: html--><a href="https://play.google.com/store/apps/details?id=com.errund" style="box-shadow: none;"><img style="width: 200px;" alt="ErRUNd" src="https://ya-webdesign.com/images/google-play-badge-png-5.png"></a><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[3 Days of Code MMU Hackathon (FaceTendance)]]></title><description><![CDATA[<p>The first hackathon in my campus 😋</p><p>My first hackathon without sleeping. We hack whole day long until the next day morning pitching session.</p><p>Theme of this hackathon: Data, Finance, Education.</p><p>As I mentioned in the title, this is an app for attendance but with face recognition feature. So every lectures</p>]]></description><link>https://sooxt98.space/3-days-of-code-mmu-hackathon/</link><guid isPermaLink="false">5fa17a49159ae81545282d23</guid><dc:creator><![CDATA[Sheldon Soo]]></dc:creator><pubDate>Fri, 11 Jan 2019 19:16:08 GMT</pubDate><media:content url="https://sooxt98.space/content/images/2019/01/3dayss.png" medium="image"/><content:encoded><![CDATA[<img src="https://sooxt98.space/content/images/2019/01/3dayss.png" alt="3 Days of Code MMU Hackathon (FaceTendance)"><p>The first hackathon in my campus 😋</p><p>My first hackathon without sleeping. We hack whole day long until the next day morning pitching session.</p><p>Theme of this hackathon: Data, Finance, Education.</p><p>As I mentioned in the title, this is an app for attendance but with face recognition feature. So every lectures in university can simply take students' attendance without calling their name one by one or need students to sign on a paper everyday.</p><blockquote>Tech: NodeJs, ReactNative, Python</blockquote>]]></content:encoded></item><item><title><![CDATA[RocketMMU]]></title><description><![CDATA[<p>Automatically authenticate campus captive portal in background mode when connects to open wifi in campus.</p><p>The application is created to help students from Multimedia University (MMU) to connect the campus WiFi network without having to manually login their account every time.</p><blockquote>Tech: ReactNative &amp; Java </blockquote><p>There is a background service</p>]]></description><link>https://sooxt98.space/rocketmmu/</link><guid isPermaLink="false">5fa17a49159ae81545282d24</guid><category><![CDATA[Projects]]></category><dc:creator><![CDATA[Sheldon Soo]]></dc:creator><pubDate>Fri, 11 Jan 2019 10:09:19 GMT</pubDate><media:content url="https://sooxt98.space/content/images/2019/01/RocketMMU.png" medium="image"/><content:encoded><![CDATA[<img src="https://sooxt98.space/content/images/2019/01/RocketMMU.png" alt="RocketMMU"><p>Automatically authenticate campus captive portal in background mode when connects to open wifi in campus.</p><p>The application is created to help students from Multimedia University (MMU) to connect the campus WiFi network without having to manually login their account every time.</p><blockquote>Tech: ReactNative &amp; Java </blockquote><p>There is a background service which detects the wifi connection status. And it is written in Java that bridge with ReactNative UI.</p><h3 id="demo-video">Demo Video</h3><figure class="kg-card kg-embed-card"><iframe width="459" height="344" src="https://www.youtube.com/embed/hTdgSM4Vr8k?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></figure><h3 id="link-for-download">Link for download</h3><!--kg-card-begin: html--><a href="https://play.google.com/store/apps/details?id=com.rocketmmu&hl=en&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1" style="box-shadow: none;"><img style="width: 200px;" alt="RocketMMU" src="https://ya-webdesign.com/images/google-play-badge-png-5.png"></a><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[UniSZA-MMU Hackathon (Swipyness)]]></title><description><![CDATA[<p>My very first hackathon (Oct '17) </p><p>I couldn't imagine we did impress the judges and get the 1st prize 🎉🎉🎉 The theme for this hackathon is '<em>Happiness'</em>. So, we planned to design a tinder like App called 'Swipyness'. The app allows users to discover new friends &amp; things by swiping.</p>]]></description><link>https://sooxt98.space/unisza-mmu-hackathon-swipy/</link><guid isPermaLink="false">5fa17a49159ae81545282d22</guid><dc:creator><![CDATA[Sheldon Soo]]></dc:creator><pubDate>Thu, 10 Jan 2019 18:26:25 GMT</pubDate><media:content url="https://sooxt98.space/content/images/2019/01/05ef722f-68c8-4062-9324-18e549164b8e.png" medium="image"/><content:encoded><![CDATA[<img src="https://sooxt98.space/content/images/2019/01/05ef722f-68c8-4062-9324-18e549164b8e.png" alt="UniSZA-MMU Hackathon (Swipyness)"><p>My very first hackathon (Oct '17) </p><p>I couldn't imagine we did impress the judges and get the 1st prize 🎉🎉🎉 The theme for this hackathon is '<em>Happiness'</em>. So, we planned to design a tinder like App called 'Swipyness'. The app allows users to discover new friends &amp; things by swiping. And also can purchase each others artwork.</p><h3 id="prototype">Prototype</h3><p>We use ReactNative to implement the UI/UX.</p><figure class="kg-card kg-embed-card"><iframe width="459" height="344" src="https://www.youtube.com/embed/xnXsj0HhTbo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></figure><h3 id="pitch-deck">Pitch Deck</h3><!--kg-card-begin: html--><div class="ratio-16-9">
	<iframe class="ratio-inner" src="https://prezi.com/view/v29ocNnTa8L3cDnMDjy5/embed" allowfullscreen></iframe></div><!--kg-card-end: html--><h3 id="source-code">Source Code</h3><p><a href="https://github.com/sooxiaotong/Swipyness">https://github.com/sooxiaotong/Swipyness</a></p>]]></content:encoded></item><item><title><![CDATA[Syntax highlighting test]]></title><description><![CDATA[<!--kg-card-begin: markdown--><pre><code class="language-dart">import 'dart:async';

const news = '&lt;gathered news goes here&gt;';
const oneSecond = Duration(seconds: 1);

// Imagine that this function is more complex and slow. :)
Future&lt;String&gt; gatherNewsReports() =&gt;
    Future.delayed(oneSecond, () =&gt; news);

Future&lt;void&gt; printDailyNewsDigest() async {
  var newsDigest = await gatherNewsReports();
  print(newsDigest)</code></pre>]]></description><link>https://sooxt98.space/highlight-test/</link><guid isPermaLink="false">5fa17a49159ae81545282d21</guid><dc:creator><![CDATA[Sheldon Soo]]></dc:creator><pubDate>Thu, 10 Jan 2019 06:14:48 GMT</pubDate><media:content url="https://sooxt98.space/content/images/2019/01/ben-kolde-413790-unsplash.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><pre><code class="language-dart">import 'dart:async';

const news = '&lt;gathered news goes here&gt;';
const oneSecond = Duration(seconds: 1);

// Imagine that this function is more complex and slow. :)
Future&lt;String&gt; gatherNewsReports() =&gt;
    Future.delayed(oneSecond, () =&gt; news);

Future&lt;void&gt; printDailyNewsDigest() async {
  var newsDigest = await gatherNewsReports();
  print(newsDigest);
}

main() {
  printDailyNewsDigest();
}
</code></pre>
<pre><code class="language-css">.test {
    opacity: 0;
}
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>