metal 0.0.1 copy "metal: ^0.0.1" to clipboard
metal: ^0.0.1 copied to clipboard

A flutter http client for easy use and state management when working with rest apis

example/lib/main.dart

import 'package:dio/dio.dart';
import 'package:example/user_ore.dart';
import 'package:flutter/material.dart';
import 'package:metal/metal.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(title: 'Metal Example', home: Home());
  }
}

class Home extends StatefulWidget {
  const Home({Key? key}) : super(key: key);

  @override
  State<Home> createState() => _HomeState();
}

class _HomeState extends State<Home> {
  final userMetal = Metal.explore(
      uri: Dio(BaseOptions(baseUrl: 'google.com')), ore: UserOre());

  @override
  Widget build(BuildContext context) {
    final size = MediaQuery.of(context).size;
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: Text(
          'Metal Example',
          style: Theme.of(context)
              .textTheme
              .headline6
              ?.copyWith(color: Colors.white),
        ),
        actions: const <Widget>[
          Padding(
            padding: EdgeInsets.only(right: 20),
            child: Icon(
              Icons.error_outline,
              color: Colors.white,
            ),
          )
        ],
      ),
      body: SizedBox(
        width: size.shortestSide,
        height: size.longestSide,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[],
        ),
      ),
    );
  }
}
1
likes
140
pub points
0%
popularity

Publisher

verified publisherwavercode.com

A flutter http client for easy use and state management when working with rest apis

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dio, flutter, get

More

Packages that depend on metal