global_wings 1.0.4 copy "global_wings: ^1.0.4" to clipboard
global_wings: ^1.0.4 copied to clipboard

An awesome Flutter package to manage state of program declaratively and functionally.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:global_wings/global_wings.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    useStore('cart') ;
    // Save Data related to store 
    useStore('product') ;
    // Save Data related to product 
     
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Dev Delight'),
        ),
        body: Home(),
      ),
    );
    
  }
}



final textdecor = InputDecoration(
    fillColor: Colors.white,
    border: OutlineInputBorder(
        borderRadius: BorderRadius.circular(25.0), borderSide: BorderSide()));

class Home extends StatelessWidget {
  const Home({
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final formKey = GlobalKey<FormState>();
    return Form(
      key: formKey,
      child: Column(
        children: [
          TextFormField(
            decoration: textdecor.copyWith(labelText: 'Name'),
            onSaved: (value) => {save('name', value)},
          ),
          SizedBox(
            height: 10,
          ),
          TextFormField(
            decoration: textdecor.copyWith(labelText: 'Favorite Game'),
            onSaved: (value) => {save('game', value)},
          ),
          MaterialButton(
              child: Text('Save'),
              onPressed: () {
                formKey.currentState.save();
                final snackbar = SnackBar(content: Text(serve('game')));
                Scaffold.of(context).showSnackBar(snackbar);
              })
        ],
      ),
    );
  }
}
1
likes
20
pub points
0%
popularity

Publisher

unverified uploader

An awesome Flutter package to manage state of program declaratively and functionally.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on global_wings