nv_tooling 0.2.2+2 copy "nv_tooling: ^0.2.2+2" to clipboard
nv_tooling: ^0.2.2+2 copied to clipboard

An assortment of useful classes used for development at NonVanilla.

example/lib/main.dart

import 'package:example/data/data.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text('Fake HTTP call'),
            Text(
              Data().getWeather().access(
                    (success) => 'weather: ${success.weather}\n'
                        'chance of rain: ${success.propRain}\n'
                        'temperature: ${success.tempInDegrees}',
                    (failure) => failure.map(
                      noConnection: (_) =>
                          'Make sure you\'re connected to the internet!',
                      unauthorized: (_) => 'You are not allowed to view this!',
                    ),
                  ),
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
    );
  }
}
2
likes
140
pub points
0%
popularity

Publisher

verified publisherlunaticcoding.com

An assortment of useful classes used for development at NonVanilla.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

collection, flutter

More

Packages that depend on nv_tooling