agent-flutter 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -288,6 +288,7 @@ cat >.vscode/settings.json <<'JSON'
|
|
|
288
288
|
JSON
|
|
289
289
|
|
|
290
290
|
run_fvm flutter pub add get flutter_bloc equatable dio retrofit json_annotation flutter_dotenv flutter_svg intl
|
|
291
|
+
run_fvm flutter pub add flutter_keyboard_visibility:^6.0.0 cached_network_image:^3.3.1 flutter_inappwebview:^6.1.5 pin_code_fields:^8.0.1 gif:^2.3.0
|
|
291
292
|
run_fvm flutter pub add common_widget --git-url https://github.com/tuan-urani/common_widget --git-ref main
|
|
292
293
|
run_fvm flutter pub add --dev build_runner retrofit_generator json_serializable
|
|
293
294
|
|
|
@@ -376,13 +377,192 @@ EOF
|
|
|
376
377
|
|
|
377
378
|
cat >lib/src/utils/app_colors.dart <<'EOF'
|
|
378
379
|
import 'package:flutter/material.dart';
|
|
380
|
+
import '../extensions/color_extension.dart';
|
|
379
381
|
|
|
380
382
|
class AppColors {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
static const Color
|
|
383
|
+
// ===========================================================================
|
|
384
|
+
// PRIMARY
|
|
385
|
+
// ===========================================================================
|
|
386
|
+
static const Color primary = Color(0xFF84C93F);
|
|
387
|
+
static const Color primaryLight = Color(0xFF5CC7A0);
|
|
388
|
+
|
|
389
|
+
/// Alpha variants
|
|
390
|
+
static const Color primaryAlpha10 = Color(0x1A84C93F);
|
|
391
|
+
|
|
392
|
+
// Backward compatibility
|
|
393
|
+
static const Color color84C93F = primaryAlpha10;
|
|
394
|
+
static const Color color1A84C93F = primaryAlpha10;
|
|
395
|
+
|
|
396
|
+
// ===========================================================================
|
|
397
|
+
// SECONDARY
|
|
398
|
+
// ===========================================================================
|
|
399
|
+
static const Color secondary1 = Color(0xFFCAE7B4);
|
|
400
|
+
static const Color secondary2 = Color(0xFFE6F4EC);
|
|
401
|
+
|
|
402
|
+
// ===========================================================================
|
|
403
|
+
// NEUTRAL / BLACK
|
|
404
|
+
// ===========================================================================
|
|
405
|
+
static const Color black = Color(0xFF000000);
|
|
406
|
+
|
|
407
|
+
// ===========================================================================
|
|
408
|
+
// NEUTRAL / WHITE
|
|
409
|
+
// ===========================================================================
|
|
385
410
|
static const Color white = Color(0xFFFFFFFF);
|
|
411
|
+
static const Color transparent = Color(0x00000000);
|
|
412
|
+
|
|
413
|
+
// ===========================================================================
|
|
414
|
+
// STATUS
|
|
415
|
+
// ===========================================================================
|
|
416
|
+
static const Color success = Color(0xFF4CAF50);
|
|
417
|
+
static const Color warning = Color(0xFFFFC107);
|
|
418
|
+
static const Color error = Color(0xFFF44336);
|
|
419
|
+
static const Color info = Color(0xFF2196F3);
|
|
420
|
+
|
|
421
|
+
// ===========================================================================
|
|
422
|
+
// TEXT
|
|
423
|
+
// ===========================================================================
|
|
424
|
+
static const Color textPrimary = Color(0xFF212121);
|
|
425
|
+
static const Color textDisabled = Color(0xFFC0C0C0);
|
|
426
|
+
static const Color textInverse = white;
|
|
427
|
+
|
|
428
|
+
static const greyF3 = Color(0xFFF3F3F3);
|
|
429
|
+
static const color2D7DD2 = Color(0xFF2D7DD2);
|
|
430
|
+
static const color1D2410 = Color(0xFF1D2410);
|
|
431
|
+
static const color484848 = Color(0xFF484848);
|
|
432
|
+
static const color1C274C = Color(0xFF1C274C);
|
|
433
|
+
static const colorFFF4F2 = Color(0xFFFFF4F2);
|
|
434
|
+
static const colorF5F7FA = Color(0xFFF5F7FA);
|
|
435
|
+
static const colorE6F7ED = Color(0xFFE6F7ED);
|
|
436
|
+
static const color667394 = Color(0xFF667394);
|
|
437
|
+
static const colorFF9800 = Color(0xFFFF9800);
|
|
438
|
+
static const colorB8BCC6 = Color(0xFFB8BCC6);
|
|
439
|
+
static const colorF2F4F7 = Color(0xFFF2F4F7);
|
|
440
|
+
static const colorF9FAFB = Color(0xFFF9FAFB);
|
|
441
|
+
static const colorE1E1E1 = Color(0xFFE1E1E1);
|
|
442
|
+
static const colorE3F2D9 = Color(0xFFE3F2D9);
|
|
443
|
+
static const colorEEEDE9 = Color(0xFFEEEDE9);
|
|
444
|
+
static const color333333 = Color(0xFF333333);
|
|
445
|
+
static const colorEFF8DD = Color(0xFFEFF8DD);
|
|
446
|
+
static const color475467 = Color(0xFF475467);
|
|
447
|
+
static const colorE8EDF5 = Color(0xFFE8EDF5);
|
|
448
|
+
static const colorF4F4F4 = Color(0xFFF4F4F4);
|
|
449
|
+
static const color131A29 = Color(0xFF131A29);
|
|
450
|
+
static const colorD1E8BE = Color(0xFFD1E8BE);
|
|
451
|
+
static const colorE6FAD2 = Color(0xFFE6FAD2);
|
|
452
|
+
static const colorDAFFE0 = Color(0xFFDAFFE0);
|
|
453
|
+
static const color0F000000 = Color(0x0F000000);
|
|
454
|
+
static const colorFAFAFA = Color(0xFFFAFAFA);
|
|
455
|
+
static const colorF8F1DD = Color(0xFFF8F1DD);
|
|
456
|
+
static const colorB7B7B7 = Color(0xFFB7B7B7);
|
|
457
|
+
static const colorFF8C42 = Color(0xFFFF8C42);
|
|
458
|
+
static const color1AFF8C42 = Color(0x1AFF8C42);
|
|
459
|
+
static const colorF1D2BC = Color(0xFFF1D2BC);
|
|
460
|
+
static const colorDFE4F5 = Color(0xFFDFE4F5);
|
|
461
|
+
static const colorF39702 = Color(0xFFF39702);
|
|
462
|
+
static const colorFB1B8D1 = Color(0xFFB1B8D1);
|
|
463
|
+
static const colorF64748B = Color(0xFF64748B);
|
|
464
|
+
static const colorFEF4056 = Color(0xFFEF4056);
|
|
465
|
+
static const colorF586AA6 = Color(0xFF586AA6);
|
|
466
|
+
static const colorFDEF1BC = Color(0xFFDEF1BC);
|
|
467
|
+
static const color101828 = Color(0xFF101828);
|
|
468
|
+
static const colorFFE53E = Color(0xFFFFE53E);
|
|
469
|
+
static const colorEEEAE8 = Color(0xFFEEEAE8);
|
|
470
|
+
static const colorEF4056 = Color(0xFFEF4056);
|
|
471
|
+
static const color1AEF4056 = Color(0x1AEF4056);
|
|
472
|
+
static const colorFF5B42 = Color(0xFFFF5B42);
|
|
473
|
+
static const color33FF5B42 = Color(0x33FF5B42);
|
|
474
|
+
static const color0095FF = Color(0xFF0095FF);
|
|
475
|
+
static const color1A0095FF = Color(0x1A0095FF);
|
|
476
|
+
static const color88CF66 = Color(0xFF88CF66);
|
|
477
|
+
static const color1A88CF66 = Color(0x1A88CF66);
|
|
478
|
+
static const color1A2D7DD2 = Color(0x1A2D7DD2);
|
|
479
|
+
static const colorFEFEFE = Color(0xFFFEFEFE);
|
|
480
|
+
static const colorDCDFEB = Color(0xFFDCDFEB);
|
|
481
|
+
static const color80586AA6 = Color(0x80586AA6);
|
|
482
|
+
static const colorF59AEF9 = Color(0xFF59AEF9);
|
|
483
|
+
static const colorFE4F3FF = Color(0xFFE4F3FF);
|
|
484
|
+
static const colorF6B7280 = Color(0xFF6B7280);
|
|
485
|
+
static const colorFE6F4EC = Color(0xFFE6F4EC);
|
|
486
|
+
static const colorFBFC9DE = Color(0xFFBFC9DE);
|
|
487
|
+
static const colorFE7EDF3 = Color(0xFFE7EDF3);
|
|
488
|
+
static const colorFDCDFEB = Color(0xFFDCDFEB);
|
|
489
|
+
static const colorF101828 = Color(0xFF101828);
|
|
490
|
+
static const colorF646C72 = Color(0xFF646C72);
|
|
491
|
+
static const colorF3F7FC9 = Color(0xFF3F7FC9);
|
|
492
|
+
static const colorFA1AEBE = Color(0xFFA1AEBE);
|
|
493
|
+
static const colorEAF9E6 = Color(0xFFEAF9E6);
|
|
494
|
+
static const colorC8E6C9 = Color(0xFFC8E6C9);
|
|
495
|
+
static const colorE3F2FD = Color(0xFFE3F2FD);
|
|
496
|
+
static const colorFFF3E0 = Color(0xFFFFF3E0);
|
|
497
|
+
static const colorF3E5F5 = Color(0xFFF3E5F5);
|
|
498
|
+
static const color9C27B0 = Color(0xFF9C27B0);
|
|
499
|
+
static const colorFAF9F8 = Color(0xFFFAF9F8);
|
|
500
|
+
static const colorCDCDCD = Color(0xFFCDCDCD);
|
|
501
|
+
static const colorD9DEED = Color(0xFFD9DEED);
|
|
502
|
+
static const colorFDFFFD = Color(0xFFFDFFFD);
|
|
503
|
+
static const colorEBEDF0 = Color(0xFFEBEDF0);
|
|
504
|
+
static const colorF8FAFB = Color(0xFFF8FAFB);
|
|
505
|
+
static const colorFFEAEA = Color(0xFFFFEAEA);
|
|
506
|
+
static const colorEAECF0 = Color(0xFFEAECF0);
|
|
507
|
+
static const colorFFE2D0 = Color(0xFFFFE2D0);
|
|
508
|
+
|
|
509
|
+
// ===========================================================================
|
|
510
|
+
// BACKGROUND
|
|
511
|
+
// ===========================================================================
|
|
512
|
+
static const Color background = white;
|
|
513
|
+
static const Color backgroundSecondary = Color(0xFFF5F5F5);
|
|
514
|
+
static const Color backgroundDisabled = Color(0xFFE5E5E5);
|
|
515
|
+
static const Color backgroundOverlay = Color(0x80000000);
|
|
516
|
+
|
|
517
|
+
// ===========================================================================
|
|
518
|
+
// BORDER
|
|
519
|
+
// ===========================================================================
|
|
520
|
+
static const Color border = Color(0xFFE0E0E0);
|
|
521
|
+
static const Color borderLight = Color(0xFFEEEEEE);
|
|
522
|
+
static const Color borderDark = Color(0xFFBDBDBD);
|
|
523
|
+
|
|
524
|
+
// ===========================================================================
|
|
525
|
+
// GRADIENTS
|
|
526
|
+
// ===========================================================================
|
|
527
|
+
static LinearGradient primaryGradient() => const LinearGradient(
|
|
528
|
+
begin: Alignment.topLeft,
|
|
529
|
+
end: Alignment.bottomRight,
|
|
530
|
+
colors: [primary, primaryLight],
|
|
531
|
+
);
|
|
532
|
+
|
|
533
|
+
static LinearGradient secondaryGradient() => const LinearGradient(
|
|
534
|
+
begin: Alignment.topLeft,
|
|
535
|
+
end: Alignment.bottomRight,
|
|
536
|
+
colors: [primary, secondary1],
|
|
537
|
+
);
|
|
538
|
+
|
|
539
|
+
static LinearGradient primaryTextGradient() =>
|
|
540
|
+
const LinearGradient(colors: [primary, primaryLight]);
|
|
541
|
+
|
|
542
|
+
static LinearGradient fadeGradient() => LinearGradient(
|
|
543
|
+
begin: Alignment.topCenter,
|
|
544
|
+
end: Alignment.bottomCenter,
|
|
545
|
+
colors: [black.withOpacityX(0.3), black],
|
|
546
|
+
);
|
|
547
|
+
|
|
548
|
+
static LinearGradient disabledGradient() =>
|
|
549
|
+
const LinearGradient(colors: [border, borderDark]);
|
|
550
|
+
|
|
551
|
+
static LinearGradient primaryBackgroundGradient() => const LinearGradient(
|
|
552
|
+
begin: Alignment.topCenter,
|
|
553
|
+
end: Alignment.bottomCenter,
|
|
554
|
+
colors: [Color(0xFFF7F7FA), Color(0xFFF2F1EC)],
|
|
555
|
+
);
|
|
556
|
+
|
|
557
|
+
// ===========================================================================
|
|
558
|
+
// UTIL
|
|
559
|
+
// ===========================================================================
|
|
560
|
+
static Color fromHex(String hex) {
|
|
561
|
+
final buffer = StringBuffer();
|
|
562
|
+
if (hex.length == 6 || hex.length == 7) buffer.write('ff');
|
|
563
|
+
buffer.write(hex.replaceFirst('#', ''));
|
|
564
|
+
return Color(int.parse(buffer.toString(), radix: 16));
|
|
565
|
+
}
|
|
386
566
|
}
|
|
387
567
|
EOF
|
|
388
568
|
|
|
@@ -392,13 +572,131 @@ import 'package:flutter/material.dart';
|
|
|
392
572
|
import 'app_colors.dart';
|
|
393
573
|
|
|
394
574
|
class AppStyles {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
static const
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
575
|
+
// Font Families
|
|
576
|
+
static const String fontFamily = 'ZenMaruGothic';
|
|
577
|
+
static const String fontHiraginoKakuProW6 = 'ZenMaruGothic';
|
|
578
|
+
static const String fontHiraginoKakuStd = 'ZenMaruGothic';
|
|
579
|
+
|
|
580
|
+
static TextStyle h40({
|
|
581
|
+
String fontFamily = fontFamily,
|
|
582
|
+
Color color = AppColors.black,
|
|
583
|
+
FontWeight fontWeight = FontWeight.w700,
|
|
584
|
+
double? height,
|
|
585
|
+
}) => _textStyle(45.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
586
|
+
|
|
587
|
+
// Text Styles
|
|
588
|
+
static TextStyle h1({
|
|
589
|
+
String fontFamily = fontFamily,
|
|
590
|
+
Color color = AppColors.black,
|
|
591
|
+
FontWeight fontWeight = FontWeight.w700,
|
|
592
|
+
double? height,
|
|
593
|
+
}) => _textStyle(32.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
594
|
+
|
|
595
|
+
static TextStyle h2({
|
|
596
|
+
String fontFamily = fontFamily,
|
|
597
|
+
Color color = AppColors.black,
|
|
598
|
+
FontWeight fontWeight = FontWeight.w600,
|
|
599
|
+
double? height,
|
|
600
|
+
}) => _textStyle(28.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
601
|
+
|
|
602
|
+
static TextStyle headlineLarge({
|
|
603
|
+
String fontFamily = fontFamily,
|
|
604
|
+
Color color = AppColors.black,
|
|
605
|
+
FontWeight fontWeight = FontWeight.w700,
|
|
606
|
+
double? height,
|
|
607
|
+
}) => _textStyle(36.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
608
|
+
|
|
609
|
+
static TextStyle titleLarge({
|
|
610
|
+
String fontFamily = fontFamily,
|
|
611
|
+
Color color = AppColors.black,
|
|
612
|
+
FontWeight fontWeight = FontWeight.w700,
|
|
613
|
+
double? height,
|
|
614
|
+
}) => _textStyle(26.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
615
|
+
|
|
616
|
+
static TextStyle h3({
|
|
617
|
+
String fontFamily = fontFamily,
|
|
618
|
+
Color color = AppColors.black,
|
|
619
|
+
FontWeight fontWeight = FontWeight.w600,
|
|
620
|
+
double? height,
|
|
621
|
+
}) => _textStyle(24.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
622
|
+
|
|
623
|
+
static TextStyle h4({
|
|
624
|
+
String fontFamily = fontFamily,
|
|
625
|
+
Color color = AppColors.black,
|
|
626
|
+
FontWeight fontWeight = FontWeight.w500,
|
|
627
|
+
double? height,
|
|
628
|
+
}) => _textStyle(20.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
629
|
+
|
|
630
|
+
static TextStyle h5({
|
|
631
|
+
String fontFamily = fontFamily,
|
|
632
|
+
Color color = AppColors.black,
|
|
633
|
+
FontWeight fontWeight = FontWeight.w500,
|
|
634
|
+
double? height,
|
|
635
|
+
}) => _textStyle(18.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
636
|
+
|
|
637
|
+
static TextStyle bodyLarge({
|
|
638
|
+
String fontFamily = fontFamily,
|
|
639
|
+
Color color = AppColors.black,
|
|
640
|
+
FontWeight fontWeight = FontWeight.w400,
|
|
641
|
+
double? height,
|
|
642
|
+
}) => _textStyle(16.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
643
|
+
|
|
644
|
+
static TextStyle bodyMedium({
|
|
645
|
+
String fontFamily = fontFamily,
|
|
646
|
+
Color color = AppColors.black,
|
|
647
|
+
FontWeight fontWeight = FontWeight.w400,
|
|
648
|
+
double? height,
|
|
649
|
+
}) => _textStyle(14.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
650
|
+
|
|
651
|
+
static TextStyle bodySmall({
|
|
652
|
+
String fontFamily = fontFamily,
|
|
653
|
+
Color color = AppColors.black,
|
|
654
|
+
FontWeight fontWeight = FontWeight.w400,
|
|
655
|
+
double? height,
|
|
656
|
+
}) => _textStyle(12.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
657
|
+
|
|
658
|
+
static TextStyle caption({
|
|
659
|
+
String fontFamily = fontFamily,
|
|
660
|
+
Color color = AppColors.black,
|
|
661
|
+
FontWeight fontWeight = FontWeight.w400,
|
|
662
|
+
double? height,
|
|
663
|
+
}) => _textStyle(10.0, color, fontWeight, height, fontFamily: fontFamily);
|
|
664
|
+
|
|
665
|
+
// Button Styles
|
|
666
|
+
static TextStyle buttonLarge({
|
|
667
|
+
String fontFamily = fontFamily,
|
|
668
|
+
Color color = AppColors.white,
|
|
669
|
+
FontWeight fontWeight = FontWeight.w600,
|
|
670
|
+
}) => _textStyle(16.0, color, fontWeight, 1.5, fontFamily: fontFamily);
|
|
671
|
+
|
|
672
|
+
static TextStyle buttonMedium({
|
|
673
|
+
String fontFamily = fontFamily,
|
|
674
|
+
Color color = AppColors.white,
|
|
675
|
+
FontWeight fontWeight = FontWeight.w500,
|
|
676
|
+
}) => _textStyle(14.0, color, fontWeight, 1.4, fontFamily: fontFamily);
|
|
677
|
+
|
|
678
|
+
static TextStyle buttonSmall({
|
|
679
|
+
String fontFamily = fontFamily,
|
|
680
|
+
Color color = AppColors.white,
|
|
681
|
+
FontWeight fontWeight = FontWeight.w500,
|
|
682
|
+
}) => _textStyle(12.0, color, fontWeight, 1.3, fontFamily: fontFamily);
|
|
683
|
+
|
|
684
|
+
// Helper method for text styles
|
|
685
|
+
static TextStyle _textStyle(
|
|
686
|
+
double fontSize,
|
|
687
|
+
Color color,
|
|
688
|
+
FontWeight fontWeight,
|
|
689
|
+
double? height, {
|
|
690
|
+
required String fontFamily,
|
|
691
|
+
}) {
|
|
692
|
+
return TextStyle(
|
|
693
|
+
fontFamily: fontFamily,
|
|
694
|
+
fontSize: fontSize,
|
|
695
|
+
color: color,
|
|
696
|
+
fontWeight: fontWeight,
|
|
697
|
+
height: height,
|
|
698
|
+
);
|
|
699
|
+
}
|
|
402
700
|
}
|
|
403
701
|
EOF
|
|
404
702
|
|
|
@@ -410,6 +708,134 @@ class AppAssets {
|
|
|
410
708
|
}
|
|
411
709
|
EOF
|
|
412
710
|
|
|
711
|
+
cat >lib/src/utils/app_dimensions.dart <<'EOF'
|
|
712
|
+
import 'package:flutter/material.dart';
|
|
713
|
+
import 'package:get/get.dart';
|
|
714
|
+
|
|
715
|
+
class AppDimensions {
|
|
716
|
+
/// Use for padding
|
|
717
|
+
static const double top = 14;
|
|
718
|
+
static const double marginLeft = 14;
|
|
719
|
+
static const double marginRight = 14;
|
|
720
|
+
static const EdgeInsets sideMargins = EdgeInsets.symmetric(horizontal: 14);
|
|
721
|
+
static const EdgeInsets allMargins = EdgeInsets.all(14);
|
|
722
|
+
|
|
723
|
+
static const EdgeInsetsGeometry paddingTop = EdgeInsets.only(top: 280);
|
|
724
|
+
|
|
725
|
+
static const BorderRadius borderRadius = BorderRadius.all(
|
|
726
|
+
Radius.circular(12),
|
|
727
|
+
);
|
|
728
|
+
|
|
729
|
+
static double bottomBarHeight = 80 + Get.mediaQuery.padding.bottom;
|
|
730
|
+
static double iconPlusBottomBarHeight = 40;
|
|
731
|
+
static double totalBottomBarHeight =
|
|
732
|
+
bottomBarHeight + iconPlusBottomBarHeight;
|
|
733
|
+
}
|
|
734
|
+
EOF
|
|
735
|
+
|
|
736
|
+
cat >lib/src/extensions/color_extension.dart <<'EOF'
|
|
737
|
+
import 'dart:ui';
|
|
738
|
+
|
|
739
|
+
extension ColorOpacity on Color {
|
|
740
|
+
Color withOpacityX(double value) => withAlpha((value * 255).toInt());
|
|
741
|
+
}
|
|
742
|
+
EOF
|
|
743
|
+
|
|
744
|
+
cat >lib/src/extensions/int_extensions.dart <<'EOF'
|
|
745
|
+
import 'package:flutter/material.dart';
|
|
746
|
+
|
|
747
|
+
/// Tai cac UI, Widget sau nay chi can go 6.height or 6.width thay vi phai ghi SizedBox(width: 6), SizedBox(height: 6)
|
|
748
|
+
extension IntExtensions on int? {
|
|
749
|
+
/// Leaves given height of space
|
|
750
|
+
Widget get height => SizedBox(height: this?.toDouble());
|
|
751
|
+
|
|
752
|
+
/// Leaves given width of space
|
|
753
|
+
Widget get width => SizedBox(width: this?.toDouble());
|
|
754
|
+
|
|
755
|
+
/// Radius
|
|
756
|
+
Radius get radius => Radius.circular(this?.toDouble() ?? 0);
|
|
757
|
+
|
|
758
|
+
/// BorderRadius All
|
|
759
|
+
BorderRadius get borderRadiusAll =>
|
|
760
|
+
BorderRadius.circular(this?.toDouble() ?? 0);
|
|
761
|
+
|
|
762
|
+
/// BorderRadius Top
|
|
763
|
+
BorderRadius get borderRadiusTop =>
|
|
764
|
+
BorderRadius.vertical(top: (this ?? 0).radius);
|
|
765
|
+
|
|
766
|
+
/// BorderRadius Bottom
|
|
767
|
+
BorderRadius get borderRadiusBottom =>
|
|
768
|
+
BorderRadius.vertical(bottom: (this ?? 0).radius);
|
|
769
|
+
|
|
770
|
+
/// BorderRadius Left
|
|
771
|
+
BorderRadius get borderRadiusLeft =>
|
|
772
|
+
BorderRadius.horizontal(left: (this ?? 0).radius);
|
|
773
|
+
|
|
774
|
+
/// BorderRadius Right
|
|
775
|
+
BorderRadius get borderRadiusRight =>
|
|
776
|
+
BorderRadius.horizontal(right: (this ?? 0).radius);
|
|
777
|
+
|
|
778
|
+
/// Padding all
|
|
779
|
+
EdgeInsets get paddingAll => EdgeInsets.all((this ?? 0).toDouble());
|
|
780
|
+
|
|
781
|
+
/// Padding horizontal
|
|
782
|
+
EdgeInsets get paddingHorizontal =>
|
|
783
|
+
EdgeInsets.symmetric(horizontal: (this ?? 0).toDouble());
|
|
784
|
+
|
|
785
|
+
/// Padding vertical
|
|
786
|
+
EdgeInsets get paddingVertical =>
|
|
787
|
+
EdgeInsets.symmetric(vertical: (this ?? 0).toDouble());
|
|
788
|
+
|
|
789
|
+
EdgeInsets get paddingLeft => EdgeInsets.only(left: (this ?? 0).toDouble());
|
|
790
|
+
|
|
791
|
+
EdgeInsets get paddingRight => EdgeInsets.only(right: (this ?? 0).toDouble());
|
|
792
|
+
|
|
793
|
+
EdgeInsets get paddingTop => EdgeInsets.only(top: (this ?? 0).toDouble());
|
|
794
|
+
|
|
795
|
+
EdgeInsets get paddingBottom =>
|
|
796
|
+
EdgeInsets.only(bottom: (this ?? 0).toDouble());
|
|
797
|
+
}
|
|
798
|
+
EOF
|
|
799
|
+
|
|
800
|
+
cat >lib/src/extensions/string_extensions.dart <<'EOF'
|
|
801
|
+
extension NullableStringExtensions on String? {
|
|
802
|
+
/// Returns [true] if this nullable string is either null or empty.
|
|
803
|
+
bool isNullOrEmpty() {
|
|
804
|
+
return this?.trim().isEmpty ?? true;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
extension StringExtensions on String {
|
|
809
|
+
bool get isNetworkUri => startsWith('http');
|
|
810
|
+
|
|
811
|
+
bool get isSvg => endsWith('.svg');
|
|
812
|
+
|
|
813
|
+
/// Capitalize first letter of the word
|
|
814
|
+
String get inFirstLetterCaps =>
|
|
815
|
+
length > 0 ? '${this[0].toUpperCase()}${substring(1)}' : '';
|
|
816
|
+
|
|
817
|
+
/// Capitalize first letter of each word
|
|
818
|
+
String get capitalizeFirstOfEach => replaceAll(
|
|
819
|
+
RegExp(' +'),
|
|
820
|
+
' ',
|
|
821
|
+
).split(' ').map((str) => str.inFirstLetterCaps).join(' ');
|
|
822
|
+
|
|
823
|
+
/// Format thousands number to convert to double.
|
|
824
|
+
String get formatThousands => replaceAll(',', '');
|
|
825
|
+
}
|
|
826
|
+
EOF
|
|
827
|
+
|
|
828
|
+
cat >lib/src/extensions/double_extensions.dart <<'EOF'
|
|
829
|
+
extension DoubleNullExtension on double? {
|
|
830
|
+
bool get isNotNull => this != null;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
extension DouleWithoutDecimal on double? {
|
|
834
|
+
String get withoutDecimal =>
|
|
835
|
+
this != null ? (this! % 1 == 0 ? '${this!.toInt()}' : '$this') : '0';
|
|
836
|
+
}
|
|
837
|
+
EOF
|
|
838
|
+
|
|
413
839
|
cat >lib/src/utils/app_pages.dart <<EOF
|
|
414
840
|
import 'package:get/get.dart';
|
|
415
841
|
|