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:dartz/dartz.dart'; | |
class EitherExample { | |
Future<Either<Failure, Entity>> handle() async { | |
try{ | |
Entity entity = new Entity() | |
if(entity.document == null) throw Exception("Document is null"); | |
return Right(entity); | |
}catch(error){ |
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 CustomAppBar extends PreferredSize { | |
@override | |
Size get preferredSize => Size.fromHeight(50); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
height: preferredSize.height, | |
color: Colors.white, | |
alignment: Alignment.center, | |
child: SafeArea( |
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
Get.bottomSheet( | |
SingleChildScrollView( | |
child: Container( | |
decoration: BoxDecoration( | |
color: Colors.white, | |
borderRadius: BorderRadius.only( | |
topLeft: Radius.circular(10), | |
topRight: Radius.circular(10), | |
), | |
), |
NewerOlder