我怎样才能让这个应用程序进入提供者?

问题描述

我怎样才能让这个应用程序进入提供者? 此应用程序将是我的最终项目,我需要与提供商合作,以查看我从“timpano.dart”文件中按钮上的“kemikyolu.dart”文件中的下拉按钮获得的数据。你能帮我吗?

kemikyolu.dart


class AnaEkran3 extends StatefulWidget {
  @override
  _AnaEkran3State createState() => _AnaEkran3State();
}

class _AnaEkran3State extends State<AnaEkran3> {
  List<int> kemikSayilar = [
    -10,-5,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,];

  int sagKemik500;
  int sagKemik1000;
  int solKemik500;
  int solKemik1000;





  @override
  Widget build(BuildContext context) {
    return Container(
      child: Form(
        child: Column(
          children: [
            Padding(
              padding: EdgeInsets.all(3),),Text("Lütfen Kemik Yolu iştme Eşik Değerlerini giriniz"),Padding(
              padding: EdgeInsets.all(6),Row(
              mainAxisAlignment: MainAxisAlignment.spaceAround,children: [
                Container(
                  child: DropdownButtonHideUnderline(
                    child: DropdownButton<int>(
                      hint: Text("500 Hz için"),dropdownColor: Colors.lightBlue[300],items: kemikSayilar.map((oAnkiSayi) {
                        return DropdownMenuItem<int>(
                          child: Text("$oAnkiSayi"),value: oAnkiSayi,);
                      }).toList(),onChanged: (i) {
                        setState(() {
                          sagKemik500 = i;
                        });
                      },value: sagKemik500,padding: EdgeInsets.symmetric(horizontal: 10,vertical: 4),decoration: Boxdecoration(
                    border: Border.all(width: 1),color: Colors.lightBlue[300],borderRadius: BorderRadius.all(
                      Radius.elliptical(30,24),Container(
                  child: DropdownButtonHideUnderline(
                    child: DropdownButton<int>(
                      hint: Text("500 Hz için"),dropdownColor: Colors.red,onChanged: (i) {
                        setState(() {
                          solKemik500 = i;
                        });
                      },value: solKemik500,color: Colors.red,],);
  }
}

定音鼓.dart

import 'package:provider/provider.dart';

import 'package:Flutter/material.dart';
import 'package:Flutter_deneme/sonucSayfasi.dart';
import 'package:Flutter_deneme/veriler.dart';

class AnaEkran4 extends StatefulWidget {
  @override
  _AnaEkran4State createState() => _AnaEkran4State();
}

class _AnaEkran4State extends State<AnaEkran4> {

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(5),child: Scaffold(
        body: ListView(
          children: [
            Column(
              children: [
                Padding(
                  padding: EdgeInsets.all(3),FlatButton(
                  color: Colors.black,onpressed: () {
                    Navigator.of(context).push(MaterialPageRoute(
                        builder: (context) => ChangeNotifierProvider<Veriler>(
                                  create: (_) => Veriler(),child: SonucSayfasi(),);
                  }
                ),]
        ),);
  }
}

sonucSayfasi.dart



class SonucSayfasi extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(

      appBar: AppBar(
        title: Text("Sonuç Ekranı"),body: ListView(
        children:[
        Column(
          children: [

             Center(child: Text("İşitme testi sonucunuz:"))
            ],);
  }
}

veriler.dart


class Veriler with ChangeNotifier{

  int sagKemik500,sagKemik1000,sagKemikOrt,solKemik500,solKemik1000,solKemikOrt;



  void sagKemikHesapla(){
    sagKemikOrt= ((sagKemik500+sagKemik1000)/2).todouble() as int;
    notifyListeners();
  }
  void solKemikHesapla(){
    solKemikOrt= ((solKemik500+solKemik1000)/2).todouble() as int;
    notifyListeners();
  }

}

anasayfa.dart


class AnaEkran extends StatefulWidget {
  @override
  _AnaEkranState createState() => _AnaEkranState();
}

class _AnaEkranState extends State<AnaEkran> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Center(
        child: Column(children: [
          Center(
            child: Text("Anasayfa"),)
        ]),);
  }
}

main.dart

import 'package:Flutter/material.dart';
import 'package:Flutter_deneme/veriler.dart';

import 'anasayfa.dart';
import 'package:provider/provider.dart';

import 'kemikyolu.dart';
import 'sonucSayfasi.dart';
import 'timpano.dart';

void main() => runApp(MultiProvider(
    providers: [
      ChangeNotifierProvider(create: (context) => Veriler(),)
    ],child: MyApp(),);

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: DefaultTabController(
        length:3,child: Scaffold(

            appBar: AppBar(
              bottom: TabBar(tabs: [
                Tab(icon: Icon(Icons.home_filled)),Tab(icon: Icon(Icons.book_rounded)),Tab(icon: Icon(Icons.east)),]),title: Text("Odyo Hesaplama"),drawer: MyDrawer(),body: TabBarView(
              children: [
                AnaEkran(),AnaEkran3(),AnaEkran4(),);
  }
}

class MyDrawer extends StatelessWidget {
  const MyDrawer({
    Key key,}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Drawer(
      child: ListView(
        children: [
          DrawerHeader(
            child: Text("Odyo Hesaplama"),decoration: Boxdecoration(color: Colors.red),ListTile(
            title: Text("Ana Sayfa"),onTap: () {
              Navigator.pushNamed(context,"/");
            },ListTile(
            title: Text("Hakkımızda"),"/hakkimizda");
            },ListTile(
            title: Text("İletişim"),"/iletisim");
            },);
  }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)