The argument type 'ListView Function(BuildContext, TransactionProvider, Widget)' can't be assigned to the parameter type 'Widget Function(BuildContext, dynamic, Widget?)'. มันขึ้นอย่างงนี้ เออเร่อที่ตัวขีดเส้นใต้
body: Consumer(
builder: (context, TransactionProvider provider, Widget child) {
return ListView.builder(
itemCount: 4, //จำนวนเมนูช่อง 4
import 'dart:html';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:passwordmanager/form.dart';
import 'package:passwordmanager/main.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:local_auth/local_auth.dart';
import 'package:hive/hive.dart';
import 'package:passwordmanager/transaction_provider.dart';
import 'dart:convert';
//import 'package:sqflite/sqflite.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart';
//import 'package:sqflite/sqflite.dart';
//import 'package:shared_preferences/shared_preferences.dart';
class Home extends StatefulWidget {
const Home({Key? key}) : super(key: key);
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
GlobalKey<FormState> formkey = GlobalKey<FormState>
);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.orange[100],
//ส่วนที่เป็นลิสเป็นแถวๆลงมา
appBar: AppBar(
//เมนู
backgroundColor: Colors.orange,
title: Text("Password Manager"),
leading: GestureDetector(
// onTap: () {},
// child: Icon(Icons.menu),
),
actions: <Widget>[
Padding(
//ค้นหา
padding: EdgeInsets.only(right: 15.0),
child: GestureDetector(
onTap: () {
//ตรงที่กดในแถวแล้วขึ้นฟอร์ม
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => FormPage(),
));
},
child: Icon(Icons.add),
),
),
Padding(
//เมนูออก
padding: EdgeInsets.only(right: 15.0),
child: GestureDetector(
onTap: () {
showModalBottomSheet(
context: context,
builder: (context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text('out'),
//leading: Icon(Icons.add),
onTap: () {
Navigator.of(context)
.pushReplacement(MaterialPageRoute(
builder: (context) => MyApp(),
));
},
),
]);
});
},
child: Icon(Icons.more_vert),
),
),
],
actionsIconTheme: IconThemeData(color: Colors.black),
),
body: Consumer(
builder: (context, TransactionProvider provider, Widget child) {
return ListView.builder(
itemCount: 4, //จำนวนเมนูช่อง 4
itemBuilder: (context, int index) {
return Card(
elevation: 6,
margin: const EdgeInsets.all(10),
child: ListTile(
title: Text('menu'),
subtitle: Text('1235'),
),
);
});
}
));
}
}
));
}
}
ช่วยแก้โคดหน่อย
body: Consumer(
builder: (context, TransactionProvider provider, Widget child) {
return ListView.builder(
itemCount: 4, //จำนวนเมนูช่อง 4
import 'dart:html';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:passwordmanager/form.dart';
import 'package:passwordmanager/main.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:local_auth/local_auth.dart';
import 'package:hive/hive.dart';
import 'package:passwordmanager/transaction_provider.dart';
import 'dart:convert';
//import 'package:sqflite/sqflite.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart';
//import 'package:sqflite/sqflite.dart';
//import 'package:shared_preferences/shared_preferences.dart';
class Home extends StatefulWidget {
const Home({Key? key}) : super(key: key);
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
GlobalKey<FormState> formkey = GlobalKey<FormState>);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.orange[100],
//ส่วนที่เป็นลิสเป็นแถวๆลงมา
appBar: AppBar(
//เมนู
backgroundColor: Colors.orange,
title: Text("Password Manager"),
leading: GestureDetector(
// onTap: () {},
// child: Icon(Icons.menu),
),
actions: <Widget>[
Padding(
//ค้นหา
padding: EdgeInsets.only(right: 15.0),
child: GestureDetector(
onTap: () {
//ตรงที่กดในแถวแล้วขึ้นฟอร์ม
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => FormPage(),
));
},
child: Icon(Icons.add),
),
),
Padding(
//เมนูออก
padding: EdgeInsets.only(right: 15.0),
child: GestureDetector(
onTap: () {
showModalBottomSheet(
context: context,
builder: (context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Text('out'),
//leading: Icon(Icons.add),
onTap: () {
Navigator.of(context)
.pushReplacement(MaterialPageRoute(
builder: (context) => MyApp(),
));
},
),
]);
});
},
child: Icon(Icons.more_vert),
),
),
],
actionsIconTheme: IconThemeData(color: Colors.black),
),
body: Consumer(
builder: (context, TransactionProvider provider, Widget child) {
return ListView.builder(
itemCount: 4, //จำนวนเมนูช่อง 4
itemBuilder: (context, int index) {
return Card(
elevation: 6,
margin: const EdgeInsets.all(10),
child: ListTile(
title: Text('menu'),
subtitle: Text('1235'),
),
);
});
}
));
}
}
));
}
}