基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import 'package:flutter/foundation.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:zhiying_base_widget/pages/home_page/home_page.dart';
  4. import 'package:provider/provider.dart';
  5. import 'package:zhiying_base_widget/register.dart';
  6. import 'package:zhiying_comm/zhiying_comm.dart';
  7. import 'package:flutter_alibc/flutter_alibc.dart';
  8. void main() {
  9. FlutterError.onError = (FlutterErrorDetails details) {
  10. FlutterError.dumpErrorToConsole(details);
  11. print(details.exceptionAsString());
  12. // if (kReleaseMode) exit(1);
  13. };
  14. runApp(MyApp());
  15. }
  16. class MyApp extends StatefulWidget {
  17. @override
  18. _MyAppState createState() => _MyAppState();
  19. }
  20. class _MyAppState extends State<MyApp> {
  21. Widget getErrorWidget(BuildContext context, FlutterErrorDetails error) {
  22. return Center(
  23. child: Text(
  24. "走神了~\n${error.exceptionAsString()}",
  25. style:
  26. Theme
  27. .of(context)
  28. .textTheme
  29. .title
  30. .copyWith(color: Colors.redAccent),
  31. ),
  32. );
  33. }
  34. @override
  35. void initState() {
  36. super.initState();
  37. print('初始化~~~~');
  38. BaseWidgetRegister.init();
  39. FlutterAlibc.initAlibc(version: "", appName: "").then((result) {
  40. Logger.debug('${result.errorCode} ${result.errorMessage}');
  41. });
  42. }
  43. @override
  44. Widget build(BuildContext context) {
  45. ErrorWidget.builder = (FlutterErrorDetails errorDetails) {
  46. return getErrorWidget(context, errorDetails);
  47. };
  48. return MultiProvider(
  49. providers: [
  50. ChangeNotifierProvider.value(value: UserInfoNotifier()),
  51. ],
  52. child: MaterialApp(
  53. home: HomePage(),
  54. ),
  55. );
  56. }
  57. }