fluttery_framework 4.0.0+5 fluttery_framework: ^4.0.0+5 copied to clipboard
Provides all the functions and features needed for a typical production app.
Fluttery Framework #
A Framework for Flutter's Framework #
Allows for faster and easier development with better maintainability. It looks like Flutter and works like Flutter. There's no 're-inventing of the wheel' or an extra learning curve.
It supplies the adaptive functions and features expected of a production-ready app:
- Necessarily error handling capabilities
- Allow for both a Material & Cupertino interface
- Easily accessible system preferences
- Built-in app notifications
- A better menu bar
- Built-in device event handling
- A date picker
- A color theme picker
- An array dialog windows
- A customizable bottom bar
- A loading screen option
Installing #
I don't like the version number suggested in the 'Installing' page. Instead, always go up to the 'minor' semantic version number when installing this library package. This means always trailing with one zero, '.0'. This allows you to take in any 'patch' versions that involves bugfixes.
For example, when installing version 7.9.2, use 7.9.0. That means, the bug fix, 7.9.3, will be installed the next time you 'upgrade' your dependencies.
Fluttery Framework Documentation #
Turn to this free Medium article for an overview of the package:
Example Code: #
(Copy & paste and try it out.)
The Counter App
import 'package:fluttery_framework/view.dart';
import 'package:fluttery_framework/controller.dart';
void main() => runApp(MyApp());
class MyApp extends AppStatefulWidget {
MyApp({Key? key}) : super(key: key);
@override
AppState createAppState() => View();
}
class View extends AppState {
View()
: super(
title: 'Flutter Demo',
home: const MyHomePage(),
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
);
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, this.title = 'Flutter Demo Home Page'})
: super(key: key);
// Fields in a StatefulWidget should always be "final".
final String title;
@override
State createState() => _MyHomePageState();
}
class _MyHomePageState extends StateX<MyHomePage> {
_MyHomePageState() : super(controller: Controller()) {
con = controller as Controller;
}
late Controller con;
@override
Widget buildAndroid(BuildContext context) => Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text('You have pushed the button this many times:'),
Text(
'${con.counter}',
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
/// Try this alternative approach.
/// The Controller merely mimics the Flutter's API
// onPressed: con.onPressed,
onPressed: () => setState(con.incrementCounter),
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
class Controller extends StateXController {
factory Controller() => _this ??= Controller._();
Controller._()
: _model = _Model(),
super();
static Controller? _this;
final _Model _model;
/// You're free to mimic Flutter's own API
/// The Controller is able to talk to the View (the State object)
void onPressed() => setState(() => _model._incrementCounter());
int get counter => _model.integer;
/// The Controller knows how to 'talk to' the Model.
void incrementCounter() => _model._incrementCounter();
}
class _Model {
int get integer => _integer;
int _integer = 0;
int _incrementCounter() => ++_integer;
}