Skip to content

Instantly share code, notes, and snippets.

@ibrajix
ibrajix / create_column.php
Last active September 3, 2023 07:21
Add new column to migration
public function up()
{
Schema::create('todo', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('name'); //I added the name column
$table->text('description'); //I added the description column
});
}
@ibrajix
ibrajix / trending_items.dart
Created December 9, 2022 16:35
trending_items.dart
_topPickItems(){
return BlocBuilder<NftBloc, ApiState>(
builder: (context, state) {
return SizedBox(
width: MediaQuery.of(context).size.width,
height: 180,
child: ListView(
scrollDirection: Axis.horizontal,
children: state.topNft.map<Widget>((data){
return DisplayTopPick(data: data);
@ibrajix
ibrajix / home.dart
Created December 9, 2022 15:56
home.dart
return BlocConsumer<NftBloc, ApiState>(
listener: (context, state){
if(state.isError){
ScaffoldMessenger.of(context)
.showSnackBar(
SnackBar(
content: Text(state.error ?? Strings.customErrorMessage),
duration: const Duration(milliseconds: 300)
)
);
@ibrajix
ibrajix / nft_bloc.dart
Created December 9, 2022 15:53
nft_bloc
class NftBloc extends Bloc<NftEvent, ApiState> {
final NftRepository _nftRepository;
NftBloc(this._nftRepository) : super(ApiState.initial(const [], const [])) {
on<GetNftEvent>((event, emit) async {
emit(state.copyWith(
status: Status.loading
));
@ibrajix
ibrajix / welcome_screen_andoid
Last active December 9, 2022 15:43
welcome_screen_android
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/main_bg"
android:fitsSystemWindows="true"
tools:context=".ui.activities.IntroActivity">
@ibrajix
ibrajix / welcome_screen.dart
Created December 9, 2022 15:36
welcome_screen
body: Container(
width: double.infinity,
height: double.infinity,
padding: const EdgeInsets.only(top: 50, right: 20, left: 20, bottom: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
Strings.nftMarketPlace,
style: TextStyle(
@ibrajix
ibrajix / splash_screen.xml
Created December 9, 2022 15:22
splash_screen_android
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.activities.SplashScreenActivity">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animation_view"
android:layout_width="400dp"
@ibrajix
ibrajix / splash_screen.dart
Created December 9, 2022 15:16
splash_screen
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
toolbarHeight: 0,
backgroundColor: Colors.black,
elevation: 0,
),
body: Stack(
alignment: Alignment.center,
@ibrajix
ibrajix / fragment_camera
Created August 10, 2021 11:59
Camera Fragment Layout
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.fragments.CameraFragment">
<ImageView
android:id="@+id/imageView29"