0

发生这个错误我在这个项目上工作并且我有这个错误,尝试通过多种方式解决它但是不能手动工作

我必须在这个类中调用模型,并且我想从另一个屏幕中输入值有人可以帮助我吗

import 'package:flutter/material.dart';
import 'package:login_example/CustomerCore/viewmodels/CRUDModel.dart';
import 'package:provider/provider.dart';
import 'CustomerCore/models/cstomer_payment_detailsModel.dart';
import 'CustomerCore/models/productModel.dart';
import 'CustomerCore/viewmodels/customer_paymentCRUD.dart';

class customer_payment_page extends StatefulWidget {
final Customers_Information customer_info;

customer_payment_page({@required this.customer_info});
@override
custmomer_payment createState() =>
  custmomer_payment(customer_info: customer_info);
}

class custmomer_payment extends State<customer_payment_page> {
final _formKey = GlobalKey<FormState>();

final Customers_Information customer_info;

custmomer_payment({@required this.customer_info});

final FocusNode _firstInputFocusNode = new FocusNode();
final FocusNode _secondInputFocusNode = new FocusNode();

showAlertDialog(BuildContext context) {
// set up the button
Widget okButton = FlatButton(
  child: Text("OK"),
  onPressed: () {
    // Navigator.pop(context);
  },
);

// set up the AlertDialog
AlertDialog alert = AlertDialog(
  shape: RoundedRectangleBorder(
    borderRadius: BorderRadius.circular(25.0),
  ),
  title: Text("عملية اضافة",
      style: TextStyle(color: Colors.white),
      textDirection: TextDirection.rtl),
  content: Text("تمت اضافة الزبون بنجاح",
      style: TextStyle(color: Colors.white),
      textDirection: TextDirection.rtl),
  backgroundColor: Colors.deepPurple,
  actions: [
    //   okButton,
  ],
);

// show the dialog
showDialog(
  context: context,
  builder: (BuildContext context) {
    return alert;
  },
);
 }
customer_fountshowAlertDialog(BuildContext context) {
  // set up the button
  Widget okButton = FlatButton(
  child: Text("OK"),
  onPressed: () {
    // Navigator.pop(context);
  },
  );

  // set up the AlertDialog
  AlertDialog alert = AlertDialog(
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(25.0),
    ),
  title: Text("عملية اضافة",
      style: TextStyle(color: Colors.white),
      textDirection: TextDirection.rtl),
  content: Text("هذا الاسم متواجد ",
      style: TextStyle(color: Colors.white),
      textDirection: TextDirection.rtl),
  backgroundColor: Colors.deepOrangeAccent,
  actions: [
    //   okButton,
  ],
  );

  // show the dialog
  showDialog(
  context: context,
  builder: (BuildContext context) {
    return alert;
  },
  );
}

@override
Widget build(BuildContext context) {
final customer_paymentProvider = Provider.of<customer_paymentCRUD>(context);

Future<bool> _goToLogin(BuildContext context) {
  return Navigator.of(context)
      .pushReplacementNamed('/')
      // we dont want to pop the screen, just replace it completely
      .then((_) => false);
}

return MaterialApp(
    debugShowCheckedModeBanner: false,

当我运行项目并打开此屏幕时出现此错误

在此处输入图像描述

4

0 回答 0