Code collections for MI2S Dart lang study group.

Overview

MI2S Dart Language Study Group

CI

Code collections for MI2S Dart lang study group.

Get started

  • Install flutter (which contains the dart SDK).
  • Clone the repo.
  • Install the dependency.
$ cd dart_practice
$ dart pub get
  • Create your own directory and put your feature code and test code there (test code should end with _test.dart).
  • Write feature and test code.
  • Run the test and make the test pass.
# Make sure you are in the project root directory. (i.e dart_practice/)
$ dart test .
  • Format the code.
$ dart format YOUR_DIR/
  • Push and create a pull request with the issue number.

Writing dart test

For more detail, see Writing dart test.

// Must import dart test library.
import 'package:test/test.dart';
// Import your feature code.
import 'add.dart';

void main() {
  // Test case 1.
  test('Add positive number.', () {
    expect(add(2, 3), 5);
    expect(add(4, 3), 7);
  });

  // Test case 2.
  test('Add negative number.', () {
    expect(add(-2, 3), 1);
    expect(add(-5, -5), -10);
  });
}

Git style

  • Squash all your commits before push.
  • Commit message style: [FEAT] FEATURE_NAME by YOUR_NAME., for example: [FEAT] Quick sort by Eric.

Reading resources

You might also like...

Scan Qr Code Which Will Automatically Add That User To The Visitor List

Scan Qr Code Which Will Automatically Add That User To The Visitor List

GIGO APP Gigo app is a mobile application where shopkeepers have an app that shows QR code and users can scan this QR code which will automatically ad

Dec 30, 2022

Modularising & Organising Flutter Code for beginners

quizzler A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Nov 16, 2021

Flutter Widget Quiz, made for Flutter Create (Source code size is limited to 5KB)

widget_quiz The branch for Flutter Create: https://github.com/mono0926/widget-quiz/tree/5k Getting Started This project is a starting point for a Flut

Oct 14, 2022

This repository contains all the code written throughout the 1ManStartup YouTube tutorials for building a travel budget app using Flutter

This repository contains all the code written throughout the 1ManStartup YouTube tutorials for building a travel budget app using Flutter

Travel Treasury Download The Live App This repository contains all the code written throughout the 1ManStartup YouTube tutorials for building a travel

Dec 27, 2022

Open source code for Bonfire flutter app

Open source code for Bonfire flutter app

Open source code for Bonfire flutter app

Nov 15, 2022

Cryptocurrency App with MVP Design Pattern to track all the coins data in realtime for android & iOS . Written in dart using Flutter SDK.

Cryptocurrency App with MVP Design Pattern to track all the coins data in realtime for android & iOS . Written in dart using Flutter SDK.

Flutter CryptoCurrency App (MVP) Cryptocurrency App with MVP design pattern to track all the coins data in realtime for android & iOS . Written in dar

Dec 30, 2022

Quiz App to conduct online quiz developed with flutter framework and dart language

Quiz App to conduct online quiz developed with flutter framework and dart language

Online Quiz App A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Nov 8, 2022

This is the self learning of mine about Dart Language

This is the self learning of mine about Dart Language

Dart Tutorial These are dart files what iam self studied And I think to share my knowlage with others from sharing this repo as public Still Adding so

Nov 6, 2022

The objective of this tutorial is to learn about asynchronous programming in Dart.

The objective of this tutorial is to learn about asynchronous programming in Dart.

The objective of this tutorial is to learn about asynchronous programming in Dart. We'll look at how to carry out time consuming tasks such as getting device location and networking to get data from the internet.

Oct 5, 2021
Comments
  • Colab: How to test a Flutter app

    Colab: How to test a Flutter app

    我們每開發一個小功能,就可以順便寫這個小功能的測試,藉由慢慢的累積 測試、增加系統的穩定度、對於專案的長遠發展有良好的幫助,我推崇 test driven development ,也就是:把 test 當作 spec,先寫 test 再寫 feature code。

    這次的練習請大家去完成一下這個 colab:How to test a Flutter app

    opened by 8igMac 0
  • Inheritance

    Inheritance

    Requirement

    在物件導向程式設計裡,我們可以用繼承 (inheritance) 來減少重複的代碼(在 Dart 語言裡頭,繼承是用 extends )。

    如果我們對 super class 得實作不滿意,可以在我們想複寫的 method 上加上 @override 以可以客製化我們想要的行為。

    如果你只要 super class 定義好的 method 介面,但所有實作都想自己來,可以把 extends 換成 implements

    mixin 是 Dart 裡頭的另一個功能,因為 Dart 規定 sub class 最多只能繼承一個 super class,所以當我們有很多 class 他們的 super class 都不同,但我們想對這群 class 實作一個共同的行為,我們只能一個一個手動實作。mixin 提供了另一個 選擇,可以根據行為來擴充我們的繼承,而且這些擴充是線性疊加上去的(如果有重複 method 後面的會覆蓋前面的)。

    可以理解一下下面的 code

    class SuperHero {
      String name = '';
      void mySuperPower() {
        print("I'm $name, My super power is ...");
      }
    }
    
    // Regulate this mixin to be used only in `SuperHero`'s
    // subclass. Because we use instance variable `name` that
    // is only define in `SuperHero`.
    mixin Fly on SuperHero {
      void fly() => print('My name is $name, I can fly.');
    }
    
    mixin RaserEyes {
      void raserEyes() => print('I have raser eyes.');
    }
    
    mixin Strength {
      void strength() => print('I have super strength.');
    }
    
    // Pure inheritance.
    class Batman extends SuperHero {
      String name = 'Batman';
    }
    
    // Re`implements` all the method of `SuperHero`.
    class Flash implements SuperHero {
      String name = 'Flash';
    
      // Don't need `@override`.
      void mySuperPower() {
        print("I'm $name. I'm fast.");
      }
    }
    
    class WonderWoman extends SuperHero with Strength {
      String name = 'Wonder Woman';
    
      @override
      void mySuperPower() {
        print("I'm $name, ");
        strength();
      }
    }
    
    class Superman extends SuperHero with Fly, RaserEyes, Strength {
      String name = 'Superman';
    
      @override
      void mySuperPower() {
        fly();
        raserEyes();
        strength();
      }
    }
    
    void main() {
      var batman = Batman();
      var superman = Superman();
      var wonderWoman = WonderWoman();
      var flash = Flash();
    
      batman.mySuperPower();
      superman.mySuperPower();
      wonderWoman.mySuperPower();
      flash.mySuperPower();
    }
    

    輸出

    I'm Batman, My super power is ...
    My name is Superman, I can fly.
    I have raser eyes.
    I have super strength.
    I'm Wonder Woman,
    I have super strength.
    I'm Flash. I'm fast.
    

    發揮你們的創意,在日常生活中找找類似的關係並實作成一個簡單的繼承架構,並練習以下的概念

    • extends
    • @override
    • mixin
    • implements (optional)

    這次不用寫測試。

    Reference

    opened by 8igMac 2
  • Basic OOP

    Basic OOP

    Given the following test. Implement the Person class with:

    • 2 members: name (String), age (int).
    • A constructor that set the name and the age of the person.
    • A getter method isMiddleAge (we call people >= 40 yeas old middle age :smile_cat: )
    • A method tenYearsLater that change the person's age.
    import 'package:test/test.dart';
    import 'person.dart';
    
    void main() {
      test('Person', () {
        var person1 = Person('Bob', 30);
        expect(person1.name, 'Bob');
        expect(person1.age, 30);
        expect(person1.isMiddleAge, false);
        person1.tenYearsLater();
        expect(person1.isMiddleAge, true);
        expect(person1.age, 40);
      });
    }
    
    
    opened by 8igMac 0
  • Implement quick sort.

    Implement quick sort.

    Requirement

    • Implement quick sort that sort the a list of int from small to large.
    • Create your own test (at least 3 test case, you know the reason. :smile: )
    • Hint: Use the built-in type List<int>, but don't use List.sort :sweat_smile: .

    function signiture

    List<int> qsort(List<int> list) {
      // todo
      return list;
    }
    

    test example

    void main() {
      test('Quick sort', () {
        expect(qsort([3, 2, 1]), [1, 2, 3]);
      });
    }
    
    opened by 8igMac 0
Owner
Michael Shih
Michael Shih
🚀 DevQuiz is a project to help people study and test knowledge about the technology studied.

DevQuiz ?? DevQuiz is a project to help people study and test knowledge about the technology studied. Next Level Week # 05 #NLW @Rocketseat In contruc

Wellington Freitas 7 Nov 2, 2022
A flutter application to help you study

Mindrev [WIP] A flutter application to help you study Features Divided into classes, topics, and materials Flashcards Notes Ordered Notes Graphs Mind

ScratchX 4 May 3, 2022
Flutter: QR Code Scanner App Flutter: QR Code Scanner App

Flutter QRCode Scanner APP Show some ❤️ and star the repo to support the project A new Flutter project. Features Scan 2D barcodes Scan QR codes Contro

Pawan Kumar 250 Nov 10, 2022
Flutter Advanced: Background Fetch | Run code in the background Android & iOS | Run code in the background Android & iOS

flutterbackground A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you starte

Pawan Kumar 40 Dec 16, 2022
Firebase + Flutter sample apps with code snippets, supported by comprehensive articles for each implementation.

FlutterFire Samples This repo is created to contain various sample apps demonstrating the integration of Firebase with Flutter. The final goal is to c

Souvik Biswas 186 Dec 24, 2022
Speed Code 2 - 漂亮的饮料食谱 App

?? 饮料食谱 App - 登录 UI - Speed Code ?? 项目介绍 ?? 这是我的第 2 个 Speed Code 视频,通过此项目视频你可以学习到如下 Widget 的基础或进阶用法,更重要的你可以学习到如何将这些 Widget 灵活的组合最终实现上面 ?? 的效果。如果觉得有用可以

Zero 62 Oct 6, 2022
Several live code examples I've shown during my live streams.

Live Code Examples Several live code examples I've shown during my live sessions on Twitch (in french only, sorry...). 001 - Sticky Headers The idea o

Aloïs Deniel 4 Sep 24, 2021
HackerHike IBM Code Challenge EasyLaw

HackerHike IBM Code Challenge EasyLaw

null 5 May 6, 2022
This app I used for my daily practice flutter widget and code from afgprogrammer.

inspiration_app A new Inspiration App Flutter project. design view Code by afgprogrammer. Getting Started This project is a starting point for a Flutt

Arief Syahroni 4 Oct 7, 2021
Chat App Development Front-End and Back-End using Flutter, SocketIo, and NodeJS. (Limited code)

Chat App Development Front-End and Back-End using Flutter, SocketIo, and NodeJS. (Limited code) ( You can buy the full code on $30 (mail me): devstack

Balram Rathore 364 Dec 31, 2022