This file contains 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
_trendingItems(){ | |
return BlocBuilder<NftBloc, ApiState>( | |
builder: (context, state) { | |
final data = state.trendingNft; | |
return Container( | |
padding: const EdgeInsets.only(top: 20, bottom: 20), | |
width: MediaQuery.of(context).size.width, | |
child: ListView.builder( | |
shrinkWrap: true, | |
physics: const ClampingScrollPhysics(), |
This file contains 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
_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); |
This file contains 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
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) | |
) | |
); |
This file contains 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 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 | |
)); |
This file contains 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
<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"> | |
This file contains 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
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( |
This file contains 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
<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" |
This file contains 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
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
toolbarHeight: 0, | |
backgroundColor: Colors.black, | |
elevation: 0, | |
), | |
body: Stack( | |
alignment: Alignment.center, |
This file contains 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
@Composable | |
fun HomeScreenItems( | |
modifier: Modifier = Modifier, | |
navigator: DestinationsNavigator, | |
albums: List<Album>, | |
albumDatabaseViewModel: AlbumDatabaseViewModel = hiltViewModel(), | |
onCardClicked: (String) -> Unit, | |
onPopularAlbumClicked: () -> Unit | |
) { |
This file contains 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
@Destination(style = StartScreenTransitionAnimation::class) | |
@Composable | |
fun HomeScreen( | |
navigator: DestinationsNavigator, | |
albumDatabaseViewModel: AlbumDatabaseViewModel = hiltViewModel() | |
){ | |
.............// Check full code for other variables | |
HomeScreenItems(navigator = navigator, albums = albums.value, |
NewerOlder