123456789101112131415161718192021222324252627282930313233343536 |
- 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: "帕萨特"),
- CarModel(id: 3, brand: "大众", type: "迈腾"),
- CarModel(id: 4, brand: "大众", type: "途观", start: true),
- CarModel(id: 5, brand: "大众", type: "途昂"),
- CarModel(id: 6, brand: "大众", type: "途岳", start: true),
- CarModel(id: 7, brand: "大众", type: "途铠"),
- CarModel(id: 8, brand: "大众", type: "途锐", start: true),
- CarModel(id: 9, brand: "大众", type: "途昂X"),
- CarModel(id: 10, brand: "大众", type: "途岳X", start: true),
- CarModel(id: 11, brand: "大众", type: "途铠X"),
- CarModel(id: 12, brand: "大众", type: "途观L"),
- ];
- }
- /// 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);
- }
- }
|