rlstyles 3.0.3 copy "rlstyles: ^3.0.3" to clipboard
rlstyles: ^3.0.3 copied to clipboard

Using the writing method of RN to develop fluent to reduce the nesting of hell

example/lib/main.dart

import 'package:example/components/Main/index.dart';
import 'package:example/pages/home/index.dart';
import 'package:example/pages/index/index.dart';
import 'package:example/pages/search/index.dart';
import 'package:flutter/material.dart';
import 'package:rlstyles/main.dart';

void main() {
  runApp(Main());
}

class Main extends HookWidget {
  const Main({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    getRouter() {
      return {
        '/home': (BuildContext context) => Index(),
        '/search': (BuildContext context) => Search()
      };
    }

    return ScreenUtilInit(
      designSize: const Size(375, 667),
      minTextAdapt: true,
      splitScreenMode: true,
      builder: (context, child) {
        return MaterialApp(
          routes: getRouter(),
          debugShowCheckedModeBanner: false,
          theme: ThemeData(
            primarySwatch: Colors.blue,
            textTheme: Typography.englishLike2018.apply(fontSizeFactor: 1.sp),
          ),
          home: Home(),
          initialRoute: '/home',
          builder: (context, child) {
            // ScreenUtil.setContext(context);
            return MediaQuery(
                data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
                child: child!);
          },
        );
      },
    );
  }
}
2
likes
65
pub points
0%
popularity

Publisher

unverified uploader

Using the writing method of RN to develop fluent to reduce the nesting of hell

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (LICENSE)

Dependencies

flutter, flutter_hooks, flutter_screenutil

More

Packages that depend on rlstyles