quick_flutter 0.0.2 copy "quick_flutter: ^0.0.2" to clipboard
quick_flutter: ^0.0.2 copied to clipboard

帮助你快速构建flutter项目,集成Provider打造MVVM模式

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:quick_flutter/quick_flutter.dart';

import 'ui/page/home/home_page.dart';

Future<void> main() async {
  /// 初始化Sp
  WidgetsFlutterBinding.ensureInitialized();
  SpUtil.getInstance();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    _init();
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      builder: EasyLoading.init(),
      home: HomePage(),
    );
  }

  void _init() {
    EasyLoading.instance
      ..displayDuration = const Duration(milliseconds: 2000)
      ..indicatorType = EasyLoadingIndicatorType.ring
      ..loadingStyle = EasyLoadingStyle.custom
      ..indicatorColor = Color(0xffeeeeee)
      ..indicatorSize = 45.0
      ..radius = 10.0
      ..progressColor = Colors.blue
      ..backgroundColor = Color(0xff222222)
      ..lineWidth = 2.0
      ..textColor = Colors.white
      ..maskColor = Colors.grey.withOpacity(0.5)
      ..userInteractions = false
      ..dismissOnTap = false;
  }
}
1
likes
80
pub points
0%
popularity

Publisher

unverified uploader

帮助你快速构建flutter项目,集成Provider打造MVVM模式

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

connectivity, dio, flutter, fluttertoast, path_provider, provider, shared_preferences, synchronized

More

Packages that depend on quick_flutter