Skip to content

Commit 2b44461

Browse files
feat: Web condition for random Pokemon GIF
1 parent 2a6ff6b commit 2b44461

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

lib/shared/ui/widgets/app_bar.dart

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import 'package:flutter/foundation.dart';
12
import 'package:flutter/material.dart';
23
import 'package:lottie/lottie.dart';
34
import 'package:pokedex/shared/ui/widgets/animated_pokeball.dart';
45
import 'package:pokedex/theme/app_theme.dart';
56

67
import '../../utils/app_constants.dart';
8+
import '../enums/device_screen_type.dart';
79

810
class AppBarWidget extends StatefulWidget {
911
final String title;
@@ -61,13 +63,17 @@ class _AppBarWidgetState extends State<AppBarWidget> {
6163
width: 5,
6264
),
6365
Text(widget.title, style: textTheme.headline1),
64-
SizedBox(
65-
width: 5,
66-
),
67-
Image.network(
68-
AppConstants.getRandomPokemonGif(),
69-
height: 32,
70-
)
66+
if (kIsWeb &&
67+
getDeviceScreenType(context) != DeviceScreenType.CELLPHONE)
68+
SizedBox(
69+
width: 5,
70+
),
71+
if (kIsWeb &&
72+
getDeviceScreenType(context) != DeviceScreenType.CELLPHONE)
73+
Image.network(
74+
AppConstants.getRandomPokemonGif(),
75+
height: 32,
76+
)
7177
],
7278
),
7379
),

0 commit comments

Comments
 (0)