Mavzu: Androidda “ World Countries ” mobil ilovasini yaratish. Kirish



Download 4,64 Mb.
bet41/42
Sana31.12.2021
Hajmi4,64 Mb.
#257886
1   ...   34   35   36   37   38   39   40   41   42
Bog'liq
bmi new

main.dart

import 'package:flutter/material.dart';


import 'package:provider/provider.dart';
import 'package:shop_app/splash/splash_screen.dart';
import 'package:shop_app/provider/country_provider.dart';
import 'package:shop_app/routs.dart';
import 'package:shop_app/theme.dart';

void main() {


runApp(MyApp());
}

class MyApp extends StatelessWidget {


@override
Widget build(BuildContext context) => ChangeNotifierProvider(
create: (context) => CountryProvider(),

child: MaterialApp(


title: 'World Countries',
theme: theme(),
debugShowCheckedModeBanner: false,
initialRoute: SplashScreen.routeName,
routes: routes,
),
);
}
routs.dart

import 'package:flutter/widgets.dart';


import 'package:shop_app/example_screen.dart';
import 'package:shop_app/home/home_screen.dart';
import 'package:shop_app/splash/splash_screen.dart';
import 'example_screen.dart';
final Map routes = {
SplashScreen.routeName: (context) => SplashScreen(),
HomeScreen.routeName: (context) => HomeScreen(),
ExampleScreen.routeName: (context) => ExampleScreen(),
};
size_config.dart

import 'package:flutter/widgets.dart';

class SizeConfig {
static MediaQueryData _mediaQueryData;
static double screenWidth;
static double screenHeight;
static double defaultSize;
static Orientation orientation;

void init(BuildContext context) {


_mediaQueryData = MediaQuery.of(context);
screenWidth = _mediaQueryData.size.width;
screenHeight = _mediaQueryData.size.height;
orientation = _mediaQueryData.orientation;
}
}

// Get the proportionate height as per screen size


double getProportionateScreenHeight(double inputHeight) {
double screenHeight = SizeConfig.screenHeight;
// 812 is the layout height that designer use
return (inputHeight / 812.0) * screenHeight;
}

// Get the proportionate height as per screen size


double getProportionateScreenWidth(double inputWidth) {
double screenWidth = SizeConfig.screenWidth;
// 375 is the layout width that designer use
return (inputWidth / 375.0) * screenWidth;
}

Download 4,64 Mb.

Do'stlaringiz bilan baham:
1   ...   34   35   36   37   38   39   40   41   42




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

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish