This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| import 'dart:io'; | |
| import 'dart:typed_data'; | |
| import 'package:camera/camera.dart'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter_screenutil/flutter_screenutil.dart'; | |
| import 'package:google_mlkit_face_detection/google_mlkit_face_detection.dart'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| Employee emp1 = employee(EmployeeTypes.salesman); | |
| print(emp1.type.name); | |
| } | |
| // Replace Conditional with ploymorphism | |
| Employee employee(EmployeeTypes type) { | |
| switch (type) { | |
| case EmployeeTypes.salesman: | |
| return Salesman(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main(){ | |
| final Employee emp1 = Employee(EmployeeTypes.engineer); | |
| emp1.work(); | |
| } | |
| class Employee { | |
| late final EmployeeStrategy _strategy; | |
| Employee(EmployeeTypes type){ | |
| _setStrategy(type); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:either_dart/either.dart'; | |
| import '../exceptions/exceptions.dart'; | |
| Either<AppException, E> transform<E>( | |
| dynamic data, E Function(Map<String, dynamic>) transformer) { | |
| try { | |
| return Right(transformer(data)); | |
| } on TypeError { | |
| return Left(ObjectParseException()); | |
| } catch (e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:aku_staff_agent/ui/shared/app_colors.dart'; | |
| import 'package:aku_staff_agent/ui/shared/app_text_styles.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter_screenutil/flutter_screenutil.dart'; | |
| class AndroidDropdown extends StatefulWidget { | |
| final List<String> items; | |
| final String? hintText; | |
| final ValueChanged<String?>? onChanged; | |
| final Color? dropIconColor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatefulWidget { | |
| @override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| final userAccount = | |
| Account(accountName: 'Femi Adebayo', accountNumber: '1011234355'); | |
| userAccount.deposit(20000); | |
| print('Account Balance: ${userAccount.availableBalance}\n'); | |
| userAccount.withdraw(4000); | |
| print('Account Balance: ${userAccount.availableBalance}\n'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension StringCheckers on String? { | |
| bool get isBlank { | |
| final value = this?.trim(); | |
| if (value == null || value.isEmpty){ | |
| return true; | |
| } | |
| return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AnimatingIcon extends StatefulWidget { | |
| const AnimatingIcon({super.key, this.onTap}); | |
| final VoidCallback? onTap; | |
| @override | |
| State<AnimatingIcon> createState() => _AnimatingIconState(); | |
| } | |
| class _AnimatingIconState extends State<AnimatingIcon> | |
| with SingleTickerProviderStateMixin { |