Axborot texnologiyalari va kommunikatsiyalarini rivojlantirish vazirligi muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti



Yüklə 306,31 Kb.
səhifə1/2
tarix15.12.2022
ölçüsü306,31 Kb.
#75214
  1   2
Olimov mobil


AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI
MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI


“Mobil ilovalarni ishlab chiqish”
fanidan


MUSTAQIL ISH


Mavzu: Futbal natijalarini ko’rsatuvchi dastur

Bajardi: MAD002-guruh talabasi


Olimov Xajixon
Tekshirdi: Egamberdiev N .A


Toshkent 2022


Flutterda mobil ilova yaratish.
Futbal natijalarini ko’rsatuvchi dastur yaratamiz:
splash_screen.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'home_screen.dart';

class SplashScreen extends StatefulWidget {


const SplashScreen({Key? key}) : super(key: key);

@override


_SplashScreenState createState() => _SplashScreenState();
}

class _SplashScreenState extends State {


@override
void initState() {
super.initState();
Timer(
const Duration(seconds: 2),
() => Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const HomeScreen(),
),
),
);
}

2-rasm

has_internet.dart


import 'dart:io';
import 'package:flutter/material.dart';
import 'home_screen.dart';
class HasInternet extends StatefulWidget {
const HasInternet({Key? key}) : super(key: key);

@override


State createState() => _HasInternetState();
}

bool isConnect = false;

class _HasInternetState extends State {
hasInternet() async {
try {
final result = await InternetAddress.lookup('example.com');
if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) {
setState(() {
isConnect = true;
});
}
} on SocketException catch (_) {
isConnect = false;
}
}

3-ram
home_screen.dart
import 'package:flutter/material.dart';
import 'package:football_score/screens/league_container.dart';

class HomeScreen extends StatefulWidget {


const HomeScreen({Key? key}) : super(key: key);

@override


HomeScreenState createState() => HomeScreenState();
}



4-rasm

table_screen.dart


import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:football_score/Screens/information_screen.dart';
import 'package:http/http.dart' as http;

class TableScreen extends StatefulWidget {


const TableScreen({Key? key, required this.code}) : super(key: key);

final String code;

@override
_TableScreenState createState() => _TableScreenState();
}

5-rasm
information_page.dart


import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:http/http.dart' as http;

class InformationPage extends StatefulWidget {


const InformationPage({Key? key, required this.id, required this.code})
: super(key: key);

final String id, code;

@override
_InformationPageState createState() => _InformationPageState();
}

6-rasm




Yüklə 306,31 Kb.

Dostları ilə paylaş:
  1   2




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