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

discontinued

A Flutter package enables to easily build Flutter Single-Page Application (SPA) using component and imperative programming model.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:tilde/tilde.dart';

void main() => runApp(MaterialApp(home: ~MyApp()));

class MyApp extends SPA {
  final _counter = Counter();

  @override
  Widget onNavigate(BuildContext context) => Scaffold(
        appBar: AppBar(
          title: const Text('Flutter Demo Home Page'),
        ),
        body: ~_counter,
        floatingActionButton: FloatingActionButton(
          onPressed: () => _counter.increment(),
          tooltip: 'Increment',
          child: const Icon(Icons.add),
        ),
      );
}

class Counter extends Component {
  int _count = 0;

  void increment() => setState(() => _count++);

  @override
  Widget render(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          const Text(
            'You have pushed the button this many times:',
          ),
          Text(
            '$_count',
            style: Theme.of(context).textTheme.headlineMedium,
          ),
          ElevatedButton(
            onPressed: () => setState(() => _count = 0),
            child: const Text('Reset'),
          ),
        ],
      ),
    );
  }
}
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A Flutter package enables to easily build Flutter Single-Page Application (SPA) using component and imperative programming model.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

event, eventsubscriber, flutter, url_router

More

Packages that depend on tilde