{"id":87972,"date":"2025-03-25T11:57:42","date_gmt":"2025-03-25T04:57:42","guid":{"rendered":"https:\/\/itviecblog.uptech.vn\/?p=85066"},"modified":"2025-06-17T15:20:49","modified_gmt":"2025-06-17T08:20:49","slug":"xay-dung-mobile-app-voi-dart-flutter","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/","title":{"rendered":"Dart Flutter l\u00e0 g\u00ec: C\u00e1ch x\u00e2y d\u1ef1ng mobile app v\u1edbi Dart trong Flutter"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#Tong_quan_ve_moi_quan_he_Dart_Flutter\" >T\u1ed5ng quan v\u1ec1 m\u1ed1i quan h\u1ec7 Dart Flutter<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#3_buoc_bat_dau_voi_Dart_trong_Flutter\" >3 b\u01b0\u1edbc b\u1eaft \u0111\u1ea7u v\u1edbi Dart trong Flutter\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#Cac_tinh_nang_co_ban_cua_Dart_trong_Flutter\" >C\u00e1c t\u00ednh n\u0103ng c\u01a1 b\u1ea3n c\u1ee7a Dart trong Flutter<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#Cac_tinh_nang_nang_cao_cua_Dart_trong_Flutter\" >C\u00e1c t\u00ednh n\u0103ng n\u00e2ng cao c\u1ee7a Dart trong Flutter\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#Cac_cau_hoi_thuong_gap_ve_Dart_Flutter\" >C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Dart Flutter<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#Tong_ket\" >T\u1ed5ng k\u1ebft\u00a0<\/a><\/li><\/ul><\/nav><\/div>\n<p><em><strong>Dart l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh ch\u00ednh \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong Flutter &#8211; m\u1ed9t framework ph\u1ed5 bi\u1ebfn \u0111\u1ec3 ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng \u0111a n\u1ec1n t\u1ea3ng. V\u1edbi c\u00fa ph\u00e1p hi\u1ec7n \u0111\u1ea1i, linh ho\u1ea1t v\u00e0 hi\u1ec7u su\u1ea5t cao, Dart cung c\u1ea5p n\u1ec1n t\u1ea3ng v\u1eefng ch\u1eafc \u0111\u1ec3 x\u00e2y d\u1ef1ng c\u00e1c \u1ee9ng d\u1ee5ng c\u00f3 giao di\u1ec7n \u0111\u1eb9p, hi\u1ec7u n\u0103ng m\u01b0\u1ee3t m\u00e0 v\u00e0 kh\u1ea3 n\u0103ng m\u1edf r\u1ed9ng cao. B\u00e0i vi\u1ebft n\u00e0y s\u1ebd gi\u1edbi thi\u1ec7u t\u1ed5ng quan v\u1ec1 vai tr\u00f2 c\u1ee7a Dart trong Flutter, c\u00e1c t\u00ednh n\u0103ng n\u1ed5i b\u1eadt v\u00e0 l\u00fd do v\u00ec sao Dart Flutter l\u1ea1i l\u00e0 &#8220;c\u1eb7p b\u00e0i tr\u00f9ng&#8221; l\u00fd t\u01b0\u1edfng cho vi\u1ec7c ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng.<\/strong><\/em><\/p>\n<p>\u0110\u1ecdc b\u00e0i vi\u1ebft n\u00e0y \u0111\u1ec3 hi\u1ec3u th\u00eam v\u1ec1:<\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1ed5ng quan m\u1ed1i quan h\u1ec7 Dart Flutter<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">B\u1eaft \u0111\u1ea7u v\u1edbi Dart trong Flutter<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ki\u1ebfn th\u1ee9c c\u01a1 b\u1ea3n v\u1ec1 Dart cho l\u1eadp tr\u00ecnh vi\u00ean Flutter<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00e1ch Dart ho\u1ea1t \u0111\u1ed9ng trong Flutter<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00e1c t\u00ednh n\u00e2ng cao<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Tong_quan_ve_moi_quan_he_Dart_Flutter\"><\/span><b>T\u1ed5ng quan v\u1ec1 m\u1ed1i quan h\u1ec7 Dart Flutter<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"\/blog\/dart-la-gi\/\" target=\"_blank\" rel=\"noopener\"><b>Dart<\/b><\/a><span style=\"font-weight: 400;\"> l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh h\u01b0\u1edbng \u0111\u1ed1i t\u01b0\u1ee3ng, \u0111\u01b0\u1ee3c ph\u00e1t tri\u1ec3n b\u1edfi Google, v\u1edbi m\u1ee5c ti\u00eau t\u1ea1o ra c\u00e1c \u1ee9ng d\u1ee5ng \u0111a n\u1ec1n t\u1ea3ng c\u00f3 hi\u1ec7u su\u1ea5t cao. Dart h\u1ed7 tr\u1ee3 l\u1eadp tr\u00ecnh b\u1ea5t \u0111\u1ed3ng b\u1ed9, bi\u00ean d\u1ecbch nhanh v\u00e0 cung c\u1ea5p nhi\u1ec1u t\u00ednh n\u0103ng hi\u1ec7n \u0111\u1ea1i nh\u01b0 ki\u1ec3u d\u1eef li\u1ec7u t\u01b0\u1eddng minh (explicit), mixin, v\u00e0 l\u1eadp tr\u00ecnh h\u00e0m (functional programming).<\/span><\/p>\n<p><a href=\"\/blog\/flutter-la-gi\/\" target=\"_blank\" rel=\"noopener\"><b>Flutter<\/b><\/a><span style=\"font-weight: 400;\"> l\u00e0 framework m\u00e3 ngu\u1ed3n m\u1edf do Google ph\u00e1t tri\u1ec3n, cho ph\u00e9p l\u1eadp tr\u00ecnh vi\u00ean t\u1ea1o c\u00e1c \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng, web v\u00e0 desktop ch\u1ec9 v\u1edbi m\u1ed9t codebase duy nh\u1ea5t.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Trong h\u1ec7 sinh th\u00e1i Flutter, Dart l\u00e0 ng\u00f4n ng\u1eef duy nh\u1ea5t \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 vi\u1ebft m\u00e3 \u1ee9ng d\u1ee5ng. Flutter \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng ho\u00e0n to\u00e0n d\u1ef1a tr\u00ean Dart, t\u1eeb c\u00e1c widget giao di\u1ec7n ng\u01b0\u1eddi d\u00f9ng cho \u0111\u1ebfn c\u00e1c logic x\u1eed l\u00fd b\u00ean trong. Ng\u00f4n ng\u1eef Dart gi\u00fap Flutter:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Bi\u00ean d\u1ecbch m\u00e3 ngu\u1ed3n th\u00e0nh m\u00e3 m\u00e1y g\u1ed1c (native) \u0111\u1ec3 t\u0103ng hi\u1ec7u su\u1ea5t.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">H\u1ed7 tr\u1ee3 hot reload, cho ph\u00e9p thay \u0111\u1ed5i giao di\u1ec7n v\u00e0 logic \u1ee9ng d\u1ee5ng m\u00e0 kh\u00f4ng c\u1ea7n kh\u1edfi \u0111\u1ed9ng l\u1ea1i.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Cung c\u1ea5p kh\u1ea3 n\u0103ng l\u1eadp tr\u00ecnh b\u1ea5t \u0111\u1ed3ng b\u1ed9 (async\/await) gi\u00fap x\u1eed l\u00fd c\u00e1c t\u00e1c v\u1ee5 n\u1ec1n nh\u01b0 g\u1ecdi API ho\u1eb7c \u0111\u1ecdc\/ghi d\u1eef li\u1ec7u.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Nh\u1edd s\u1ef1 t\u00edch h\u1ee3p ch\u1eb7t ch\u1ebd n\u00e0y, Dart gi\u00fap c\u00e1c \u1ee9ng d\u1ee5ng Flutter ho\u1ea1t \u0111\u1ed9ng m\u01b0\u1ee3t m\u00e0, c\u00f3 kh\u1ea3 n\u0103ng m\u1edf r\u1ed9ng v\u00e0 b\u1ea3o tr\u00ec d\u1ec5 d\u00e0ng.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_buoc_bat_dau_voi_Dart_trong_Flutter\"><\/span><b>3 b\u01b0\u1edbc b\u1eaft \u0111\u1ea7u v\u1edbi Dart trong Flutter\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">\u0110\u1ea7u ti\u00ean, l\u1eadp tr\u00ecnh vi\u00ean Flutter c\u1ea7n c\u00f3 ki\u1ebfn th\u1ee9c c\u01a1 b\u1ea3n v\u1ec1 Dart. B\u1ea1n c\u00f3 th\u1ec3 t\u00ecm hi\u1ec3u th\u00eam v\u1ec1 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh n\u00e0y t\u1ea1i b\u00e0i vi\u1ebft: <\/span><span style=\"font-weight: 400;\">Dart l\u00e0 g\u00ec? C\u00fa ph\u00e1p, \u0110\u1eb7c \u0111i\u1ec3m, \u1ee8ng d\u1ee5ng th\u1ef1c t\u1ebf c\u1ee7a Dart\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Sau \u0111\u00f3, h\u00e3y \u0111\u1ecdc h\u01b0\u1edbng d\u1eabn d\u01b0\u1edbi \u0111\u00e2y \u0111\u1ec3 b\u1eaft \u0111\u1ea7u v\u1edbi Dart trong Flutter, t\u1eeb vi\u1ec7c c\u00e0i \u0111\u1eb7t m\u00f4i tr\u01b0\u1eddng \u0111\u1ebfn vi\u1ebft ch\u01b0\u01a1ng tr\u00ecnh \u0111\u01a1n gi\u1ea3n \u0111\u1ea7u ti\u00ean.<\/span><\/p>\n<h3><b>C\u00e0i \u0111\u1eb7t Flutter<\/b><\/h3>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Truy c\u1eadp trang web ch\u00ednh th\u1ee9c c\u1ee7a <\/span><a href=\"https:\/\/flutter.dev\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Flutter<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1ea3i xu\u1ed1ng phi\u00ean b\u1ea3n ph\u00f9 h\u1ee3p v\u1edbi h\u1ec7 \u0111i\u1ec1u h\u00e0nh c\u1ee7a b\u1ea1n (Windows, macOS, ho\u1eb7c Linux).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Gi\u1ea3i n\u00e9n t\u1ec7p v\u00e0 th\u00eam \u0111\u01b0\u1eddng d\u1eabn th\u01b0 m\u1ee5c flutter\/bin v\u00e0o bi\u1ebfn m\u00f4i tr\u01b0\u1eddng PATH.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">M\u1edf terminal v\u00e0 ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 ki\u1ec3m tra m\u00f4i tr\u01b0\u1eddng \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh \u0111\u1ea7y \u0111\u1ee7:<\/span><\/li>\n<\/ol>\n<pre><span style=\"font-weight: 400;\">Flutter Doctor<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">N\u1ebfu c\u00f3 th\u00e0nh ph\u1ea7n n\u00e0o c\u00f2n thi\u1ebfu, c\u00f4ng c\u1ee5 s\u1ebd h\u01b0\u1edbng d\u1eabn b\u1ea1n c\u00e0i \u0111\u1eb7t.<\/span><\/p>\n<h3><b>T\u1ea1o d\u1ef1 \u00e1n Flutter m\u1edbi<\/b><\/h3>\n<pre><span style=\"font-weight: 400;\">flutter\u00a0 create my_flutter_app<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y s\u1ebd t\u1ef1 \u0111\u1ed9ng t\u1ea1o ra m\u1ed9t c\u1ea5u tr\u00fac d\u1ef1 \u00e1n v\u1edbi c\u00e1c t\u1ec7p v\u00e0 th\u01b0 m\u1ee5c c\u1ea7n thi\u1ebft.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">M\u1ed9t d\u1ef1 \u00e1n Flutter c\u01a1 b\u1ea3n c\u00f3 c\u1ea5u tr\u00fac th\u01b0 m\u1ee5c nh\u01b0 sau:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>lib\/<\/b><span style=\"font-weight: 400;\">: Ch\u1ee9a m\u00e3 ngu\u1ed3n ch\u00ednh c\u1ee7a \u1ee9ng d\u1ee5ng (th\u01b0\u1eddng l\u00e0 t\u1ec7p <\/span><span style=\"font-weight: 400;\">main.dart<\/span><span style=\"font-weight: 400;\">).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>android\/<\/b><span style=\"font-weight: 400;\">: M\u00e3 ngu\u1ed3n d\u00e0nh cho n\u1ec1n t\u1ea3ng Android.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>ios\/<\/b><span style=\"font-weight: 400;\">: M\u00e3 ngu\u1ed3n d\u00e0nh cho n\u1ec1n t\u1ea3ng iOS.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>test\/<\/b><span style=\"font-weight: 400;\">: Ch\u1ee9a c\u00e1c b\u00e0i ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb (unit test).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>pubspec.yaml<\/b><span style=\"font-weight: 400;\">: T\u1ec7p c\u1ea5u h\u00ecnh c\u00e1c th\u01b0 vi\u1ec7n v\u00e0 t\u00e0i nguy\u00ean.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>README.md<\/b><span style=\"font-weight: 400;\">: M\u00f4 t\u1ea3 th\u00f4ng tin d\u1ef1 \u00e1n.<\/span><\/li>\n<\/ul>\n<h3><b>Vi\u1ebft ch\u01b0\u01a1ng tr\u00ecnh &#8220;Hello, Flutter&#8221; v\u1edbi Dart<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">B\u00e2y gi\u1edd, h\u00e3y th\u1eed vi\u1ebft m\u1ed9t \u1ee9ng d\u1ee5ng \u0111\u01a1n gi\u1ea3n hi\u1ec3n th\u1ecb d\u00f2ng ch\u1eef <\/span><b>&#8220;Hello, Flutter&#8221;<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">M\u1edf t\u1ec7p <\/span><span style=\"font-weight: 400;\">lib\/main.dart<\/span><span style=\"font-weight: 400;\"> v\u00e0 vi\u1ebft \u0111o\u1ea1n m\u00e3 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">import 'package:flutter\/material.dart';<\/span>\n\n<span style=\"font-weight: 400;\">void main() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0runApp(MyApp());<\/span>\n<span style=\"font-weight: 400;\">}<\/span>\n\n<span style=\"font-weight: 400;\">class MyApp extends StatelessWidget {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0@override<\/span>\n<span style=\"font-weight: 400;\"> \u00a0Widget build(BuildContext context) {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0return MaterialApp(<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0home: Scaffold(<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0appBar: AppBar(<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0title: Text('Hello, Flutter'),<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0),<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0body: Center(<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0child: Text('Hello, Flutter', style: TextStyle(fontSize: 24)),<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0),<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0),<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0);<\/span>\n<span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Ch\u1ea1y \u1ee9ng d\u1ee5ng b\u1eb1ng l\u1ec7nh sau trong terminal:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">flutter run\u00a0<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">N\u1ebfu c\u1ea5u h\u00ecnh m\u00f4i tr\u01b0\u1eddng ch\u00ednh x\u00e1c, b\u1ea1n s\u1ebd th\u1ea5y d\u00f2ng ch\u1eef <\/span><b>&#8220;Hello, Flutter&#8221;<\/b><span style=\"font-weight: 400;\"> hi\u1ec3n th\u1ecb tr\u00ean giao di\u1ec7n \u1ee9ng d\u1ee5ng.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cac_tinh_nang_co_ban_cua_Dart_trong_Flutter\"><\/span><b>C\u00e1c t\u00ednh n\u0103ng c\u01a1 b\u1ea3n c\u1ee7a Dart trong Flutter<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>X\u00e2y d\u1ef1ng giao di\u1ec7n ng\u01b0\u1eddi d\u00f9ng (UI) b\u1eb1ng Dart<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Dart l\u00e0 ng\u00f4n ng\u1eef ch\u00ednh trong vi\u1ec7c x\u00e2y d\u1ef1ng giao di\u1ec7n ng\u01b0\u1eddi d\u00f9ng trong Flutter. C\u00e1c widget trong Flutter \u0111\u01b0\u1ee3c vi\u1ebft b\u1eb1ng Dart \u0111\u1ec3 t\u1ea1o ra c\u00e1c th\u00e0nh ph\u1ea7n giao di\u1ec7n linh ho\u1ea1t v\u00e0 c\u00f3 th\u1ec3 t\u00e1i s\u1eed d\u1ee5ng.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">import 'package:flutter\/material.dart';<\/span>\n\n<span style=\"font-weight: 400;\">void main() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0runApp(MyApp());<\/span>\n<span style=\"font-weight: 400;\">}<\/span>\n\n<span style=\"font-weight: 400;\">class MyApp extends StatelessWidget {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0@override<\/span>\n<span style=\"font-weight: 400;\"> \u00a0Widget build(BuildContext context) {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0return MaterialApp(<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0home: Scaffold(<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0appBar: AppBar(title: Text('Welcome to Flutter)),<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0body: Center(child: Text('Hello World')),<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0),<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0);<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">D\u01b0\u1edbi \u0111\u00e2y l\u00e0 k\u1ebft qu\u1ea3 sau khi ch\u1ea1y \u0111o\u1ea1n code tr\u00ean \u1edf c\u1ea3 hai n\u1ec1n t\u1ea3ng th\u00f4ng d\u1ee5ng l\u00e0 iOS v\u00e0 Android:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-85067 size-full\" src=\"\/blog\/wp-content\/uploads\/2025\/03\/dart-flutter-1-vippro.webp\" alt=\"dart flutter - itviec blog\" width=\"693\" height=\"745\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><b>Qu\u1ea3n l\u00fd tr\u1ea1ng th\u00e1i trong Flutter v\u1edbi Dart<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Flutter cung c\u1ea5p nhi\u1ec1u c\u00e1ch qu\u1ea3n l\u00fd tr\u1ea1ng th\u00e1i nh\u01b0 StatefulWidget, Provider, v\u00e0 Riverpod. Vi\u1ec7c qu\u1ea3n l\u00fd State &#8211; c\u00e1c tr\u1ea1ng th\u00e1i trong Flutter l\u00e0 v\u00f4 c\u00f9ng quan tr\u1ecdng, quy\u1ebft \u0111\u1ecbnh \u0111\u1ebfn logic v\u00e0 c\u00e1ch ho\u1ea1t \u0111\u1ed9ng c\u1ee7a c\u00e1c th\u00e0nh ph\u1ea7n giao di\u1ec7n trong \u1ee9ng d\u1ee5ng.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">class Counter extends StatefulWidget {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0@override<\/span>\n<span style=\"font-weight: 400;\"> \u00a0_CounterState createState() =&gt; _CounterState();<\/span>\n<span style=\"font-weight: 400;\">}<\/span>\n\n<span style=\"font-weight: 400;\">class _CounterState extends State&lt;Counter&gt; {<\/span>\n<span style=\"font-weight: 400;\">\u00a0\u00a0int _count = 0;<\/span>\n\n<span style=\"font-weight: 400;\"> \u00a0void _increment() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0setState(() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0_count++;<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0});<\/span>\n<span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span>\n\n<span style=\"font-weight: 400;\"> \u00a0@override<\/span>\n<span style=\"font-weight: 400;\"> \u00a0Widget build(BuildContext context) {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0return Column(<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0children: [<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Text('Count: $_count'),<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ElevatedButton(onPressed: _increment, child: Text('Increment')),<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0\u00a0\u00a0],<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0);<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Gi\u1ea3i th\u00edch:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Tr\u1ea1ng th\u00e1i count khi v\u1eeba kh\u1edfi t\u1ea1o c\u00f3 gi\u00e1 tr\u1ecb b\u1eb1ng 0.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Khi ng\u01b0\u1eddi d\u00f9ng t\u01b0\u01a1ng t\u00e1c v\u1edbi n\u00fat tri\u1ec3n khai logic (increment), gi\u00e1 tr\u1ecb bi\u1ebfn _count c\u1ed9ng th\u00eam 1.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Giao di\u1ec7n c\u1ee7a ch\u01b0\u01a1ng tr\u00ecnh l\u00fac n\u00e0y \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt v\u00e0 hi\u1ec3n th\u1ecb gi\u00e1 tr\u1ecb c\u1ee7a bi\u1ebfn _count n\u00e0y l\u00ean m\u00e0n h\u00ecnh \u1ee9ng v\u1edbi tr\u1ea1ng th\u00e1i hi\u1ec7n t\u1ea1i c\u1ee7a bi\u1ebfn _count<\/span><\/li>\n<\/ul>\n<h3><b>X\u1eed l\u00fd s\u1ef1 ki\u1ec7n v\u00e0 t\u01b0\u01a1ng t\u00e1c ng\u01b0\u1eddi d\u00f9ng<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Dart h\u1ed7 tr\u1ee3 c\u00e1c widget t\u01b0\u01a1ng t\u00e1c nh\u01b0 <\/span><span style=\"font-weight: 400;\">GestureDetector<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">ElevatedButton<\/span><span style=\"font-weight: 400;\">, gi\u00fap ng\u01b0\u1eddi d\u00f9ng th\u1ef1c hi\u1ec7n c\u00e1c thao t\u00e1c nh\u01b0 nh\u1ea5n n\u00fat ho\u1eb7c k\u00e9o th\u1ea3.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 x\u1eed l\u00fd s\u1ef1 ki\u1ec7n nh\u1ea5n n\u00fat:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">ElevatedButton(<\/span>\n<span style=\"font-weight: 400;\"> \u00a0onPressed: () {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0print('Button clicked');<\/span>\n<span style=\"font-weight: 400;\"> \u00a0},<\/span>\n<span style=\"font-weight: 400;\"> \u00a0child: Text('Click Me'),<\/span>\n<span style=\"font-weight: 400;\">)<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">H\u00e0m <\/span><span style=\"font-weight: 400;\">onPressed<\/span><span style=\"font-weight: 400;\"> \u0111\u01b0\u1ee3c g\u1ecdi khi ng\u01b0\u1eddi d\u00f9ng nh\u1ea5n n\u00fat, gi\u00fap \u1ee9ng d\u1ee5ng ph\u1ea3n h\u1ed3i t\u01b0\u01a1ng t\u00e1c.<\/span><\/p>\n<h3><b>S\u1eed d\u1ee5ng th\u01b0 vi\u1ec7n v\u00e0 plugin Dart trong Flutter<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Flutter h\u1ed7 tr\u1ee3 nhi\u1ec1u th\u01b0 vi\u1ec7n v\u00e0 plugin \u0111\u01b0\u1ee3c vi\u1ebft b\u1eb1ng Dart \u0111\u1ec3 m\u1edf r\u1ed9ng t\u00ednh n\u0103ng nh\u01b0 truy c\u1eadp API, l\u01b0u tr\u1eef d\u1eef li\u1ec7u ho\u1eb7c t\u00edch h\u1ee3p d\u1ecbch v\u1ee5 b\u00ean ngo\u00e0i.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 s\u1eed d\u1ee5ng th\u01b0 vi\u1ec7n HTTP:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">import 'package:http\/http.dart' as http;<\/span>\n\n<span style=\"font-weight: 400;\">void fetchData() async {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0var url = Uri.parse('https:\/\/jsonplaceholder.typicode.com\/posts\/1');<\/span>\n<span style=\"font-weight: 400;\"> \u00a0var response = await http.get(url);<\/span>\n<span style=\"font-weight: 400;\"> \u00a0if (response.statusCode == 200) {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0print(response.body);<\/span>\n<span style=\"font-weight: 400;\"> \u00a0} else {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0print('Failed to load data');<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Th\u01b0 vi\u1ec7n HTTP gi\u00fap g\u1eedi y\u00eau c\u1ea7u HTTP v\u00e0 x\u1eed l\u00fd ph\u1ea3n h\u1ed3i t\u1eeb server.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Dart \u0111\u00f3ng vai tr\u00f2 trung t\u00e2m trong vi\u1ec7c x\u00e2y d\u1ef1ng \u1ee9ng d\u1ee5ng Flutter b\u1eb1ng c\u00e1ch cung c\u1ea5p c\u00f4ng c\u1ee5 l\u1eadp tr\u00ecnh m\u1ea1nh m\u1ebd v\u00e0 linh ho\u1ea1t, h\u1ed7 tr\u1ee3 x\u00e2y d\u1ef1ng giao di\u1ec7n, qu\u1ea3n l\u00fd tr\u1ea1ng th\u00e1i, x\u1eed l\u00fd s\u1ef1 ki\u1ec7n v\u00e0 t\u00edch h\u1ee3p c\u00e1c d\u1ecbch v\u1ee5 b\u00ean ngo\u00e0i.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cac_tinh_nang_nang_cao_cua_Dart_trong_Flutter\"><\/span><b>C\u00e1c t\u00ednh n\u0103ng n\u00e2ng cao c\u1ee7a Dart trong Flutter\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>K\u1ebf th\u1eeba v\u00e0 mixin trong Dart<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Dart h\u1ed7 tr\u1ee3 l\u1eadp tr\u00ecnh h\u01b0\u1edbng \u0111\u1ed1i t\u01b0\u1ee3ng (OOP) v\u1edbi <strong>t\u00ednh n\u0103ng k\u1ebf th\u1eeba<\/strong>, cho ph\u00e9p c\u00e1c l\u1edbp con k\u1ebf th\u1eeba c\u00e1c thu\u1ed9c t\u00ednh v\u00e0 ph\u01b0\u01a1ng th\u1ee9c t\u1eeb l\u1edbp cha.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">class Animal {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0void makeSound() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0print('Some sound');<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span>\n\n<span style=\"font-weight: 400;\">class Dog extends Animal {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0@override<\/span>\n<span style=\"font-weight: 400;\"> \u00a0void makeSound() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0print('Bark');<\/span>\n<span style=\"font-weight: 400;\"> \u00a0}<\/span>\n<span style=\"font-weight: 400;\">}<\/span>\n\n<span style=\"font-weight: 400;\">void main() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0Dog dog = Dog();<\/span>\n<span style=\"font-weight: 400;\"> \u00a0dog.makeSound(); \/\/ In ra 'Bark'<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Gi\u1ea3i th\u00edch:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1edbp <\/span><span style=\"font-weight: 400;\">Animal<\/span><span style=\"font-weight: 400;\"> \u0111\u1ecbnh ngh\u0129a m\u1ed9t ph\u01b0\u01a1ng th\u1ee9c <\/span><span style=\"font-weight: 400;\">makeSound()<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1edbp <\/span><span style=\"font-weight: 400;\">Dog<\/span><span style=\"font-weight: 400;\"> k\u1ebf th\u1eeba t\u1eeb <\/span><span style=\"font-weight: 400;\">Animal<\/span><span style=\"font-weight: 400;\"> v\u00e0 ghi \u0111\u00e8 ph\u01b0\u01a1ng th\u1ee9c <\/span><span style=\"font-weight: 400;\">makeSound()<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 cung c\u1ea5p \u00e2m thanh ri\u00eang.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1eeb kh\u00f3a <\/span><span style=\"font-weight: 400;\">@override<\/span><span style=\"font-weight: 400;\"> cho bi\u1ebft ph\u01b0\u01a1ng th\u1ee9c n\u00e0y ghi \u0111\u00e8 ph\u01b0\u01a1ng th\u1ee9c t\u1eeb l\u1edbp cha.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\"><strong>Mixin<\/strong> cho ph\u00e9p t\u00e1i s\u1eed d\u1ee5ng m\u00e3 ngu\u1ed3n b\u1eb1ng c\u00e1ch k\u1ebft h\u1ee3p nhi\u1ec1u l\u1edbp v\u00e0o m\u1ed9t l\u1edbp \u0111\u01a1n l\u1ebb.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">mixin Flyable {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0void fly() =&gt; print('Flying');<\/span>\n<span style=\"font-weight: 400;\">}<\/span>\n\n<span style=\"font-weight: 400;\">class Bird with Flyable {}<\/span>\n\n<span style=\"font-weight: 400;\">void main() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0Bird bird = Bird();<\/span>\n<span style=\"font-weight: 400;\"> \u00a0bird.fly(); \/\/ In ra 'Flying'<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Gi\u1ea3i th\u00edch:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">mixin<\/span><span style=\"font-weight: 400;\"> l\u00e0 m\u1ed9t lo\u1ea1i l\u1edbp \u0111\u1eb7c bi\u1ec7t cho ph\u00e9p t\u00e1i s\u1eed d\u1ee5ng c\u00e1c ph\u01b0\u01a1ng th\u1ee9c trong nhi\u1ec1u l\u1edbp.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">L\u1edbp <\/span><span style=\"font-weight: 400;\">Bird<\/span><span style=\"font-weight: 400;\"> s\u1eed d\u1ee5ng t\u1eeb kh\u00f3a <\/span><span style=\"font-weight: 400;\">with<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 k\u1ebft h\u1ee3p mixin <\/span><span style=\"font-weight: 400;\">Flyable<\/span><span style=\"font-weight: 400;\">, gi\u00fap l\u1edbp n\u00e0y c\u00f3 th\u1ec3 g\u1ecdi ph\u01b0\u01a1ng th\u1ee9c <\/span><span style=\"font-weight: 400;\">fly()<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ul>\n<h3><b>Extension methods v\u00e0 Generics<\/b><\/h3>\n<p><b>Extension methods<\/b><span style=\"font-weight: 400;\"> cho ph\u00e9p m\u1edf r\u1ed9ng c\u00e1c l\u1edbp hi\u1ec7n c\u00f3 m\u00e0 kh\u00f4ng c\u1ea7n k\u1ebf th\u1eeba.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">extension StringExtension on String {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0String get reversed =&gt; split('').reversed.join('');<\/span>\n<span style=\"font-weight: 400;\">}<\/span>\n\n<span style=\"font-weight: 400;\">void main() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0print('hello'.reversed); \/\/ In ra 'olleh'<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Gi\u1ea3i th\u00edch:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">extension<\/span><span style=\"font-weight: 400;\"> khai b\u00e1o m\u1ed9t extension method tr\u00ean l\u1edbp <\/span><span style=\"font-weight: 400;\">String<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Thu\u1ed9c t\u00ednh <\/span><span style=\"font-weight: 400;\">reversed<\/span><span style=\"font-weight: 400;\"> chuy\u1ec3n \u0111\u1ed5i chu\u1ed7i th\u00e0nh danh s\u00e1ch k\u00fd t\u1ef1, \u0111\u1ea3o ng\u01b0\u1ee3c danh s\u00e1ch v\u00e0 n\u1ed1i l\u1ea1i th\u00e0nh chu\u1ed7i m\u1edbi.<\/span><\/li>\n<\/ul>\n<p><b>Generics<\/b><span style=\"font-weight: 400;\"> gi\u00fap vi\u1ebft c\u00e1c l\u1edbp v\u00e0 h\u00e0m c\u00f3 th\u1ec3 l\u00e0m vi\u1ec7c v\u1edbi nhi\u1ec1u ki\u1ec3u d\u1eef li\u1ec7u.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">class Box&lt;T&gt; {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0T value;<\/span>\n<span style=\"font-weight: 400;\"> \u00a0Box(this.value);<\/span>\n<span style=\"font-weight: 400;\">}<\/span>\n\n<span style=\"font-weight: 400;\">void main() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0Box&lt;int&gt; intBox = Box(123);<\/span>\n<span style=\"font-weight: 400;\"> \u00a0Box&lt;String&gt; stringBox = Box('Hello');<\/span>\n<span style=\"font-weight: 400;\"> \u00a0print(intBox.value);<\/span>\n<span style=\"font-weight: 400;\"> \u00a0print(stringBox.value);<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Gi\u1ea3i th\u00edch:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T<\/span><span style=\"font-weight: 400;\"> l\u00e0 m\u1ed9t placeholder cho ki\u1ec3u d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c ch\u1ec9 \u0111\u1ecbnh khi kh\u1edfi t\u1ea1o l\u1edbp.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Box&lt;int&gt;<\/span><span style=\"font-weight: 400;\"> ch\u1ec9 \u0111\u1ecbnh l\u1edbp <\/span><span style=\"font-weight: 400;\">Box<\/span><span style=\"font-weight: 400;\"> ch\u1ee9a c\u00e1c gi\u00e1 tr\u1ecb ki\u1ec3u <\/span><span style=\"font-weight: 400;\">int<\/span><span style=\"font-weight: 400;\">, trong khi <\/span><span style=\"font-weight: 400;\">Box&lt;String&gt;<\/span><span style=\"font-weight: 400;\"> ch\u1ee9a gi\u00e1 tr\u1ecb ki\u1ec3u <\/span><span style=\"font-weight: 400;\">String<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ul>\n<h3><b>Null safety<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Null safety trong Dart gi\u00fap ng\u0103n ng\u1eeba c\u00e1c l\u1ed7i null runtime b\u1eb1ng c\u00e1ch x\u00e1c \u0111\u1ecbnh r\u00f5 r\u00e0ng bi\u1ebfn n\u00e0o c\u00f3 th\u1ec3 null v\u00e0 bi\u1ebfn n\u00e0o kh\u00f4ng.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">String? nullableString;<\/span>\n<span style=\"font-weight: 400;\">String nonNullableString = 'Hello';<\/span>\n\n<span style=\"font-weight: 400;\">void main() {<\/span>\n<span style=\"font-weight: 400;\"> \u00a0print(nullableString?.length); \/\/ Kh\u00f4ng g\u00e2y l\u1ed7i<\/span>\n<span style=\"font-weight: 400;\"> \u00a0print(nonNullableString.length); \/\/ In ra 5<\/span>\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Gi\u1ea3i th\u00edch:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">String?<\/span><span style=\"font-weight: 400;\"> ch\u1ec9 ra r\u1eb1ng bi\u1ebfn <\/span><span style=\"font-weight: 400;\">nullableString<\/span><span style=\"font-weight: 400;\"> c\u00f3 th\u1ec3 nh\u1eadn gi\u00e1 tr\u1ecb null.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To\u00e1n t\u1eed <\/span><span style=\"font-weight: 400;\">?.<\/span><span style=\"font-weight: 400;\"> gi\u00fap ki\u1ec3m tra null tr\u01b0\u1edbc khi truy c\u1eadp thu\u1ed9c t\u00ednh.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">nonNullableString<\/span><span style=\"font-weight: 400;\"> kh\u00f4ng th\u1ec3 null v\u00e0 lu\u00f4n c\u00f3 gi\u00e1 tr\u1ecb.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">C\u00e1ch t\u1ed1i \u01b0u:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Lu\u00f4n khai b\u00e1o c\u00e1c bi\u1ebfn kh\u00f4ng nullable n\u1ebfu c\u00f3 th\u1ec3.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng to\u00e1n t\u1eed <\/span><span style=\"font-weight: 400;\">?<\/span><span style=\"font-weight: 400;\"> v\u00e0 <\/span><span style=\"font-weight: 400;\">??<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 x\u1eed l\u00fd gi\u00e1 tr\u1ecb null.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ki\u1ec3m tra null tr\u01b0\u1edbc khi s\u1eed d\u1ee5ng c\u00e1c gi\u00e1 tr\u1ecb c\u00f3 th\u1ec3 null.<\/span><\/li>\n<\/ul>\n<h3><b>C\u1ea3i thi\u1ec7n hi\u1ec7u su\u1ea5t v\u00e0 t\u1ed1i \u01b0u h\u00f3a m\u00e3 Dart trong Flutter<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">C\u1ea3i thi\u1ec7n hi\u1ec7u su\u1ea5t trong Dart v\u00e0 Flutter c\u00f3 th\u1ec3 \u0111\u1ea1t \u0111\u01b0\u1ee3c b\u1eb1ng c\u00e1ch:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng <\/span><span style=\"font-weight: 400;\">const<\/span><span style=\"font-weight: 400;\"> cho c\u00e1c widget t\u0129nh.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Gi\u1ea3m s\u1ed1 l\u01b0\u1ee3ng widget con trong c\u00e2y widget.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1ed1i \u01b0u h\u00f3a vi\u1ec7c s\u1eed d\u1ee5ng b\u1ed9 nh\u1edb b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng c\u00e1c collection nh\u01b0 <\/span><span style=\"font-weight: 400;\">List<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">Map<\/span><span style=\"font-weight: 400;\">, v\u00e0 <\/span><span style=\"font-weight: 400;\">Set<\/span><span style=\"font-weight: 400;\"> m\u1ed9t c\u00e1ch hi\u1ec7u qu\u1ea3.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng <\/span><span style=\"font-weight: 400;\">lazy loading<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 t\u1ea3i d\u1eef li\u1ec7u ch\u1ec9 khi c\u1ea7n thi\u1ebft.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 t\u1ed1i \u01b0u h\u00f3a v\u1edbi <\/span><span style=\"font-weight: 400;\">const<\/span><span style=\"font-weight: 400;\">:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">const Text('Hello, World');<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Gi\u1ea3i th\u00edch:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">const<\/span><span style=\"font-weight: 400;\"> t\u1ea1o widget ch\u1ec9 m\u1ed9t l\u1ea7n v\u00e0 t\u00e1i s\u1eed d\u1ee5ng trong to\u00e0n b\u1ed9 \u1ee9ng d\u1ee5ng.<\/span><\/li>\n<\/ul>\n<h3><b>C\u1ea3i thi\u1ec7n hi\u1ec7u su\u1ea5t \u1ee9ng d\u1ee5ng<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng <\/span><span style=\"font-weight: 400;\">Isolate<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 ch\u1ea1y c\u00e1c t\u00e1c v\u1ee5 t\u00ednh to\u00e1n n\u1eb7ng \u1edf lu\u1ed3ng kh\u00e1c.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1ed1i \u01b0u h\u00f3a b\u1ed9 nh\u1edb b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng c\u00e1c th\u01b0 vi\u1ec7n hi\u1ec7u qu\u1ea3 nh\u01b0 <\/span><span style=\"font-weight: 400;\">cached_network_image<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 cache h\u00ecnh \u1ea3nh.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng <\/span><span style=\"font-weight: 400;\">flutter_devtools<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 ph\u00e2n t\u00edch v\u00e0 c\u1ea3i thi\u1ec7n hi\u1ec7u su\u1ea5t \u1ee9ng d\u1ee5ng.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Nh\u1eefng t\u00ednh n\u0103ng n\u00e2ng cao n\u00e0y gi\u00fap c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean vi\u1ebft m\u00e3 Dart hi\u1ec7u qu\u1ea3 h\u01a1n v\u00e0 t\u1ed1i \u01b0u h\u00f3a c\u00e1c \u1ee9ng d\u1ee5ng Flutter \u0111\u1ec3 \u0111\u1ea1t \u0111\u01b0\u1ee3c hi\u1ec7u su\u1ea5t cao nh\u1ea5t.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cac_cau_hoi_thuong_gap_ve_Dart_Flutter\"><\/span><b>C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Dart Flutter<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>Dart c\u00f3 ph\u1ea3i l\u00e0 ng\u00f4n ng\u1eef b\u1eaft bu\u1ed9c khi ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng Flutter kh\u00f4ng?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">\u0110\u00fang. Dart l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh ch\u00ednh th\u1ee9c v\u00e0 b\u1eaft bu\u1ed9c khi ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng Flutter. Flutter SDK \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng tr\u00ean n\u1ec1n t\u1ea3ng Dart v\u00e0 cung c\u1ea5p c\u00e1c th\u01b0 vi\u1ec7n, API h\u1ed7 tr\u1ee3 tr\u1ef1c ti\u1ebfp b\u1eb1ng ng\u00f4n ng\u1eef n\u00e0y..<\/span><\/p>\n<h3><b>S\u1ef1 kh\u00e1c bi\u1ec7t gi\u1eefa <\/b><b>Future v\u00e0 Stream trong Dart l\u00e0 g\u00ec?<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Future: \u0110\u1ea1i di\u1ec7n cho m\u1ed9t k\u1ebft qu\u1ea3 b\u1ea5t \u0111\u1ed3ng b\u1ed9 ch\u1ec9 x\u1ea3y ra m\u1ed9t l\u1ea7n, v\u00ed d\u1ee5 nh\u01b0 k\u1ebft qu\u1ea3 tr\u1ea3 v\u1ec1 c\u1ee7a m\u1ed9t API.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Stream: \u0110\u1ea1i di\u1ec7n cho m\u1ed9t chu\u1ed7i c\u00e1c s\u1ef1 ki\u1ec7n b\u1ea5t \u0111\u1ed3ng b\u1ed9, c\u00f3 th\u1ec3 ph\u00e1t sinh nhi\u1ec1u k\u1ebft qu\u1ea3 trong su\u1ed1t th\u1eddi gian th\u1ef1c thi, v\u00ed d\u1ee5 nh\u01b0 d\u1eef li\u1ec7u c\u1ea3m bi\u1ebfn ho\u1eb7c k\u1ebft qu\u1ea3 socket.<\/span><\/li>\n<\/ul>\n<h3><b>L\u00e0m th\u1ebf n\u00e0o \u0111\u1ec3 c\u1ea3i thi\u1ec7n hi\u1ec7u su\u1ea5t trong \u1ee9ng d\u1ee5ng Flutter s\u1eed d\u1ee5ng Dart?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">M\u1ed9t s\u1ed1 c\u00e1ch t\u1ed1i \u01b0u h\u00f3a bao g\u1ed3m:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng t\u1eeb kh\u00f3a <\/span><span style=\"font-weight: 400;\">const<\/span><span style=\"font-weight: 400;\"> cho c\u00e1c widget t\u0129nh.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Gi\u1ea3m s\u1ed1 l\u01b0\u1ee3ng widget con trong c\u00e2y widget.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u1ed1i \u01b0u h\u00f3a b\u1ed9 nh\u1edb v\u1edbi c\u00e1c c\u1ea5u tr\u00fac d\u1eef li\u1ec7u nh\u01b0 <\/span><span style=\"font-weight: 400;\">List<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">Map<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">D\u00f9ng th\u01b0 vi\u1ec7n cache nh\u01b0 <\/span><span style=\"font-weight: 400;\">cached_network_image<\/span><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Tong_ket\"><\/span><b>T\u1ed5ng k\u1ebft\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Dart \u0111\u00f3ng vai tr\u00f2 quan tr\u1ecdng trong vi\u1ec7c ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng Flutter, cung c\u1ea5p m\u1ed9t n\u1ec1n t\u1ea3ng l\u1eadp tr\u00ecnh m\u1ea1nh m\u1ebd, linh ho\u1ea1t v\u00e0 hi\u1ec7u qu\u1ea3. T\u1eeb c\u00e1c ki\u1ebfn th\u1ee9c c\u01a1 b\u1ea3n nh\u01b0 bi\u1ebfn, ki\u1ec3u d\u1eef li\u1ec7u, c\u1ea5u tr\u00fac \u0111i\u1ec1u khi\u1ec3n, \u0111\u1ebfn c\u00e1c t\u00ednh n\u0103ng n\u00e2ng cao nh\u01b0 k\u1ebf th\u1eeba, mixin, v\u00e0 l\u1eadp tr\u00ecnh b\u1ea5t \u0111\u1ed3ng b\u1ed9, Dart gi\u00fap l\u1eadp tr\u00ecnh vi\u00ean x\u00e2y d\u1ef1ng c\u00e1c \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng hi\u1ec7u su\u1ea5t cao v\u00e0 an to\u00e0n.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">B\u1eb1ng c\u00e1ch n\u1eafm v\u1eefng c\u00e1c kh\u00e1i ni\u1ec7m v\u00e0 th\u1ef1c ti\u1ec5n t\u1ed1t trong Dart, b\u1ea1n c\u00f3 th\u1ec3 t\u1ed1i \u01b0u h\u00f3a hi\u1ec7u su\u1ea5t \u1ee9ng d\u1ee5ng, c\u1ea3i thi\u1ec7n tr\u1ea3i nghi\u1ec7m ng\u01b0\u1eddi d\u00f9ng v\u00e0 gi\u1ea3m thi\u1ec3u c\u00e1c l\u1ed7i trong qu\u00e1 tr\u00ecnh ph\u00e1t tri\u1ec3n. Vi\u1ec7c k\u1ebft h\u1ee3p gi\u1eefa Flutter v\u00e0 Dart mang l\u1ea1i m\u1ed9t h\u1ec7 sinh th\u00e1i ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng hi\u1ec7n \u0111\u1ea1i, \u0111\u01a1n gi\u1ea3n v\u00e0 m\u1ea1nh m\u1ebd, gi\u00fap l\u1eadp tr\u00ecnh vi\u00ean d\u1ec5 d\u00e0ng x\u00e2y d\u1ef1ng c\u00e1c \u1ee9ng d\u1ee5ng \u0111a n\u1ec1n t\u1ea3ng v\u1edbi giao di\u1ec7n \u0111\u1eb9p v\u00e0 hi\u1ec7u su\u1ea5t cao.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Hy v\u1ecdng b\u00e0i vi\u1ebft n\u00e0y gi\u00fap b\u1ea1n c\u00f3 c\u00e1i nh\u00ecn t\u1ed5ng quan v\u00e0 s\u00e2u s\u1eafc h\u01a1n v\u1ec1 vai tr\u00f2 c\u1ee7a Dart trong Flutter, c\u0169ng nh\u01b0 c\u00e1c k\u1ef9 thu\u1eadt v\u00e0 m\u1eb9o l\u1eadp tr\u00ecnh gi\u00fap t\u1ed1i \u01b0u h\u00f3a \u1ee9ng d\u1ee5ng.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dart l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh ch\u00ednh \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong Flutter &#8211; m\u1ed9t framework ph\u1ed5 bi\u1ebfn \u0111\u1ec3 ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng \u0111a n\u1ec1n t\u1ea3ng. V\u1edbi c\u00fa ph\u00e1p hi\u1ec7n \u0111\u1ea1i, linh ho\u1ea1t v\u00e0 hi\u1ec7u su\u1ea5t cao, Dart cung c\u1ea5p n\u1ec1n t\u1ea3ng v\u1eefng ch\u1eafc \u0111\u1ec3 x\u00e2y d\u1ef1ng c\u00e1c \u1ee9ng d\u1ee5ng c\u00f3 giao di\u1ec7n \u0111\u1eb9p, [&hellip;]<\/p>\n","protected":false},"author":203,"featured_media":85256,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109],"tags":[],"class_list":["post-87972","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Dart Flutter l\u00e0 g\u00ec: C\u00e1ch x\u00e2y d\u1ef1ng mobile app v\u1edbi Dart trong Flutter - ITviec Blog<\/title>\n<meta name=\"description\" content=\"Dart l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh ch\u00ednh \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong Flutter. Chi ti\u1ebft c\u00e1ch s\u1eed d\u1ee5ng Dart Flutter \u0111\u1ec3 x\u00e2y d\u1ef1ng \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng \u0111a n\u1ec1n t\u1ea3ng.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dart Flutter l\u00e0 g\u00ec: C\u00e1ch x\u00e2y d\u1ef1ng mobile app v\u1edbi Dart trong Flutter\" \/>\n<meta property=\"og:description\" content=\"Dart l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh ch\u00ednh \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong Flutter - m\u1ed9t framework ph\u1ed5 bi\u1ebfn \u0111\u1ec3 ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng \u0111a n\u1ec1n t\u1ea3ng. V\u1edbi c\u00fa ph\u00e1p hi\u1ec7n \u0111\u1ea1i,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-25T04:57:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-17T08:20:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/dart-flutter-vippro-scaled.png\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"337\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tien Tran\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tien Tran\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Dart Flutter l\u00e0 g\u00ec: C\u00e1ch x\u00e2y d\u1ef1ng mobile app v\u1edbi Dart trong Flutter - ITviec Blog","description":"Dart l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh ch\u00ednh \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong Flutter. Chi ti\u1ebft c\u00e1ch s\u1eed d\u1ee5ng Dart Flutter \u0111\u1ec3 x\u00e2y d\u1ef1ng \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng \u0111a n\u1ec1n t\u1ea3ng.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/","og_locale":"vi_VN","og_type":"article","og_title":"Dart Flutter l\u00e0 g\u00ec: C\u00e1ch x\u00e2y d\u1ef1ng mobile app v\u1edbi Dart trong Flutter","og_description":"Dart l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh ch\u00ednh \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong Flutter - m\u1ed9t framework ph\u1ed5 bi\u1ebfn \u0111\u1ec3 ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng \u0111a n\u1ec1n t\u1ea3ng. V\u1edbi c\u00fa ph\u00e1p hi\u1ec7n \u0111\u1ea1i,","og_url":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2025-03-25T04:57:42+00:00","article_modified_time":"2025-06-17T08:20:49+00:00","og_image":[{"width":640,"height":337,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/dart-flutter-vippro-scaled.png","type":"image\/png"}],"author":"Tien Tran","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"Tien Tran","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"12 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/"},"author":{"name":"Tien Tran","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/1595d671c49cfa2a48cd3c0a047a1298"},"headline":"Dart Flutter l\u00e0 g\u00ec: C\u00e1ch x\u00e2y d\u1ef1ng mobile app v\u1edbi Dart trong Flutter","datePublished":"2025-03-25T04:57:42+00:00","dateModified":"2025-06-17T08:20:49+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/"},"wordCount":3042,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/dart-flutter-vippro-scaled.png","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/","url":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/","name":"Dart Flutter l\u00e0 g\u00ec: C\u00e1ch x\u00e2y d\u1ef1ng mobile app v\u1edbi Dart trong Flutter - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/dart-flutter-vippro-scaled.png","datePublished":"2025-03-25T04:57:42+00:00","dateModified":"2025-06-17T08:20:49+00:00","description":"Dart l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh ch\u00ednh \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong Flutter. Chi ti\u1ebft c\u00e1ch s\u1eed d\u1ee5ng Dart Flutter \u0111\u1ec3 x\u00e2y d\u1ef1ng \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng \u0111a n\u1ec1n t\u1ea3ng.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/dart-flutter-vippro-scaled.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/03\/dart-flutter-vippro-scaled.png","width":640,"height":337,"caption":"dart flutter - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/xay-dung-mobile-app-voi-dart-flutter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"Dart Flutter l\u00e0 g\u00ec: C\u00e1ch x\u00e2y d\u1ef1ng mobile app v\u1edbi Dart trong Flutter"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/1595d671c49cfa2a48cd3c0a047a1298","name":"Tien Tran","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/05\/tien-tran-author-e1715658627643-100x100.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/05\/tien-tran-author-e1715658627643-100x100.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/05\/tien-tran-author-e1715658627643-100x100.jpg","caption":"Tien Tran"},"url":"https:\/\/itviec.com\/blog\/author\/tien-tran\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/87972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/203"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=87972"}],"version-history":[{"count":2,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/87972\/revisions"}],"predecessor-version":[{"id":88206,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/87972\/revisions\/88206"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/85256"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=87972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=87972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=87972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}