-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathhome_page.dart
More file actions
47 lines (39 loc) · 1.05 KB
/
home_page.dart
File metadata and controls
47 lines (39 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import 'package:flutter/material.dart';
import 'widget/categorylist.dart';
import 'widget/custom_tile.dart';
import 'widget/customappbar.dart';
import 'widget/recentnews.dart';
import 'widget/titlebar.dart';
class Homepage extends StatefulWidget {
const Homepage({Key? key}) : super(key: key);
@override
State<Homepage> createState() => _HomepageState();
}
class _HomepageState extends State<Homepage> {
String category="General";
void updateIdCategory( newCategory){
setState(() {
category=newCategory;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height:10),
CustomAppbar(),
SizedBox(height:10),
Category_List(onCategoryChanged: (String category){
updateIdCategory(category);
}
),
RecentNews(category:category),
],
),
),
);
}
}