flutter_const 0.0.3 copy "flutter_const: ^0.0.3" to clipboard
flutter_const: ^0.0.3 copied to clipboard

outdated

A Flutter package which lots of constant widget and functions which widely used in the development.

widely used flutter widgets and functions. #

Key points :
  • This package allows developers to fetch data from the server with the easiest way,
  • FcNavigator navigator that makes the navigation process much easier.
  • Remove Glow Behavior from a list view.
  • Pre-Build responsive text style
  • Horizontal and vertical dimensions SizedBox alternative
  • Double press exit function
  • Dark Mode

How to Use #

To use flutter_const, the first starts by importing the package.

import 'package:flutter_const/flutter_const.dart';

ListView No Glow #

class Demo extends StatelessWidget {
  const Demo({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: ScrollConfiguration(
        behavior: FcNoGlowBehavior(),
        child: ListView(),
      ),
    );
  }
}

Api Call #

Future<Album> fetchAlbum() async {
  ApiBaseHelper _helper = ApiBaseHelper();
  final response = await _helper.get(baseurl: 'jsonplaceholder.typicode.com', url: 'albums/2');
  return Album.fromJson(response);
}

Dark Mode #

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: FcTheme.light,
      darkTheme: FcTheme.dark,
      themeMode: ThemeMode.system,
      home: MyHomePage(),
    );
  }
}

Dark Mode

Text Style #

FcTextStyle textStyle = FcTextStyle();
ElevatedButton(
    onPressed: () {},
    child: Text(
        'move to second page',
        style: textStyle.buttonText(context),
        ),
    )

Dimensions #

// Vertical
fcVSizedBox 
fcVSizedBox1
fcVSizedBox2
fcVSizedBox3
fcVSizedBox4
fcVSizedBox5
fcVSizedBox6

// Horizantel
fcHSizedBox 
fcHSizedBox1
fcHSizedBox2
fcHSizedBox3
fcHSizedBox4
fcHSizedBox5
fcHSizedBox6

The base sized is 5 and the rest of the double the previous one

FcNavigator().push(context, screen: SecondPage());
11
likes
0
pub points
34%
popularity

Publisher

unverified uploader

A Flutter package which lots of constant widget and functions which widely used in the development.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, hive, http

More

Packages that depend on flutter_const