fluttery_framework 4.0.0 fluttery_framework: ^4.0.0 copied to clipboard
Provides all the functions and features needed for a typical production app.
Fluttery Framework #
A Flutter Framework's Framework #
Allows for easier and faster development with better maintainability. No 're-inventing of the wheel' using already built-in capabilities and features offered by Flutter. It looks like Flutter. It works like Flutter. Accommodating and Integrated features include:
- Error Handling
- Easy System Preferences Setup
- App Notifications
- A Better Menu Bar
- Device Event Handling
- A Date picker
- A Color picker
- An array Dialog Boxes
- A Customizable Bottom Bar
- 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. Example, when installing version 7.9.2, use 7.9.0. Thus, the bug fix, 7.9.3, will be installed the next time you 'upgrade' the dependencies.
Note, this package uses the core package:
StateX #
Documentation #
Turn to this free Medium article for a full overview of the package plus examples:
Example Code: #
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;
}