Skip to content

Instantly share code, notes, and snippets.

@vijayinyoutube
Created June 4, 2022 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijayinyoutube/c74e53e11a366fda9356a08301fc3af7 to your computer and use it in GitHub Desktop.
Save vijayinyoutube/c74e53e11a366fda9356a08301fc3af7 to your computer and use it in GitHub Desktop.
import 'package:flutter_dotenv/flutter_dotenv.dart';
import '../API/base_client.dart';
import '../Models/home_page_model.dart';
abstract class DemoRepository {
Future<DemoModel> fetchData();
}
class DemoRepo extends DemoRepository {
@override
Future<DemoModel> fetchData() async {
final response =
await BaseClient().get('${(dotenv.env['API_BASE_URL'])}/todos/1');
return DemoModel.fromJson(response);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment