“Mobil ilovalarni ishlab chiqish” fanidan


final mainWeather = weather.main.toLowerCase()



Yüklə 1,58 Mb.
səhifə5/9
tarix17.06.2023
ölçüsü1,58 Mb.
#132099
1   2   3   4   5   6   7   8   9
“Mobil ilovalarni ishlab chiqish” fanidan

;
final mainWeather = weather.main.toLowerCase();
String imagePath = '';
if (mainWeather.contains('rain')) {
imagePath = 'assets/rainy.jpg';
} else if (mainWeather.contains('sun')) {
imagePath = 'assets/sunny.jpg';
} else if (mainWeather.contains('cloud')) {
imagePath = 'assets/cloudy.jpeg';
} else {
imagePath = 'assets/night.jpg';
}
return Stack(
children: [
Image.asset(
imagePath,
fit: BoxFit.cover,
height: double.infinity,
width: double.infinity,
),
Container(
color: Colors.black.withOpacity(0.4),
),
WeatherMenu(getWeather: _getWeather),
SafeArea(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
CityPart(
weather: weather,
),
Temperature(
weather: weather,
),
],
),
),
),
],
);
}
return Container();
},
),
);
}
}

import 'package:flutter/material.dart';



class SearchScreen extends StatelessWidget {
SearchScreen({Key? key}) : super(key: key);

static const routeName = '/search_city';

final _formKey = GlobalKey();
String? _city;

void _submit(BuildContext context) {
if (_formKey.currentState!.validate()) {
_formKey.currentState!.save();

Navigator.of(context).pop(_city);
}
}

@override


Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true

Yüklə 1,58 Mb.

Dostları ilə paylaş:
1   2   3   4   5   6   7   8   9




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin