three_x_plus_1 1.0.0 copy "three_x_plus_1: ^1.0.0" to clipboard
three_x_plus_1: ^1.0.0 copied to clipboard

A simple set of widgets to demonstrate the mathmatical 3x + 1 conjecture.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:three_x_plus_1/three_x_plus_1.dart';

void main() {
  var mathBloc = MathBloc();

  runApp(
    Provider<MathBloc>.value(
      value: mathBloc,
      child: MyApp(),
    ),
  );
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: '3x + 1',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: '3x + 1'),
    );
  }
}

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: Column(
        children: <Widget>[
          Inputs(),
          Expanded(
            flex: 1,
            child: MathGraph(),
          ),
          SizedBox(
            height: MediaQuery.of(context).padding.bottom + 60.0,
            child: Padding(
              padding: EdgeInsets.only(
                bottom: MediaQuery.of(context).padding.bottom + 16.0,
                left: MediaQuery.of(context).padding.left + 16.0,
                right: MediaQuery.of(context).padding.right + 16.0,
                top: 16.0,
              ),
              child: StepValue(),
            ),
          ),
        ],
      ),
    );
  }
}
0
likes
120
pub points
0%
popularity

Publisher

verified publisherpeifferinnovations.com

A simple set of widgets to demonstrate the mathmatical 3x + 1 conjecture.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

charts_flutter, flutter, provider

More

Packages that depend on three_x_plus_1