1
This commit is contained in:
@@ -1,27 +1,43 @@
|
||||
import 'package:app/config/theme/base/app_theme_ext.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'viewmodel/home_view_model.dart';
|
||||
import 'widgets/header.dart';
|
||||
import 'widgets/today_card.dart';
|
||||
|
||||
class THomePage extends StatefulWidget {
|
||||
class THomePage extends StatelessWidget {
|
||||
const THomePage({super.key});
|
||||
|
||||
@override
|
||||
State<THomePage> createState() => _THomePageState();
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (_) => HomeViewModel(),
|
||||
child: const _HomeView(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _THomePageState extends State<THomePage> {
|
||||
class _HomeView extends StatelessWidget {
|
||||
const _HomeView();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final vm = context.read<HomeViewModel>();
|
||||
return Scaffold(
|
||||
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
|
||||
appBar: Header(),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 20, horizontal: context.pagePadding),
|
||||
children: [
|
||||
TodayCard(),
|
||||
],
|
||||
body: RefreshIndicator(
|
||||
onRefresh: vm.loadData,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 20,
|
||||
horizontal: context.pagePadding,
|
||||
),
|
||||
children: [
|
||||
TodayCard(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user