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

A Flutter mvvm plugin.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'coding/coding.dart';
import 'mvvm.dart';
import 'store/index.dart';

late Store rootStore;
void main() {
  rootStore = Store();
  runApp(MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      initialRoute: '/index',
      routes: {
        '/mvvm': (BuildContext context) => Mvvm(),
        '/index': (BuildContext context) => AppIndex(),
      },
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: [
              SizedBox(height: 80),
              ElevatedButton(
                onPressed: () => Navigator.pushNamed(context, '/mvvm'),
                child: Text('测试响应式页面', style: TextStyle(fontSize: 16)),
              ),
              SizedBox(height: 20),
              ElevatedButton(
                onPressed: () => Navigator.pushNamed(context, '/index'),
                child: Text('coding', style: TextStyle(fontSize: 16)),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
85
pub points
60%
popularity

Publisher

unverified uploader

A Flutter mvvm plugin.

Homepage

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on ref