“Mobil ilovalarni ishlab chiqish” fanidan


final mainWeather = weather.main.toLowerCase()


Download 1.58 Mb.
bet5/9
Sana14.04.2023
Hajmi1.58 Mb.
#1358106
1   2   3   4   5   6   7   8   9
Bog'liq
1-lab mobil

;
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

Download 1.58 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling