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: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
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 { |
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:math'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: 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
/// Example Usage | |
class MyWidget extends StatefulWidget { | |
const MyWidget({super.key}); | |
@override | |
State<MyWidget> createState() => _MyWidgetState(); | |
} | |
class _MyWidgetState extends State<MyWidget> { | |
double _progress = 1; |