framework 1.0.3 copy "framework: ^1.0.3" to clipboard
framework: ^1.0.3 copied to clipboard

While the traditional framework is no longer needed in order to learn the difference between the StatelessWidget and StatefulWidget classes.

example/main.dart

import 'package:flutter/material.dart';
import 'package:framework/base_app.dart';
import 'package:framework/provider.dart';
import 'package:framework/shared_model.dart';

import './navigator.dart';
import './splash.dart';

void main() async {
  runApp(TestAppState().createApp());
}

class TestAppState extends BaseAppState {
  TestAppState()
      : super(SharedModel(
            navigator:
                TestNavigator())); //Implement your own ShareModel and Navigator class.

  Future<dynamic> downloadAssetsAndData() async {
    //Write your logic here
    await Future.delayed(const Duration(seconds: 1));
    return null;
  }

  @override
  Widget build(BuildContext context) {
    return Provider(
        appWidget: this,
        sharedModel: sharedModel,
        child: MaterialApp(
          onGenerateRoute: sharedModel.navigator.onGenerateRoute as RouteFactory?,
          theme: sharedModel.theme,
          locale: sharedModel.locale,
          debugShowCheckedModeBanner: false,
          title: 'Test App',
          home: FutureBuilder<dynamic>(
            future: downloadAssetsAndData(),
            builder: (ctx, snapshot) {
              if (snapshot.connectionState == ConnectionState.done) {
                goNext(ctx, TestNavigator.LOGIN);
              }
              return const SplashWidget();
            },
          ),
        ));
  }
}
4
likes
150
points
44
downloads

Publisher

verified publishersoftigent.com

Weekly Downloads

While the traditional framework is no longer needed in order to learn the difference between the StatelessWidget and StatefulWidget classes.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on framework