webservice 0.0.4 webservice: ^0.0.4 copied to clipboard
A powerful Http client for Dart, which handles requests. Super easy to use and much more comming soon. Wait for our updates.
import 'package:flutter/material.dart';
import 'package:webservice/webservice.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'WebService',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
super.initState();
}
getData(){
WebService().get(url: "https://dummyjson.com/products", onResponse: (response){
print('${response.statusCode} ${response.message} ${response.data}');
});
}
@override
Widget build(BuildContext context) {
return const Scaffold();
}
}