fibonacci numbers in dart
import 'dart:io';

void main() {
  stdout.write("How many Fibonacci numbers do you want? ");
  int chosenNumber = int.parse(stdin.readLineSync());

  List<int> result = fibonacciNumbers(chosenNumber);
  print(result);
}

// Function to calulcate the Fibonacci numbers
List<int> fibonacciNumbers(int chosenNumber) {
  List<int> fibList = [1, 1];

  for (var i = 0; i < chosenNumber; i++) {
    fibList.add(fibList[i] + fibList[i + 1]);
  }
  return fibList;
}
Source: hackmd.io

Dart相关代码片段

null coalescing shorthand dart

Dart object literal

showmodalbottomsheet shape flutter

dropdown date picker

media query dart

function with return type and parameter in dart

function with return type in dart

empty a list flutter

while loop in dart

for in loop with json or List of Map in dart

for in loop with set in dart

function with parameter in dart

function in dart

do while loop in dart

for loop dart

switch case in dart

if else in dart

dart map with method

dart map example

for in or for each loop in dart

rate us using flutter

flutter hebrew locale

erorr handling in dart

textfield in row flutter issue

flutter material 3 appbar shadow

Flutter Provider best Architecture example

MediaType? contentType in dart dio

navigator.push flutter example

Dart object literal-ish

How to flatten a list in dart

How to change svg icon colors in flutter

how to disable default button splash in flutter

flutter button above keyboard

Make the text editable after press the button

flutter how to insert for loop in column or row

Slide up and down time picker flutter

How to make a text selectable in flutter

How to access the clipboard data in flutter

get os temp dir in flutter

dart override equals

fluter calculate timezone offset

animation text flutter

dart reload local packages

Don't use 'BuildContext's across async gaps.

how to update dart sdk in vscode

add MultipartFile array flutter

clear screen dart

only one decimal dart double

add item to Map to list flutter

flutter appbar scroll color

How to use multiple streams combine in dart

how to convert xfile to file in flutter

which version of opencv is compatible with dart 3

flutter multiline comment

dart interval timer

! and ? in flutter

super keyword in flutter

oh, nice popup

how to save image to gallery in flutter

mobile_scanner flutter blank screen

flutter tabs under scaffold

flutter scroll date picker

Flutter audio extractor screen layout

Error: Dart Entrypoint hasn't been set

text span recognizer flutter

flutter Column

flutter Row

set state vs init state flutter

flutter rating bar

switch expression dart

how to use proxy provider in flutter

how to use boxshadow as elevation in flutter

flutter keyboard covers widgets

snake case in dart

dart add $ sign to in a string

flutter interval timer

add fontfamily to text in flutter

dart sdk path

write dart code to verify email address

how to check keyboard visiblilty in flutter