52 lines
1.7 KiB
Dart
52 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:notube/constants.dart';
|
|
import 'package:notube/dlForm/dlForm.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:notube/videoList/cubit/videos_cubit.dart';
|
|
import 'package:notube/models/Video.dart';
|
|
|
|
class Home extends StatelessWidget {
|
|
Home({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text('home').tr(),
|
|
),
|
|
body: Center(
|
|
child: Container(
|
|
constraints: BoxConstraints.expand(),
|
|
decoration: BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage("assets/images/wallpaper.webp"),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
child: Column(
|
|
children: <Widget>[
|
|
SizedBox(height: 10),
|
|
Text('home_intro').tr(),
|
|
SizedBox(height: 10),
|
|
Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
|
child: DlForm()),
|
|
BlocConsumer<VideosCubit, VideosState>(
|
|
listener: (context, state) {},
|
|
builder: (context, state) {
|
|
return Column(
|
|
children: <Widget>[
|
|
for (Video video
|
|
in context.read<VideosCubit>().videoList)
|
|
Text(video.title),
|
|
],
|
|
);
|
|
}),
|
|
],
|
|
),
|
|
),
|
|
));
|
|
}
|
|
}
|