coder0211 0.0.45 copy "coder0211: ^0.0.45" to clipboard
coder0211: ^0.0.45 copied to clipboard

This is a package with functions and widgets to make app development faster and more convenient, currently it is developed by one developer.

example/example.dart

import 'package:coder0211/coder0211.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:mobx/mobx.dart';

part 'example_store.g.dart';

void main() {
  runApp(const MyApp());
}

/// Clean before updating:
///    flutter packages pub run build_runner watch --delete-conflicting-outputs
class ExampleStore = _ExampleStore with _$ExampleStore;

abstract class _ExampleStore with Store {
  @observable
  int _ic = 0;

  int get ic => _ic;

  set ic(int ic) {
    _ic = ic;
  }

  List<int> lists = [];

  @observable
  ObservableList<int> listsInt = ObservableList<int>();

  @action
  ice() {
    ic++;
  }
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [Provider<ExampleStore>(create: (context) => ExampleStore())],
      child: MaterialApp(
        home: const Example(),
      ),
    );
  }
}

class Example extends BaseScreen {
  const Example({Key? key}) : super(key: key);

  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends BaseScreenState<Example, ExampleStore> {
  @override
  Widget build(BuildContext context) {
    super.build(context);
    return Scaffold(
      appBar: AppBar(),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Container(
              width: 1.0.w(context),
            ),
            Observer(builder: (_) {
              return Text(
                '${store.ic}',
                style: Theme.of(context).textTheme.headline4,
              );
            }),
            'heelo'.d1()
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          store.ice();
        },
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
29
likes
0
pub points
0%
popularity

Publisher

unverified uploader

This is a package with functions and widgets to make app development faster and more convenient, currently it is developed by one developer.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

auto_size_text, connectivity, dio, flutter, flutter_mobx, flutter_svg, fluttertoast, google_fonts, image_picker, loading_indicator, mobx, provider, qr_flutter, shared_preferences

More

Packages that depend on coder0211