refactor codes
This commit is contained in:
@@ -28,35 +28,7 @@ class MobileHomePage extends StatelessWidget {
|
||||
}
|
||||
|
||||
if (homeViewModel.errorMessage != null) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error_outline,
|
||||
size: 64,
|
||||
color: Colors.red,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
homeViewModel.errorMessage!,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.grey.shade700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
ElevatedButton(
|
||||
onPressed: () => homeViewModel.getHome(),
|
||||
child: const Text('Try Again'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
return Center(child: Text(homeViewModel.errorMessage!));
|
||||
}
|
||||
|
||||
return SingleChildScrollView(
|
||||
|
||||
Reference in New Issue
Block a user