1234567891011121314151617181920212223242526 |
- import 'package:flutter_provider_demo/model/car_model.dart';
- class CarDao {
- /// get cars from sqlite
- static Future<List<CarModel>> getCars() async {
- return [
- CarModel(id: 1, brand: "大众", type: "朗逸"),
- CarModel(id: 2, brand: "大众", type: "帕萨特"),
- ];
- }
- /// add car to sqlite
- /// @param car
- /// @return
- /// @throws Exception
- static Future<int> addCar(CarModel car) async {
- return 0;
- }
- /// delete car from sqlite
- /// @param car
- /// @throws Exception
- static Future<bool> deleteCar(CarModel car) {
- return Future.value(true);
- }
- }
|