mirror of
https://github.com/hmalik144/easy_cc_flutter.git
synced 2025-12-10 03:05:34 +00:00
Layout created for single screen app (#2)
This commit is contained in:
9
lib/Utils/Constants.dart
Normal file
9
lib/Utils/Constants.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
const Color colourOne = Color(0xFF253031);
|
||||
const Color colourTwo = Color(0xFF315659);
|
||||
const Color colourThree = Color(0xFF2978A0);
|
||||
const Color colourFour = Color(0xFF8549ff);
|
||||
const Color colourFive = Color(0xFFC6E0FF);
|
||||
|
||||
const double PADDING_GLOBAL = 12;
|
||||
20
lib/Utils/ViewState.dart
Normal file
20
lib/Utils/ViewState.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:sealed_annotations/sealed_annotations.dart';
|
||||
|
||||
@Sealed()
|
||||
abstract class ViewState {}
|
||||
|
||||
class Idle implements ViewState {}
|
||||
|
||||
class HasStarted implements ViewState {}
|
||||
|
||||
class HasData implements ViewState {
|
||||
final dynamic data;
|
||||
|
||||
HasData(this.data);
|
||||
}
|
||||
|
||||
class HasError implements ViewState {
|
||||
final String error;
|
||||
|
||||
HasError(this.error);
|
||||
}
|
||||
18
lib/Utils/ViewUtils.dart
Normal file
18
lib/Utils/ViewUtils.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
|
||||
class ViewUtils{
|
||||
|
||||
static displayToast(BuildContext context, String message){
|
||||
Toast.show(
|
||||
message,
|
||||
duration: Toast.lengthLong,
|
||||
gravity: Toast.bottom
|
||||
);
|
||||
}
|
||||
|
||||
static displayToastDeferred(BuildContext context, String message){
|
||||
WidgetsBinding.instance.addPostFrameCallback(
|
||||
(_) => displayToast(context, message));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user